From b17c7092fec2c77f33723764cb33f9f06a2abe3c Mon Sep 17 00:00:00 2001 From: thxCode Date: Mon, 22 Apr 2024 00:01:53 +0800 Subject: [PATCH] refactor: template/catalog/connector/connectorbinding reconciling Signed-off-by: thxCode --- pkg/apis/walrus/v1/catalog.go | 2 +- pkg/apis/walrus/v1/connector.config.go | 42 + pkg/apis/walrus/v1/connector.go | 1 + pkg/apis/walrus/v1/connector_binding.go | 2 +- pkg/apis/walrus/v1/generated.pb.go | 1220 +++++++--- pkg/apis/walrus/v1/generated.proto | 40 +- pkg/apis/walrus/v1/setting.go | 4 - pkg/apis/walrus/v1/template.go | 2 +- pkg/apis/walrus/v1/variable.go | 7 - pkg/apis/walrus/v1/zz_generated.apiservice.go | 40 +- pkg/apis/walrus/v1/zz_generated.deepcopy.go | 60 +- pkg/apis/walrus/v1/zz_generated.register.go | 1 + pkg/apis/walruscore/v1/catalog.go | 20 +- pkg/apis/walruscore/v1/condition.go | 63 +- pkg/apis/walruscore/v1/connector.go | 102 +- pkg/apis/walruscore/v1/connector_binding.go | 41 +- pkg/apis/walruscore/v1/generated.pb.go | 1988 +++++++++-------- pkg/apis/walruscore/v1/generated.proto | 170 +- pkg/apis/walruscore/v1/resource.go | 14 +- pkg/apis/walruscore/v1/resource_components.go | 5 +- pkg/apis/walruscore/v1/resource_run.go | 8 +- pkg/apis/walruscore/v1/template.go | 39 +- pkg/apis/walruscore/v1/zz_generated.crds.go | 178 +- .../walruscore/v1/zz_generated.deepcopy.go | 116 +- pkg/apis/zz_generated.openapi.go | 502 +++-- .../zz_generated.openapi.violation_exceptions | 5 - pkg/apistatus/catalog_status.go | 65 +- pkg/apistatus/connector_status.go | 21 +- pkg/apistatus/template_status.go | 41 +- pkg/apistatus/walker.go | 11 +- pkg/apistatus/walker_test.go | 2 +- pkg/clients/applyconfiguration/utils.go | 10 +- .../walrus/v1/connectorbinding.go | 11 +- .../walruscore/v1/catalogspec.go | 18 +- .../walruscore/v1/catalogstatus.go | 38 +- .../walruscore/v1/connectorbinding.go | 11 +- .../walruscore/v1/connectorbindingspec.go | 4 +- .../walruscore/v1/connectorbindingstatus.go | 39 - .../walruscore/v1/connectorconfigentry.go | 20 +- .../v1/connectorreferencewithtype.go | 56 + .../walruscore/v1/connectorspec.go | 18 +- .../walruscore/v1/resourcecomponentsstatus.go | 10 +- .../walruscore/v1/resourcerunspec.go | 18 +- .../walruscore/v1/resourcespec.go | 18 +- .../walruscore/v1/templatereference.go | 35 + ...nce.go => templatereferencewithversion.go} | 21 +- .../walruscore/v1/templatestatus.go | 37 +- .../clientset/typed/walrus/v1/connector.go | 16 + .../typed/walrus/v1/connectorbinding.go | 48 - .../typed/walrus/v1/fake/fake_connector.go | 11 + .../walrus/v1/fake/fake_connectorbinding.go | 35 - .../typed/walruscore/v1/connectorbinding.go | 48 - .../v1/fake/fake_connectorbinding.go | 35 - .../walrus/project_subject.authz.go | 9 +- pkg/controllers/walrus/subject.authz.go | 3 +- pkg/controllers/walruscore/catalog.go | 393 +++- pkg/controllers/walruscore/connector.go | 200 +- .../walruscore/connector_binding.go | 187 +- pkg/controllers/walruscore/template.go | 206 +- pkg/extensionapi/storage.go | 139 +- pkg/extensionapis/walrus/catalog.go | 9 +- pkg/extensionapis/walrus/connector.config.go | 88 + pkg/extensionapis/walrus/connector.go | 15 +- pkg/extensionapis/walrus/connector_binding.go | 11 +- pkg/extensionapis/walrus/setting.go | 2 +- pkg/extensionapis/walrus/template.go | 2 +- pkg/extensionapis/walrus/variable.go | 4 +- pkg/resourcehandler/types.go | 22 +- .../alibaba/resourcehandler.go | 45 +- pkg/resourcehandlers/aws/resourcehandler.go | 45 +- pkg/resourcehandlers/azure/resourcehandler.go | 42 +- .../docker/resourcehandler.go | 41 +- .../google/resourcehandler.go | 41 +- pkg/resourcehandlers/k8s/driver.go | 22 +- pkg/resourcehandlers/k8s/resourcehandler.go | 36 +- pkg/resourcehandlers/registry.go | 55 +- pkg/resourcehandlers/types/util.go | 31 - .../unknown/resourcehandler.go | 34 +- pkg/resourcehandlers/validate.go | 35 - pkg/systemauthz/kuberes.go | 26 +- pkg/systemkuberes/connector.go | 86 +- pkg/systemkuberes/environment.go | 10 +- pkg/systemmeta/lock.go | 12 + pkg/templates/fetchers/vcsrepo/fetcher.go | 135 +- pkg/templates/listers/vcssource/lister.go | 46 +- pkg/webhooks/walruscore/catalog.go | 96 +- pkg/webhooks/walruscore/connector.go | 242 +- pkg/webhooks/walruscore/connector_binding.go | 106 +- pkg/webhooks/walruscore/template.go | 91 +- .../walruscore/zz_generated.webhooks.go | 5 +- .../generators/testdata/crd_gen/dummy.go | 4 +- .../generators/testdata/reflect_type/dummy.go | 4 +- 92 files changed, 4990 insertions(+), 2959 deletions(-) create mode 100644 pkg/apis/walrus/v1/connector.config.go delete mode 100644 pkg/clients/applyconfiguration/walruscore/v1/connectorbindingstatus.go create mode 100644 pkg/clients/applyconfiguration/walruscore/v1/connectorreferencewithtype.go create mode 100644 pkg/clients/applyconfiguration/walruscore/v1/templatereference.go rename pkg/clients/applyconfiguration/walruscore/v1/{tempalteversionreference.go => templatereferencewithversion.go} (51%) create mode 100644 pkg/extensionapis/walrus/connector.config.go delete mode 100644 pkg/resourcehandlers/types/util.go delete mode 100644 pkg/resourcehandlers/validate.go diff --git a/pkg/apis/walrus/v1/catalog.go b/pkg/apis/walrus/v1/catalog.go index d2b3f491c..e3130e3bf 100644 --- a/pkg/apis/walrus/v1/catalog.go +++ b/pkg/apis/walrus/v1/catalog.go @@ -10,7 +10,7 @@ import ( // // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"],subResources=["status"] +// +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"],shortName=["cat"],subResources=["status"] type Catalog walruscore.Catalog var _ runtime.Object = (*Catalog)(nil) diff --git a/pkg/apis/walrus/v1/connector.config.go b/pkg/apis/walrus/v1/connector.config.go new file mode 100644 index 000000000..32f751db5 --- /dev/null +++ b/pkg/apis/walrus/v1/connector.config.go @@ -0,0 +1,42 @@ +package v1 + +import ( + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + + walruscore "github.com/seal-io/walrus/pkg/apis/walruscore/v1" +) + +// ConnectorConfig is the subresource of the Connector resource for extract configuration. +// +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"] +type ConnectorConfig struct { + meta.TypeMeta `json:",inline"` + meta.ObjectMeta `json:"metadata,omitempty"` + + Status ConnectorConfigStatus `json:"status"` +} + +var _ runtime.Object = (*ConnectorConfig)(nil) + +// ConnectorConfigStatus defines the observed state of ConnectorConfig. +type ConnectorConfigStatus struct { + // ApplicableEnvironmentType is the environment type that the connector is applicable to. + ApplicableEnvironmentType walruscore.EnvironmentType `json:"applicableEnvironmentType"` + + // Category is the category of the connector. + Category walruscore.ConnectorCategory `json:"category"` + + // Type is the type of the connector. + Type string `json:"type"` + + // Version is the version of the configuration. + Version string `json:"version"` + + // Data is the configuration of the connector. + Data map[string][]byte `json:"data"` + + // ConditionSummary is the summary of the conditions. + walruscore.ConditionSummary `json:",inline"` +} diff --git a/pkg/apis/walrus/v1/connector.go b/pkg/apis/walrus/v1/connector.go index 0af954fd2..86290449a 100644 --- a/pkg/apis/walrus/v1/connector.go +++ b/pkg/apis/walrus/v1/connector.go @@ -9,6 +9,7 @@ import ( // Connector is the schema for the connectors API. // // +genclient +// +genclient:method=GetConfig,verb=get,subresource=config,result=ConnectorConfig // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"],shortName=["conn"],subResources=["status"] type Connector walruscore.Connector diff --git a/pkg/apis/walrus/v1/connector_binding.go b/pkg/apis/walrus/v1/connector_binding.go index 4b7c88cc3..7b9108860 100644 --- a/pkg/apis/walrus/v1/connector_binding.go +++ b/pkg/apis/walrus/v1/connector_binding.go @@ -10,7 +10,7 @@ import ( // // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"],shortName=["cb"],subResources=["status"] +// +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"],shortName=["connbd"] type ConnectorBinding walruscore.ConnectorBinding var _ runtime.Object = (*ConnectorBinding)(nil) diff --git a/pkg/apis/walrus/v1/generated.pb.go b/pkg/apis/walrus/v1/generated.pb.go index 2ec0d1fc3..5c14ebcb7 100644 --- a/pkg/apis/walrus/v1/generated.pb.go +++ b/pkg/apis/walrus/v1/generated.pb.go @@ -14,6 +14,7 @@ import ( io "io" proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" github_com_seal_io_walrus_pkg_apis_walruscore_v1 "github.com/seal-io/walrus/pkg/apis/walruscore/v1" v11 "github.com/seal-io/walrus/pkg/apis/walruscore/v1" @@ -176,10 +177,66 @@ func (m *ConnectorBindingList) XXX_DiscardUnknown() { var xxx_messageInfo_ConnectorBindingList proto.InternalMessageInfo +func (m *ConnectorConfig) Reset() { *m = ConnectorConfig{} } +func (*ConnectorConfig) ProtoMessage() {} +func (*ConnectorConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_213d995534ce8f7e, []int{5} +} +func (m *ConnectorConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConnectorConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ConnectorConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConnectorConfig.Merge(m, src) +} +func (m *ConnectorConfig) XXX_Size() int { + return m.Size() +} +func (m *ConnectorConfig) XXX_DiscardUnknown() { + xxx_messageInfo_ConnectorConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_ConnectorConfig proto.InternalMessageInfo + +func (m *ConnectorConfigStatus) Reset() { *m = ConnectorConfigStatus{} } +func (*ConnectorConfigStatus) ProtoMessage() {} +func (*ConnectorConfigStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_213d995534ce8f7e, []int{6} +} +func (m *ConnectorConfigStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConnectorConfigStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ConnectorConfigStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConnectorConfigStatus.Merge(m, src) +} +func (m *ConnectorConfigStatus) XXX_Size() int { + return m.Size() +} +func (m *ConnectorConfigStatus) XXX_DiscardUnknown() { + xxx_messageInfo_ConnectorConfigStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_ConnectorConfigStatus proto.InternalMessageInfo + func (m *ConnectorList) Reset() { *m = ConnectorList{} } func (*ConnectorList) ProtoMessage() {} func (*ConnectorList) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{5} + return fileDescriptor_213d995534ce8f7e, []int{7} } func (m *ConnectorList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -207,7 +264,7 @@ var xxx_messageInfo_ConnectorList proto.InternalMessageInfo func (m *Environment) Reset() { *m = Environment{} } func (*Environment) ProtoMessage() {} func (*Environment) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{6} + return fileDescriptor_213d995534ce8f7e, []int{8} } func (m *Environment) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -235,7 +292,7 @@ var xxx_messageInfo_Environment proto.InternalMessageInfo func (m *EnvironmentList) Reset() { *m = EnvironmentList{} } func (*EnvironmentList) ProtoMessage() {} func (*EnvironmentList) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{7} + return fileDescriptor_213d995534ce8f7e, []int{9} } func (m *EnvironmentList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -263,7 +320,7 @@ var xxx_messageInfo_EnvironmentList proto.InternalMessageInfo func (m *EnvironmentSpec) Reset() { *m = EnvironmentSpec{} } func (*EnvironmentSpec) ProtoMessage() {} func (*EnvironmentSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{8} + return fileDescriptor_213d995534ce8f7e, []int{10} } func (m *EnvironmentSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -291,7 +348,7 @@ var xxx_messageInfo_EnvironmentSpec proto.InternalMessageInfo func (m *EnvironmentStatus) Reset() { *m = EnvironmentStatus{} } func (*EnvironmentStatus) ProtoMessage() {} func (*EnvironmentStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{9} + return fileDescriptor_213d995534ce8f7e, []int{11} } func (m *EnvironmentStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -319,7 +376,7 @@ var xxx_messageInfo_EnvironmentStatus proto.InternalMessageInfo func (m *FileExample) Reset() { *m = FileExample{} } func (*FileExample) ProtoMessage() {} func (*FileExample) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{10} + return fileDescriptor_213d995534ce8f7e, []int{12} } func (m *FileExample) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -347,7 +404,7 @@ var xxx_messageInfo_FileExample proto.InternalMessageInfo func (m *FileExampleList) Reset() { *m = FileExampleList{} } func (*FileExampleList) ProtoMessage() {} func (*FileExampleList) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{11} + return fileDescriptor_213d995534ce8f7e, []int{13} } func (m *FileExampleList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -375,7 +432,7 @@ var xxx_messageInfo_FileExampleList proto.InternalMessageInfo func (m *FileExampleStatus) Reset() { *m = FileExampleStatus{} } func (*FileExampleStatus) ProtoMessage() {} func (*FileExampleStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{12} + return fileDescriptor_213d995534ce8f7e, []int{14} } func (m *FileExampleStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -403,7 +460,7 @@ var xxx_messageInfo_FileExampleStatus proto.InternalMessageInfo func (m *Project) Reset() { *m = Project{} } func (*Project) ProtoMessage() {} func (*Project) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{13} + return fileDescriptor_213d995534ce8f7e, []int{15} } func (m *Project) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -431,7 +488,7 @@ var xxx_messageInfo_Project proto.InternalMessageInfo func (m *ProjectList) Reset() { *m = ProjectList{} } func (*ProjectList) ProtoMessage() {} func (*ProjectList) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{14} + return fileDescriptor_213d995534ce8f7e, []int{16} } func (m *ProjectList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -459,7 +516,7 @@ var xxx_messageInfo_ProjectList proto.InternalMessageInfo func (m *ProjectSpec) Reset() { *m = ProjectSpec{} } func (*ProjectSpec) ProtoMessage() {} func (*ProjectSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{15} + return fileDescriptor_213d995534ce8f7e, []int{17} } func (m *ProjectSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -487,7 +544,7 @@ var xxx_messageInfo_ProjectSpec proto.InternalMessageInfo func (m *ProjectStatus) Reset() { *m = ProjectStatus{} } func (*ProjectStatus) ProtoMessage() {} func (*ProjectStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{16} + return fileDescriptor_213d995534ce8f7e, []int{18} } func (m *ProjectStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -515,7 +572,7 @@ var xxx_messageInfo_ProjectStatus proto.InternalMessageInfo func (m *ProjectSubject) Reset() { *m = ProjectSubject{} } func (*ProjectSubject) ProtoMessage() {} func (*ProjectSubject) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{17} + return fileDescriptor_213d995534ce8f7e, []int{19} } func (m *ProjectSubject) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -543,7 +600,7 @@ var xxx_messageInfo_ProjectSubject proto.InternalMessageInfo func (m *ProjectSubjects) Reset() { *m = ProjectSubjects{} } func (*ProjectSubjects) ProtoMessage() {} func (*ProjectSubjects) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{18} + return fileDescriptor_213d995534ce8f7e, []int{20} } func (m *ProjectSubjects) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -571,7 +628,7 @@ var xxx_messageInfo_ProjectSubjects proto.InternalMessageInfo func (m *Resource) Reset() { *m = Resource{} } func (*Resource) ProtoMessage() {} func (*Resource) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{19} + return fileDescriptor_213d995534ce8f7e, []int{21} } func (m *Resource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -599,7 +656,7 @@ var xxx_messageInfo_Resource proto.InternalMessageInfo func (m *ResourceComponents) Reset() { *m = ResourceComponents{} } func (*ResourceComponents) ProtoMessage() {} func (*ResourceComponents) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{20} + return fileDescriptor_213d995534ce8f7e, []int{22} } func (m *ResourceComponents) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -627,7 +684,7 @@ var xxx_messageInfo_ResourceComponents proto.InternalMessageInfo func (m *ResourceComponentsList) Reset() { *m = ResourceComponentsList{} } func (*ResourceComponentsList) ProtoMessage() {} func (*ResourceComponentsList) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{21} + return fileDescriptor_213d995534ce8f7e, []int{23} } func (m *ResourceComponentsList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -655,7 +712,7 @@ var xxx_messageInfo_ResourceComponentsList proto.InternalMessageInfo func (m *ResourceDefinition) Reset() { *m = ResourceDefinition{} } func (*ResourceDefinition) ProtoMessage() {} func (*ResourceDefinition) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{22} + return fileDescriptor_213d995534ce8f7e, []int{24} } func (m *ResourceDefinition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -683,7 +740,7 @@ var xxx_messageInfo_ResourceDefinition proto.InternalMessageInfo func (m *ResourceDefinitionList) Reset() { *m = ResourceDefinitionList{} } func (*ResourceDefinitionList) ProtoMessage() {} func (*ResourceDefinitionList) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{23} + return fileDescriptor_213d995534ce8f7e, []int{25} } func (m *ResourceDefinitionList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -711,7 +768,7 @@ var xxx_messageInfo_ResourceDefinitionList proto.InternalMessageInfo func (m *ResourceList) Reset() { *m = ResourceList{} } func (*ResourceList) ProtoMessage() {} func (*ResourceList) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{24} + return fileDescriptor_213d995534ce8f7e, []int{26} } func (m *ResourceList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -739,7 +796,7 @@ var xxx_messageInfo_ResourceList proto.InternalMessageInfo func (m *ResourceRun) Reset() { *m = ResourceRun{} } func (*ResourceRun) ProtoMessage() {} func (*ResourceRun) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{25} + return fileDescriptor_213d995534ce8f7e, []int{27} } func (m *ResourceRun) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -767,7 +824,7 @@ var xxx_messageInfo_ResourceRun proto.InternalMessageInfo func (m *ResourceRunList) Reset() { *m = ResourceRunList{} } func (*ResourceRunList) ProtoMessage() {} func (*ResourceRunList) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{26} + return fileDescriptor_213d995534ce8f7e, []int{28} } func (m *ResourceRunList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -795,7 +852,7 @@ var xxx_messageInfo_ResourceRunList proto.InternalMessageInfo func (m *Schema) Reset() { *m = Schema{} } func (*Schema) ProtoMessage() {} func (*Schema) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{27} + return fileDescriptor_213d995534ce8f7e, []int{29} } func (m *Schema) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -823,7 +880,7 @@ var xxx_messageInfo_Schema proto.InternalMessageInfo func (m *SchemaList) Reset() { *m = SchemaList{} } func (*SchemaList) ProtoMessage() {} func (*SchemaList) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{28} + return fileDescriptor_213d995534ce8f7e, []int{30} } func (m *SchemaList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -851,7 +908,7 @@ var xxx_messageInfo_SchemaList proto.InternalMessageInfo func (m *Setting) Reset() { *m = Setting{} } func (*Setting) ProtoMessage() {} func (*Setting) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{29} + return fileDescriptor_213d995534ce8f7e, []int{31} } func (m *Setting) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -879,7 +936,7 @@ var xxx_messageInfo_Setting proto.InternalMessageInfo func (m *SettingList) Reset() { *m = SettingList{} } func (*SettingList) ProtoMessage() {} func (*SettingList) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{30} + return fileDescriptor_213d995534ce8f7e, []int{32} } func (m *SettingList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -907,7 +964,7 @@ var xxx_messageInfo_SettingList proto.InternalMessageInfo func (m *SettingSpec) Reset() { *m = SettingSpec{} } func (*SettingSpec) ProtoMessage() {} func (*SettingSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{31} + return fileDescriptor_213d995534ce8f7e, []int{33} } func (m *SettingSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -935,7 +992,7 @@ var xxx_messageInfo_SettingSpec proto.InternalMessageInfo func (m *SettingStatus) Reset() { *m = SettingStatus{} } func (*SettingStatus) ProtoMessage() {} func (*SettingStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{32} + return fileDescriptor_213d995534ce8f7e, []int{34} } func (m *SettingStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -963,7 +1020,7 @@ var xxx_messageInfo_SettingStatus proto.InternalMessageInfo func (m *Subject) Reset() { *m = Subject{} } func (*Subject) ProtoMessage() {} func (*Subject) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{33} + return fileDescriptor_213d995534ce8f7e, []int{35} } func (m *Subject) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -991,7 +1048,7 @@ var xxx_messageInfo_Subject proto.InternalMessageInfo func (m *SubjectList) Reset() { *m = SubjectList{} } func (*SubjectList) ProtoMessage() {} func (*SubjectList) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{34} + return fileDescriptor_213d995534ce8f7e, []int{36} } func (m *SubjectList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1019,7 +1076,7 @@ var xxx_messageInfo_SubjectList proto.InternalMessageInfo func (m *SubjectLogin) Reset() { *m = SubjectLogin{} } func (*SubjectLogin) ProtoMessage() {} func (*SubjectLogin) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{35} + return fileDescriptor_213d995534ce8f7e, []int{37} } func (m *SubjectLogin) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1047,7 +1104,7 @@ var xxx_messageInfo_SubjectLogin proto.InternalMessageInfo func (m *SubjectLoginSpec) Reset() { *m = SubjectLoginSpec{} } func (*SubjectLoginSpec) ProtoMessage() {} func (*SubjectLoginSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{36} + return fileDescriptor_213d995534ce8f7e, []int{38} } func (m *SubjectLoginSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1075,7 +1132,7 @@ var xxx_messageInfo_SubjectLoginSpec proto.InternalMessageInfo func (m *SubjectLoginStatus) Reset() { *m = SubjectLoginStatus{} } func (*SubjectLoginStatus) ProtoMessage() {} func (*SubjectLoginStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{37} + return fileDescriptor_213d995534ce8f7e, []int{39} } func (m *SubjectLoginStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1103,7 +1160,7 @@ var xxx_messageInfo_SubjectLoginStatus proto.InternalMessageInfo func (m *SubjectProvider) Reset() { *m = SubjectProvider{} } func (*SubjectProvider) ProtoMessage() {} func (*SubjectProvider) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{38} + return fileDescriptor_213d995534ce8f7e, []int{40} } func (m *SubjectProvider) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1131,7 +1188,7 @@ var xxx_messageInfo_SubjectProvider proto.InternalMessageInfo func (m *SubjectProviderBitbucketConfig) Reset() { *m = SubjectProviderBitbucketConfig{} } func (*SubjectProviderBitbucketConfig) ProtoMessage() {} func (*SubjectProviderBitbucketConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{39} + return fileDescriptor_213d995534ce8f7e, []int{41} } func (m *SubjectProviderBitbucketConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1159,7 +1216,7 @@ var xxx_messageInfo_SubjectProviderBitbucketConfig proto.InternalMessageInfo func (m *SubjectProviderExternalConfig) Reset() { *m = SubjectProviderExternalConfig{} } func (*SubjectProviderExternalConfig) ProtoMessage() {} func (*SubjectProviderExternalConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{40} + return fileDescriptor_213d995534ce8f7e, []int{42} } func (m *SubjectProviderExternalConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1187,7 +1244,7 @@ var xxx_messageInfo_SubjectProviderExternalConfig proto.InternalMessageInfo func (m *SubjectProviderGitHubConfig) Reset() { *m = SubjectProviderGitHubConfig{} } func (*SubjectProviderGitHubConfig) ProtoMessage() {} func (*SubjectProviderGitHubConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{41} + return fileDescriptor_213d995534ce8f7e, []int{43} } func (m *SubjectProviderGitHubConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1215,7 +1272,7 @@ var xxx_messageInfo_SubjectProviderGitHubConfig proto.InternalMessageInfo func (m *SubjectProviderGitLabConfig) Reset() { *m = SubjectProviderGitLabConfig{} } func (*SubjectProviderGitLabConfig) ProtoMessage() {} func (*SubjectProviderGitLabConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{42} + return fileDescriptor_213d995534ce8f7e, []int{44} } func (m *SubjectProviderGitLabConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1243,7 +1300,7 @@ var xxx_messageInfo_SubjectProviderGitLabConfig proto.InternalMessageInfo func (m *SubjectProviderGiteaConfig) Reset() { *m = SubjectProviderGiteaConfig{} } func (*SubjectProviderGiteaConfig) ProtoMessage() {} func (*SubjectProviderGiteaConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{43} + return fileDescriptor_213d995534ce8f7e, []int{45} } func (m *SubjectProviderGiteaConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1271,7 +1328,7 @@ var xxx_messageInfo_SubjectProviderGiteaConfig proto.InternalMessageInfo func (m *SubjectProviderGoogleConfig) Reset() { *m = SubjectProviderGoogleConfig{} } func (*SubjectProviderGoogleConfig) ProtoMessage() {} func (*SubjectProviderGoogleConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{44} + return fileDescriptor_213d995534ce8f7e, []int{46} } func (m *SubjectProviderGoogleConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1299,7 +1356,7 @@ var xxx_messageInfo_SubjectProviderGoogleConfig proto.InternalMessageInfo func (m *SubjectProviderLDAPConfig) Reset() { *m = SubjectProviderLDAPConfig{} } func (*SubjectProviderLDAPConfig) ProtoMessage() {} func (*SubjectProviderLDAPConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{45} + return fileDescriptor_213d995534ce8f7e, []int{47} } func (m *SubjectProviderLDAPConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1327,7 +1384,7 @@ var xxx_messageInfo_SubjectProviderLDAPConfig proto.InternalMessageInfo func (m *SubjectProviderLDAPGroupSearch) Reset() { *m = SubjectProviderLDAPGroupSearch{} } func (*SubjectProviderLDAPGroupSearch) ProtoMessage() {} func (*SubjectProviderLDAPGroupSearch) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{46} + return fileDescriptor_213d995534ce8f7e, []int{48} } func (m *SubjectProviderLDAPGroupSearch) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1355,7 +1412,7 @@ var xxx_messageInfo_SubjectProviderLDAPGroupSearch proto.InternalMessageInfo func (m *SubjectProviderLDAPUserSearch) Reset() { *m = SubjectProviderLDAPUserSearch{} } func (*SubjectProviderLDAPUserSearch) ProtoMessage() {} func (*SubjectProviderLDAPUserSearch) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{47} + return fileDescriptor_213d995534ce8f7e, []int{49} } func (m *SubjectProviderLDAPUserSearch) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1385,7 +1442,7 @@ func (m *SubjectProviderLdapGroupSearchUserMatcher) Reset() { } func (*SubjectProviderLdapGroupSearchUserMatcher) ProtoMessage() {} func (*SubjectProviderLdapGroupSearchUserMatcher) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{48} + return fileDescriptor_213d995534ce8f7e, []int{50} } func (m *SubjectProviderLdapGroupSearchUserMatcher) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1413,7 +1470,7 @@ var xxx_messageInfo_SubjectProviderLdapGroupSearchUserMatcher proto.InternalMess func (m *SubjectProviderList) Reset() { *m = SubjectProviderList{} } func (*SubjectProviderList) ProtoMessage() {} func (*SubjectProviderList) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{49} + return fileDescriptor_213d995534ce8f7e, []int{51} } func (m *SubjectProviderList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1441,7 +1498,7 @@ var xxx_messageInfo_SubjectProviderList proto.InternalMessageInfo func (m *SubjectProviderMicrosoftConfig) Reset() { *m = SubjectProviderMicrosoftConfig{} } func (*SubjectProviderMicrosoftConfig) ProtoMessage() {} func (*SubjectProviderMicrosoftConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{50} + return fileDescriptor_213d995534ce8f7e, []int{52} } func (m *SubjectProviderMicrosoftConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1469,7 +1526,7 @@ var xxx_messageInfo_SubjectProviderMicrosoftConfig proto.InternalMessageInfo func (m *SubjectProviderOAuthClaimMapping) Reset() { *m = SubjectProviderOAuthClaimMapping{} } func (*SubjectProviderOAuthClaimMapping) ProtoMessage() {} func (*SubjectProviderOAuthClaimMapping) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{51} + return fileDescriptor_213d995534ce8f7e, []int{53} } func (m *SubjectProviderOAuthClaimMapping) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1497,7 +1554,7 @@ var xxx_messageInfo_SubjectProviderOAuthClaimMapping proto.InternalMessageInfo func (m *SubjectProviderOAuthConfig) Reset() { *m = SubjectProviderOAuthConfig{} } func (*SubjectProviderOAuthConfig) ProtoMessage() {} func (*SubjectProviderOAuthConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{52} + return fileDescriptor_213d995534ce8f7e, []int{54} } func (m *SubjectProviderOAuthConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1525,7 +1582,7 @@ var xxx_messageInfo_SubjectProviderOAuthConfig proto.InternalMessageInfo func (m *SubjectProviderOIDCConfig) Reset() { *m = SubjectProviderOIDCConfig{} } func (*SubjectProviderOIDCConfig) ProtoMessage() {} func (*SubjectProviderOIDCConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{53} + return fileDescriptor_213d995534ce8f7e, []int{55} } func (m *SubjectProviderOIDCConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1553,7 +1610,7 @@ var xxx_messageInfo_SubjectProviderOIDCConfig proto.InternalMessageInfo func (m *SubjectProviderSpec) Reset() { *m = SubjectProviderSpec{} } func (*SubjectProviderSpec) ProtoMessage() {} func (*SubjectProviderSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{54} + return fileDescriptor_213d995534ce8f7e, []int{56} } func (m *SubjectProviderSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1581,7 +1638,7 @@ var xxx_messageInfo_SubjectProviderSpec proto.InternalMessageInfo func (m *SubjectProviderStatus) Reset() { *m = SubjectProviderStatus{} } func (*SubjectProviderStatus) ProtoMessage() {} func (*SubjectProviderStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{55} + return fileDescriptor_213d995534ce8f7e, []int{57} } func (m *SubjectProviderStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1609,7 +1666,7 @@ var xxx_messageInfo_SubjectProviderStatus proto.InternalMessageInfo func (m *SubjectReference) Reset() { *m = SubjectReference{} } func (*SubjectReference) ProtoMessage() {} func (*SubjectReference) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{56} + return fileDescriptor_213d995534ce8f7e, []int{58} } func (m *SubjectReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1637,7 +1694,7 @@ var xxx_messageInfo_SubjectReference proto.InternalMessageInfo func (m *SubjectSpec) Reset() { *m = SubjectSpec{} } func (*SubjectSpec) ProtoMessage() {} func (*SubjectSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{57} + return fileDescriptor_213d995534ce8f7e, []int{59} } func (m *SubjectSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1665,7 +1722,7 @@ var xxx_messageInfo_SubjectSpec proto.InternalMessageInfo func (m *SubjectToken) Reset() { *m = SubjectToken{} } func (*SubjectToken) ProtoMessage() {} func (*SubjectToken) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{58} + return fileDescriptor_213d995534ce8f7e, []int{60} } func (m *SubjectToken) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1693,7 +1750,7 @@ var xxx_messageInfo_SubjectToken proto.InternalMessageInfo func (m *SubjectTokenSpec) Reset() { *m = SubjectTokenSpec{} } func (*SubjectTokenSpec) ProtoMessage() {} func (*SubjectTokenSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{59} + return fileDescriptor_213d995534ce8f7e, []int{61} } func (m *SubjectTokenSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1721,7 +1778,7 @@ var xxx_messageInfo_SubjectTokenSpec proto.InternalMessageInfo func (m *SubjectTokenStatus) Reset() { *m = SubjectTokenStatus{} } func (*SubjectTokenStatus) ProtoMessage() {} func (*SubjectTokenStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{60} + return fileDescriptor_213d995534ce8f7e, []int{62} } func (m *SubjectTokenStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1749,7 +1806,7 @@ var xxx_messageInfo_SubjectTokenStatus proto.InternalMessageInfo func (m *Template) Reset() { *m = Template{} } func (*Template) ProtoMessage() {} func (*Template) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{61} + return fileDescriptor_213d995534ce8f7e, []int{63} } func (m *Template) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1777,7 +1834,7 @@ var xxx_messageInfo_Template proto.InternalMessageInfo func (m *TemplateList) Reset() { *m = TemplateList{} } func (*TemplateList) ProtoMessage() {} func (*TemplateList) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{62} + return fileDescriptor_213d995534ce8f7e, []int{64} } func (m *TemplateList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1805,7 +1862,7 @@ var xxx_messageInfo_TemplateList proto.InternalMessageInfo func (m *Variable) Reset() { *m = Variable{} } func (*Variable) ProtoMessage() {} func (*Variable) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{63} + return fileDescriptor_213d995534ce8f7e, []int{65} } func (m *Variable) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1833,7 +1890,7 @@ var xxx_messageInfo_Variable proto.InternalMessageInfo func (m *VariableList) Reset() { *m = VariableList{} } func (*VariableList) ProtoMessage() {} func (*VariableList) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{64} + return fileDescriptor_213d995534ce8f7e, []int{66} } func (m *VariableList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1861,7 +1918,7 @@ var xxx_messageInfo_VariableList proto.InternalMessageInfo func (m *VariableSpec) Reset() { *m = VariableSpec{} } func (*VariableSpec) ProtoMessage() {} func (*VariableSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{65} + return fileDescriptor_213d995534ce8f7e, []int{67} } func (m *VariableSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1889,7 +1946,7 @@ var xxx_messageInfo_VariableSpec proto.InternalMessageInfo func (m *VariableStatus) Reset() { *m = VariableStatus{} } func (*VariableStatus) ProtoMessage() {} func (*VariableStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_213d995534ce8f7e, []int{66} + return fileDescriptor_213d995534ce8f7e, []int{68} } func (m *VariableStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1920,6 +1977,9 @@ func init() { proto.RegisterType((*Connector)(nil), "github.com.seal_io.walrus.pkg.apis.walrus.v1.Connector") proto.RegisterType((*ConnectorBinding)(nil), "github.com.seal_io.walrus.pkg.apis.walrus.v1.ConnectorBinding") proto.RegisterType((*ConnectorBindingList)(nil), "github.com.seal_io.walrus.pkg.apis.walrus.v1.ConnectorBindingList") + proto.RegisterType((*ConnectorConfig)(nil), "github.com.seal_io.walrus.pkg.apis.walrus.v1.ConnectorConfig") + proto.RegisterType((*ConnectorConfigStatus)(nil), "github.com.seal_io.walrus.pkg.apis.walrus.v1.ConnectorConfigStatus") + proto.RegisterMapType((map[string][]byte)(nil), "github.com.seal_io.walrus.pkg.apis.walrus.v1.ConnectorConfigStatus.DataEntry") proto.RegisterType((*ConnectorList)(nil), "github.com.seal_io.walrus.pkg.apis.walrus.v1.ConnectorList") proto.RegisterType((*Environment)(nil), "github.com.seal_io.walrus.pkg.apis.walrus.v1.Environment") proto.RegisterType((*EnvironmentList)(nil), "github.com.seal_io.walrus.pkg.apis.walrus.v1.EnvironmentList") @@ -1989,185 +2049,198 @@ func init() { } var fileDescriptor_213d995534ce8f7e = []byte{ - // 2850 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x5b, 0xcb, 0x6f, 0x1b, 0xc7, - 0x19, 0xf7, 0xae, 0xa8, 0xd7, 0x50, 0x92, 0xe5, 0xf1, 0x03, 0x8a, 0xd3, 0x48, 0xee, 0x1a, 0x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0f, 0x72, 0xbf, 0x83, - 0x24, 0xc5, 0x82, 0x7e, 0xa0, 0x80, 0x61, 0xbf, 0xf7, 0xed, 0xf7, 0xf2, 0xf0, 0xdc, 0x4c, 0x2b, - 0x0f, 0x0f, 0xb9, 0x1e, 0x4f, 0xff, 0x23, 0xb7, 0x65, 0xcf, 0xfb, 0x3b, 0x15, 0x8c, 0xf9, 0x91, - 0x58, 0x15, 0x62, 0xf6, 0x73, 0xdf, 0x1b, 0x89, 0x86, 0xfb, 0x7a, 0x14, 0x7d, 0x6f, 0xc2, 0x46, - 0xeb, 0x25, 0xec, 0x3a, 0x98, 0x94, 0x3d, 0x82, 0xb3, 0x00, 0x18, 0x0e, 0x2e, 0x63, 0x93, 0x12, - 0xbd, 0x26, 0x2a, 0x39, 0xc8, 0xc8, 0x7c, 0x30, 0x82, 0x22, 0x5c, 0xda, 0xab, 0x00, 0x26, 0xad, - 0xb2, 0xb2, 0xa2, 0xd6, 0x16, 0xf6, 0x97, 0x83, 0x60, 0x06, 0x37, 0x18, 0x11, 0x79, 0x63, 0xda, - 0x1f, 0x54, 0x70, 0x5c, 0xc8, 0xae, 0x3b, 0xd6, 0x36, 0x29, 0x63, 0xa7, 0x9f, 0x0f, 0x8d, 0x91, - 0x04, 0xfb, 0xee, 0x1e, 0xc5, 0xa1, 0xb1, 0x99, 0x99, 0xd6, 0x53, 0xf9, 0x13, 0x05, 0x4c, 0x4b, - 0x12, 0x05, 0x42, 0x4b, 0x0d, 0x63, 0x0b, 0xd3, 0x79, 0xcb, 0xdc, 0x24, 0x15, 0xb6, 0x8a, 0x1a, - 0x35, 0x82, 0x4d, 0xba, 0xb2, 0x20, 0xa6, 0x24, 0x28, 0xdb, 0x79, 0x41, 0x47, 0x01, 0x07, 0xbc, - 0x02, 0xc6, 0xbc, 0xbf, 0x8b, 0xd8, 0x70, 0x30, 0x15, 0x17, 0x6c, 0xa7, 0x84, 0xc4, 0xd8, 0x7c, - 0x64, 0x0c, 0xc5, 0x38, 0xa1, 0x06, 0x86, 0x2a, 0x8e, 0xd5, 0xb0, 0x59, 0xdc, 0x03, 0x17, 0x46, - 0x0b, 0x80, 0xb9, 0xbb, 0xc4, 0x29, 0x48, 0x8c, 0x68, 0xdf, 0x1d, 0x01, 0xcf, 0x49, 0xee, 0x2e, - 0xde, 0xa7, 0xd8, 0x31, 0xf5, 0x9a, 0xf0, 0x16, 0x83, 0x4c, 0xad, 0xac, 0xdb, 0x02, 0x00, 0x4b, - 0x5d, 0xe5, 0x6e, 0x75, 0x61, 0x6e, 0xdd, 0x53, 0x5b, 0x18, 0x61, 0x93, 0xc4, 0x7e, 0x23, 0xae, - 0x9e, 0xf5, 0x7a, 0x96, 0xde, 0xa0, 0xd5, 0x83, 0x77, 0xd1, 0x4d, 0xec, 0xdc, 0x9c, 0x6b, 0xd0, - 0xaa, 0x30, 0xc4, 0xb7, 0x4d, 0x4e, 0x40, 0x9e, 0x05, 0x16, 0x91, 0x45, 0xca, 0x86, 0x40, 0x43, - 0x77, 0x11, 0xdd, 0x5c, 0x59, 0x98, 0x8f, 0x46, 0xc4, 0x7e, 0x23, 0xae, 0x1e, 0xd6, 0xc1, 0x90, - 0xa7, 0x99, 0xef, 0x7d, 0xd9, 0xd9, 0x95, 0xae, 0x0c, 0x2d, 0x11, 0xba, 0xdc, 0x28, 0x09, 0x53, - 0xde, 0x4c, 0x72, 0x0a, 0x12, 0x46, 0x84, 0xb9, 0x9a, 0x5e, 0xe2, 0xbb, 0xe7, 0x21, 0x98, 0x5b, - 0xd5, 0x65, 0x73, 0xab, 0xba, 0x67, 0xae, 0xa6, 0x97, 0xe0, 0x0e, 0x18, 0x2d, 0xf9, 0xb8, 0x9e, - 0x1a, 0xe2, 0x16, 0x57, 0xbb, 0xb2, 0x28, 0x55, 0x49, 0x61, 0x9c, 0x1d, 0x13, 0x02, 0x22, 0x0a, - 0xad, 0x31, 0xa8, 0x54, 0x08, 0xc5, 0xfa, 0xd4, 0xf0, 0x21, 0x40, 0x65, 0x89, 0x69, 0x8a, 0x42, - 0x85, 0x13, 0x90, 0x67, 0x81, 0x27, 0xd5, 0xb2, 0x2a, 0x35, 0x3c, 0x35, 0x72, 0x18, 0x49, 0xe5, - 0xaa, 0x62, 0x49, 0xe5, 0x14, 0x24, 0x8c, 0xb0, 0xa4, 0xd6, 0x89, 0xe1, 0x58, 0xae, 0xb5, 0x49, - 0xa7, 0x46, 0x0f, 0x21, 0xa9, 0x37, 0x7c, 0x6d, 0xd1, 0xa4, 0x06, 0x44, 0x14, 0x5a, 0xd3, 0x7e, - 0xac, 0x80, 0x67, 0x5b, 0x40, 0xae, 0xaf, 0x16, 0xad, 0xe6, 0xbe, 0x06, 0x78, 0xed, 0x2b, 0x5f, - 0x7f, 0xa4, 0x80, 0xb3, 0xe9, 0x90, 0xeb, 0xfb, 0xb4, 0x46, 0x10, 0xdb, 0x57, 0xbe, 0xfe, 0x2c, - 0x03, 0x9e, 0x49, 0xdd, 0x5c, 0xe0, 0x39, 0x90, 0xa9, 0x5a, 0x2e, 0x95, 0xbf, 0x36, 0x2f, 0x5b, - 0x2e, 0x45, 0x7c, 0x04, 0xbe, 0x05, 0xa0, 0xbb, 0x45, 0xec, 0x15, 0xd3, 0xc5, 0x46, 0xc3, 0xc1, - 0xb7, 0xb1, 0x43, 0x36, 0x77, 0x44, 0xf7, 0x73, 0x56, 0xf0, 0xc3, 0x62, 0x82, 0x03, 0x35, 0x91, - 0x82, 0x0b, 0x60, 0xd2, 0xc5, 0xce, 0x36, 0x31, 0xf0, 0x9c, 0x61, 0x58, 0x0d, 0x93, 0x2e, 0xac, - 0x89, 0x4f, 0xd3, 0xe1, 0x07, 0x34, 0x69, 0x1c, 0x25, 0x24, 0xe0, 0x6d, 0x70, 0x26, 0x4e, 0x5b, - 0xd7, 0x5d, 0xf7, 0x03, 0xcb, 0x29, 0xf3, 0xed, 0x63, 0xb4, 0x30, 0x2d, 0x74, 0x9d, 0x29, 0x36, - 0xe5, 0x42, 0x29, 0xd2, 0xf0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76, 0x67, 0xc6, 0x03, 0x7e, 0x46, 0x40, 0x1e, 0x73, 0xf8, 0xde, 0x44, - 0x4d, 0x7f, 0x6f, 0x52, 0x40, 0x0f, 0x1e, 0x4f, 0x1f, 0x7b, 0xf8, 0x78, 0xfa, 0xd8, 0xa3, 0xc7, - 0xd3, 0xc7, 0xbe, 0xbd, 0x37, 0xad, 0x3c, 0xd8, 0x9b, 0x56, 0x1e, 0xee, 0x4d, 0x2b, 0x8f, 0xf6, - 0xa6, 0x95, 0x7f, 0xec, 0x4d, 0x2b, 0x3f, 0xf8, 0xe7, 0xf4, 0xb1, 0x77, 0x2e, 0xb5, 0xfd, 0x3f, - 0x7e, 0xf9, 0xed, 0xcb, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xa4, 0x6f, 0x0d, 0xaa, 0x21, 0x42, + // 3058 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x5b, 0xdb, 0x6f, 0x1b, 0xc7, + 0xd5, 0xf7, 0x52, 0x94, 0x44, 0x1d, 0x49, 0xb6, 0x3c, 0xbe, 0x40, 0x76, 0xbe, 0x48, 0xfe, 0x36, + 0x40, 0x90, 0x14, 0x0e, 0x15, 0x1b, 0xb9, 0x38, 0xd7, 0x46, 0x24, 0x65, 0x59, 0x89, 0xec, 0x08, + 0x43, 0xdb, 0x41, 0x93, 0xb4, 0xf1, 0x70, 0x39, 0x22, 0x27, 0x22, 0x77, 0x17, 0xbb, 0x43, 0x25, + 0x6a, 0x1f, 0x5a, 0xa0, 0x41, 0x11, 0xa0, 0x2f, 0xed, 0xdf, 0xd0, 0x97, 0x16, 0xe8, 0x0d, 0x68, + 0x0b, 0xb4, 0x68, 0x51, 0x20, 0x0f, 0x45, 0xdd, 0x16, 0x41, 0x82, 0x06, 0x48, 0xf3, 0x52, 0x21, + 0x76, 0xd1, 0xb7, 0x3e, 0xf5, 0xa1, 0x0f, 0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bd, 0xe7, 0xa5, 0x01, 0x6c, 0x74, + 0x6f, 0x40, 0x9f, 0x66, 0x00, 0xf9, 0xa2, 0x45, 0xab, 0x69, 0x5b, 0x26, 0x35, 0x87, 0x02, 0x8b, + 0xb7, 0x63, 0x49, 0xbc, 0xd2, 0x7f, 0x80, 0xa1, 0xd7, 0xa9, 0xe9, 0x74, 0x12, 0xe9, 0x7c, 0xf9, + 0x40, 0xac, 0x75, 0x4f, 0xec, 0x1d, 0x0d, 0x4e, 0xb7, 0x0f, 0x1a, 0x42, 0x93, 0x67, 0xf1, 0x7a, + 0x2b, 0x1d, 0x44, 0xac, 0x29, 0x75, 0x17, 0x05, 0x4f, 0x89, 0x6e, 0x32, 0x53, 0x9e, 0x67, 0xef, + 0x27, 0xf0, 0x84, 0x5e, 0x0f, 0x03, 0x3c, 0x11, 0x6b, 0xbd, 0x83, 0x27, 0x1c, 0x74, 0x5f, 0x81, + 0x27, 0x74, 0x3b, 0x05, 0x3c, 0x1f, 0x6a, 0x30, 0xe3, 0x0b, 0x0f, 0x21, 0xb2, 0xb7, 0xe2, 0x91, + 0x3d, 0xdb, 0x7f, 0x64, 0x29, 0xf1, 0x7c, 0x90, 0x81, 0x69, 0x5f, 0x04, 0xb7, 0x86, 0x51, 0x05, + 0x46, 0xac, 0x0a, 0x96, 0xfb, 0x8f, 0x08, 0xb7, 0xd2, 0xe1, 0xbf, 0x95, 0x80, 0x7f, 0x71, 0x30, + 0x33, 0xdd, 0x71, 0xff, 0x89, 0x06, 0xc7, 0x22, 0xd2, 0x43, 0x80, 0x45, 0x25, 0x0e, 0x8b, 0x17, + 0x06, 0x8a, 0x2e, 0x05, 0x19, 0x7f, 0xd5, 0x60, 0xa2, 0x2c, 0x2f, 0x16, 0x87, 0x00, 0x8a, 0xcd, + 0xc4, 0x39, 0xba, 0x8f, 0xed, 0x89, 0xe7, 0xeb, 0x1e, 0x53, 0xf5, 0x27, 0x0d, 0xc0, 0x13, 0x1c, + 0xc2, 0x2c, 0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 0x23, 0x7d, 0x3d, 0x8c, 0x73, 0x6f, 0x9b, 0x8d, + 0xee, 0x2d, 0xec, 0x32, 0xcc, 0x25, 0x3d, 0x42, 0x17, 0x01, 0x0c, 0x87, 0x56, 0xa9, 0xc9, 0x19, + 0x69, 0xa8, 0x4a, 0x0e, 0x32, 0x52, 0x0c, 0x38, 0x38, 0x22, 0xa5, 0x3f, 0x03, 0xa8, 0xdd, 0xaa, + 0x28, 0x2b, 0x6e, 0x6d, 0x51, 0xbf, 0x1d, 0x04, 0x33, 0x78, 0x5d, 0x10, 0xb1, 0xc7, 0xd3, 0xff, + 0x90, 0x81, 0x63, 0x6a, 0xec, 0x86, 0x63, 0x6d, 0xb3, 0x2a, 0x75, 0x46, 0x79, 0xd3, 0x18, 0x49, + 0xb0, 0xef, 0xee, 0x61, 0x6c, 0x1a, 0x3b, 0x99, 0xe9, 0x3e, 0x95, 0x3f, 0xd6, 0x60, 0x21, 0x31, + 0xa2, 0xc0, 0x78, 0xa5, 0x65, 0x6c, 0x51, 0xae, 0x9e, 0x29, 0x9c, 0x87, 0x9c, 0xd1, 0x60, 0xd4, + 0xe4, 0x6b, 0x25, 0x35, 0x25, 0x41, 0xd9, 0x16, 0x15, 0x1d, 0x07, 0x12, 0xe8, 0x12, 0xcc, 0x78, + 0x7f, 0x97, 0xa9, 0xe1, 0x50, 0xae, 0x3e, 0xb0, 0x9d, 0x54, 0x23, 0x66, 0x8a, 0x11, 0x1e, 0x8e, + 0x49, 0x22, 0x1d, 0x26, 0x6a, 0x8e, 0xd5, 0xb2, 0x45, 0xdc, 0x63, 0x8f, 0x4c, 0x15, 0x40, 0xb8, + 0xbb, 0x2a, 0x29, 0x58, 0x71, 0xf4, 0xef, 0xe4, 0xe0, 0xc1, 0x84, 0xbb, 0x2b, 0xef, 0x72, 0xea, + 0x98, 0xa4, 0xa1, 0xbc, 0xa5, 0x90, 0x6d, 0x54, 0x89, 0xad, 0x00, 0xb0, 0x3a, 0x50, 0xee, 0xd6, + 0x4b, 0xcb, 0x1b, 0x9e, 0xda, 0x42, 0x4e, 0x4c, 0x92, 0xf8, 0x8d, 0xa5, 0x7a, 0x71, 0xd6, 0xb3, + 0x48, 0x8b, 0xd7, 0xf7, 0x7f, 0x8a, 0xee, 0x60, 0xe7, 0xd5, 0xe5, 0x16, 0xaf, 0x2b, 0x43, 0x72, + 0xd9, 0x94, 0x04, 0xec, 0x59, 0x10, 0x11, 0x59, 0xac, 0x6a, 0x28, 0x34, 0x0c, 0x16, 0xd1, 0xab, + 0x6b, 0xa5, 0x62, 0x34, 0x22, 0xf1, 0x1b, 0x4b, 0xf5, 0xa8, 0x09, 0x13, 0x9e, 0x66, 0xb9, 0xf6, + 0x4d, 0x5f, 0x5c, 0x1b, 0xc8, 0xd0, 0x2a, 0xe3, 0x57, 0x5a, 0x15, 0x65, 0xca, 0x9b, 0x49, 0x49, + 0xc1, 0xca, 0x88, 0x32, 0xd7, 0x20, 0x15, 0xb9, 0x7a, 0x1e, 0x80, 0xb9, 0x75, 0x92, 0x34, 0xb7, + 0x4e, 0x3c, 0x73, 0x0d, 0x52, 0x41, 0x3b, 0x30, 0x55, 0xf1, 0x71, 0xad, 0x9e, 0x28, 0xac, 0x0f, + 0x64, 0x31, 0x51, 0x25, 0x85, 0x59, 0xb1, 0x4d, 0x08, 0x88, 0x38, 0xb4, 0x26, 0xa0, 0x52, 0x63, + 0x9c, 0x92, 0xf9, 0xc9, 0x03, 0x80, 0xca, 0xaa, 0xd0, 0x14, 0x85, 0x8a, 0x24, 0x60, 0xcf, 0x82, + 0x4c, 0xaa, 0x65, 0xd5, 0x1a, 0x74, 0x3e, 0x77, 0x10, 0x49, 0x95, 0xaa, 0x62, 0x49, 0x95, 0x14, + 0xac, 0x8c, 0x88, 0xa4, 0x36, 0x99, 0xe1, 0x58, 0xae, 0xb5, 0xc9, 0xe7, 0xa7, 0x0e, 0x20, 0xa9, + 0x57, 0x7d, 0x6d, 0xd1, 0xa4, 0x06, 0x44, 0x1c, 0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x3e, 0xbb, 0xbb, + 0xa0, 0x7d, 0x7e, 0x77, 0x41, 0xfb, 0xde, 0x3f, 0x16, 0x8e, 0xbc, 0x7e, 0xbe, 0xe7, 0xff, 0xf1, + 0x5b, 0xda, 0xbe, 0xf0, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0xa8, 0x56, 0x87, 0x48, 0x45, 0x00, 0x00, } @@ -2344,16 +2417,6 @@ func (m *ConnectorBinding) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a { size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -2424,6 +2487,128 @@ func (m *ConnectorBindingList) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ConnectorConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConnectorConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConnectorConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ConnectorConfigStatus) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConnectorConfigStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConnectorConfigStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ConditionSummary.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + if len(m.Data) > 0 { + keysForData := make([]string, 0, len(m.Data)) + for k := range m.Data { + keysForData = append(keysForData, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForData) + for iNdEx := len(keysForData) - 1; iNdEx >= 0; iNdEx-- { + v := m.Data[string(keysForData[iNdEx])] + baseI := i + if v != nil { + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + } + i -= len(keysForData[iNdEx]) + copy(dAtA[i:], keysForData[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForData[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x22 + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x1a + i -= len(m.Category) + copy(dAtA[i:], m.Category) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Category))) + i-- + dAtA[i] = 0x12 + i -= len(m.ApplicableEnvironmentType) + copy(dAtA[i:], m.ApplicableEnvironmentType) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.ApplicableEnvironmentType))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *ConnectorList) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -5382,8 +5567,6 @@ func (m *ConnectorBinding) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = m.Spec.Size() n += 1 + l + sovGenerated(uint64(l)) - l = m.Status.Size() - n += 1 + l + sovGenerated(uint64(l)) return n } @@ -5404,15 +5587,59 @@ func (m *ConnectorBindingList) Size() (n int) { return n } -func (m *ConnectorList) Size() (n int) { +func (m *ConnectorConfig) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.ListMeta.Size() + l = m.ObjectMeta.Size() n += 1 + l + sovGenerated(uint64(l)) - if len(m.Items) > 0 { + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *ConnectorConfigStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ApplicableEnvironmentType) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Category) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Version) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Data) > 0 { + for k, v := range m.Data { + _ = k + _ = v + l = 0 + if v != nil { + l = 1 + len(v) + sovGenerated(uint64(len(v))) + } + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + l + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + l = m.ConditionSummary.Size() + n += 1 + l + sovGenerated(uint64(l)) + return n +} + +func (m *ConnectorList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { for _, e := range m.Items { l = e.Size() n += 1 + l + sovGenerated(uint64(l)) @@ -6478,7 +6705,6 @@ func (this *ConnectorBinding) String() string { s := strings.Join([]string{`&ConnectorBinding{`, `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, `Spec:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Spec), "ConnectorBindingSpec", "v11.ConnectorBindingSpec", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Status), "ConnectorBindingStatus", "v11.ConnectorBindingStatus", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -6499,6 +6725,42 @@ func (this *ConnectorBindingList) String() string { }, "") return s } +func (this *ConnectorConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ConnectorConfig{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "ConnectorConfigStatus", "ConnectorConfigStatus", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *ConnectorConfigStatus) String() string { + if this == nil { + return "nil" + } + keysForData := make([]string, 0, len(this.Data)) + for k := range this.Data { + keysForData = append(keysForData, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForData) + mapStringForData := "map[string][]byte{" + for _, k := range keysForData { + mapStringForData += fmt.Sprintf("%v: %v,", k, this.Data[k]) + } + mapStringForData += "}" + s := strings.Join([]string{`&ConnectorConfigStatus{`, + `ApplicableEnvironmentType:` + fmt.Sprintf("%v", this.ApplicableEnvironmentType) + `,`, + `Category:` + fmt.Sprintf("%v", this.Category) + `,`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, + `Data:` + mapStringForData + `,`, + `ConditionSummary:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ConditionSummary), "ConditionSummary", "v11.ConditionSummary", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} func (this *ConnectorList) String() string { if this == nil { return "nil" @@ -7830,9 +8092,59 @@ func (m *ConnectorBinding) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConnectorBindingList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConnectorBindingList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConnectorBindingList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7859,7 +8171,41 @@ func (m *ConnectorBinding) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, v11.ConnectorBinding{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7884,7 +8230,7 @@ func (m *ConnectorBinding) Unmarshal(dAtA []byte) error { } return nil } -func (m *ConnectorBindingList) Unmarshal(dAtA []byte) error { +func (m *ConnectorConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7907,15 +8253,15 @@ func (m *ConnectorBindingList) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ConnectorBindingList: wiretype end group for non-group") + return fmt.Errorf("proto: ConnectorConfig: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ConnectorBindingList: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ConnectorConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7942,13 +8288,13 @@ func (m *ConnectorBindingList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7975,8 +8321,346 @@ func (m *ConnectorBindingList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, v11.ConnectorBinding{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConnectorConfigStatus) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConnectorConfigStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConnectorConfigStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ApplicableEnvironmentType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ApplicableEnvironmentType = github_com_seal_io_walrus_pkg_apis_walruscore_v1.EnvironmentType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Category", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Category = github_com_seal_io_walrus_pkg_apis_walruscore_v1.ConnectorCategory(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Data == nil { + m.Data = make(map[string][]byte) + } + var mapkey string + mapvalue := []byte{} + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapbyteLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapbyteLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intMapbyteLen := int(mapbyteLen) + if intMapbyteLen < 0 { + return ErrInvalidLengthGenerated + } + postbytesIndex := iNdEx + intMapbyteLen + if postbytesIndex < 0 { + return ErrInvalidLengthGenerated + } + if postbytesIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = make([]byte, mapbyteLen) + copy(mapvalue, dAtA[iNdEx:postbytesIndex]) + iNdEx = postbytesIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Data[mapkey] = mapvalue + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConditionSummary", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ConditionSummary.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/pkg/apis/walrus/v1/generated.proto b/pkg/apis/walrus/v1/generated.proto index 8dc93ca0b..840ff547c 100644 --- a/pkg/apis/walrus/v1/generated.proto +++ b/pkg/apis/walrus/v1/generated.proto @@ -23,7 +23,7 @@ option go_package = "github.com/seal-io/walrus/pkg/apis/walrus/v1"; // // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"],subResources=["status"] +// +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"],shortName=["cat"],subResources=["status"] message Catalog { optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; @@ -44,6 +44,7 @@ message CatalogList { // Connector is the schema for the connectors API. // // +genclient +// +genclient:method=GetConfig,verb=get,subresource=config,result=ConnectorConfig // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"],shortName=["conn"],subResources=["status"] message Connector { @@ -58,13 +59,11 @@ message Connector { // // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"],shortName=["cb"],subResources=["status"] +// +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"],shortName=["connbd"] message ConnectorBinding { optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; optional github.com.seal_io.walrus.pkg.apis.walruscore.v1.ConnectorBindingSpec spec = 2; - - optional github.com.seal_io.walrus.pkg.apis.walruscore.v1.ConnectorBindingStatus status = 3; } // ConnectorBindingList contains a list of ConnectorBinding. @@ -76,6 +75,37 @@ message ConnectorBindingList { repeated github.com.seal_io.walrus.pkg.apis.walruscore.v1.ConnectorBinding items = 2; } +// ConnectorConfig is the subresource of the Connector resource for extract configuration. +// +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"] +message ConnectorConfig { + optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; + + optional ConnectorConfigStatus status = 2; +} + +// ConnectorConfigStatus defines the observed state of ConnectorConfig. +message ConnectorConfigStatus { + // ApplicableEnvironmentType is the environment type that the connector is applicable to. + optional string applicableEnvironmentType = 1; + + // Category is the category of the connector. + optional string category = 2; + + // Type is the type of the connector. + optional string type = 3; + + // Version is the version of the configuration. + optional string version = 4; + + // Data is the configuration of the connector. + map data = 5; + + // ConditionSummary is the summary of the conditions. + optional github.com.seal_io.walrus.pkg.apis.walruscore.v1.ConditionSummary conditionSummary = 6; +} + // ConnectorList holds the list of Connector. // // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -845,7 +875,7 @@ message SubjectTokenStatus { // // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"],shortName=["tpl"],subResources=["status"] +// +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"],shortName=["tmpl"],subResources=["status"] message Template { optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; diff --git a/pkg/apis/walrus/v1/setting.go b/pkg/apis/walrus/v1/setting.go index 6fc5c5335..c973fdc85 100644 --- a/pkg/apis/walrus/v1/setting.go +++ b/pkg/apis/walrus/v1/setting.go @@ -58,10 +58,6 @@ type SettingStatus struct { Value_ string `json:"-"` } -func (in *Setting) Equal(in2 *Setting) bool { - return in.Status.Value_ == in2.Status.Value_ -} - // SettingList holds the list of Setting. // // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/walrus/v1/template.go b/pkg/apis/walrus/v1/template.go index e352f7a16..3e21dd002 100644 --- a/pkg/apis/walrus/v1/template.go +++ b/pkg/apis/walrus/v1/template.go @@ -10,7 +10,7 @@ import ( // // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"],shortName=["tpl"],subResources=["status"] +// +k8s:apireg-gen:resource:scope="Namespaced",categories=["walrus"],shortName=["tmpl"],subResources=["status"] type Template walruscore.Template var _ runtime.Object = (*Template)(nil) diff --git a/pkg/apis/walrus/v1/variable.go b/pkg/apis/walrus/v1/variable.go index 66bdbe4c8..790518010 100644 --- a/pkg/apis/walrus/v1/variable.go +++ b/pkg/apis/walrus/v1/variable.go @@ -2,7 +2,6 @@ package v1 import ( "errors" - "reflect" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -89,12 +88,6 @@ type VariableStatus struct { Value_ string `json:"-"` } -func (in *Variable) Equal(in2 *Variable) bool { - return reflect.DeepEqual(in.Spec, in2.Spec) && - in.Status.Scope == in2.Status.Scope && - in.Status.Value_ == in2.Status.Value_ -} - // VariableList holds the list of Variable. // // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/walrus/v1/zz_generated.apiservice.go b/pkg/apis/walrus/v1/zz_generated.apiservice.go index 416e7e18f..3795994c0 100644 --- a/pkg/apis/walrus/v1/zz_generated.apiservice.go +++ b/pkg/apis/walrus/v1/zz_generated.apiservice.go @@ -75,7 +75,9 @@ func (*Catalog) GetSingularName() string { var _ rest.ShortNamesProvider = (*Catalog)(nil) func (*Catalog) ShortNames() []string { - return []string{} + return []string{ + "cat", + } } var _ rest.CategoriesProvider = (*Catalog)(nil) @@ -154,7 +156,7 @@ var _ rest.ShortNamesProvider = (*ConnectorBinding)(nil) func (*ConnectorBinding) ShortNames() []string { return []string{ - "cb", + "connbd", } } @@ -166,10 +168,36 @@ func (*ConnectorBinding) Categories() []string { } } -var _ WithStatusSubResource = (*ConnectorBinding)(nil) +var _ rest.Scoper = (*ConnectorConfig)(nil) + +func (*ConnectorConfig) NamespaceScoped() bool { + return true +} + +var _ rest.KindProvider = (*ConnectorConfig)(nil) + +func (*ConnectorConfig) Kind() string { + return "ConnectorConfig" +} + +var _ rest.SingularNameProvider = (*ConnectorConfig)(nil) -func (in *ConnectorBinding) CopyStatusTo(out runtime.Object) { - out.(*ConnectorBinding).Status = in.Status +func (*ConnectorConfig) GetSingularName() string { + return "connectorconfig" +} + +var _ rest.ShortNamesProvider = (*ConnectorConfig)(nil) + +func (*ConnectorConfig) ShortNames() []string { + return []string{} +} + +var _ rest.CategoriesProvider = (*ConnectorConfig)(nil) + +func (*ConnectorConfig) Categories() []string { + return []string{ + "walrus", + } } var _ rest.Scoper = (*Environment)(nil) @@ -680,7 +708,7 @@ var _ rest.ShortNamesProvider = (*Template)(nil) func (*Template) ShortNames() []string { return []string{ - "tpl", + "tmpl", } } diff --git a/pkg/apis/walrus/v1/zz_generated.deepcopy.go b/pkg/apis/walrus/v1/zz_generated.deepcopy.go index 311d76590..1748364cf 100644 --- a/pkg/apis/walrus/v1/zz_generated.deepcopy.go +++ b/pkg/apis/walrus/v1/zz_generated.deepcopy.go @@ -108,7 +108,6 @@ func (in *ConnectorBinding) DeepCopyInto(out *ConnectorBinding) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) out.Spec = in.Spec - out.Status = in.Status return } @@ -163,6 +162,65 @@ func (in *ConnectorBindingList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConnectorConfig) DeepCopyInto(out *ConnectorConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectorConfig. +func (in *ConnectorConfig) DeepCopy() *ConnectorConfig { + if in == nil { + return nil + } + out := new(ConnectorConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ConnectorConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConnectorConfigStatus) DeepCopyInto(out *ConnectorConfigStatus) { + *out = *in + if in.Data != nil { + in, out := &in.Data, &out.Data + *out = make(map[string][]byte, len(*in)) + for key, val := range *in { + var outVal []byte + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = make([]byte, len(*in)) + copy(*out, *in) + } + (*out)[key] = outVal + } + } + out.ConditionSummary = in.ConditionSummary + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectorConfigStatus. +func (in *ConnectorConfigStatus) DeepCopy() *ConnectorConfigStatus { + if in == nil { + return nil + } + out := new(ConnectorConfigStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ConnectorList) DeepCopyInto(out *ConnectorList) { *out = *in diff --git a/pkg/apis/walrus/v1/zz_generated.register.go b/pkg/apis/walrus/v1/zz_generated.register.go index 971c98e36..d8d53a679 100644 --- a/pkg/apis/walrus/v1/zz_generated.register.go +++ b/pkg/apis/walrus/v1/zz_generated.register.go @@ -61,6 +61,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &Connector{}, &ConnectorBinding{}, &ConnectorBindingList{}, + &ConnectorConfig{}, &ConnectorList{}, &Environment{}, &EnvironmentList{}, diff --git a/pkg/apis/walruscore/v1/catalog.go b/pkg/apis/walruscore/v1/catalog.go index 450467ead..3c5d0005d 100644 --- a/pkg/apis/walruscore/v1/catalog.go +++ b/pkg/apis/walruscore/v1/catalog.go @@ -22,6 +22,9 @@ var _ runtime.Object = (*Catalog)(nil) // CatalogSpec defines the desired state of Catalog. type CatalogSpec struct { + // Description of the catalog. + Description string `json:"description,omitempty"` + // Builtin indicate the catalog is builtin catalog. // // +k8s:validation:cel[0]:rule="oldSelf == self" @@ -34,9 +37,6 @@ type CatalogSpec struct { // +k8s:validation:cel[0]:message="immutable field" TemplateFormat string `json:"templateFormat"` - // Description of the catalog. - Description string `json:"description,omitempty"` - // Filters specifies the filtering rules for the catalog. Filters *Filters `json:"filters,omitempty"` @@ -49,17 +49,17 @@ type CatalogStatus struct { // StatusDescriptor defines the status of the catalog. StatusDescriptor `json:",inline"` - // LastSyncTime record the last sync catalog time. - LastSyncTime meta.Time `json:"lastSyncTime,omitempty"` - - // TemplateCount is the count of templates. - TemplateCount int64 `json:"templateCount,omitempty"` + // Project is the project to which the catalog belongs. + Project string `json:"project,omitempty"` // URL of the catalog. URL string `json:"url,omitempty"` - // Project is the project to which the catalog belongs. - Project string `json:"project,omitempty"` + // TemplateCount records the count of the related templates. + TemplateCount int64 `json:"templateCount,omitempty"` + + // LastSuccessfulSyncTime records the last time the catalog was synchronized successfully. + LastSuccessfulSyncTime *meta.Time `json:"lastSuccessfulSyncTime,omitempty"` } // CatalogList holds the list of Catalog. diff --git a/pkg/apis/walruscore/v1/condition.go b/pkg/apis/walruscore/v1/condition.go index e681725fb..bb3f92b72 100644 --- a/pkg/apis/walruscore/v1/condition.go +++ b/pkg/apis/walruscore/v1/condition.go @@ -65,6 +65,48 @@ func (c ConditionType) IsUnknown(obj any) bool { return getStatus(obj, string(c)) == string(ConditionUnknown) } +// IsTrueOrFalse check status value for object, +// which must be True or False, +// object must be a pointer. +func (c ConditionType) IsTrueOrFalse(obj any) bool { + cond := findCond(obj, string(c)) + if cond == nil { + return false + } + st := getFieldValue(*cond, "Status").String() + return st == string(ConditionTrue) || st == string(ConditionFalse) +} + +// IsTrueOrUnknown check status value for object, +// which must be Unknown or True, +// object must be a pointer. +func (c ConditionType) IsTrueOrUnknown(obj any) bool { + cond := findCond(obj, string(c)) + if cond == nil { + return false + } + st := getFieldValue(*cond, "Status").String() + return st == string(ConditionTrue) || st == string(ConditionUnknown) +} + +// IsFalseOrUnknown check status value for object, +// which must be Unknown or False, +// object must be a pointer. +func (c ConditionType) IsFalseOrUnknown(obj any) bool { + cond := findCond(obj, string(c)) + if cond == nil { + return false + } + st := getFieldValue(*cond, "Status").String() + return st == string(ConditionFalse) || st == string(ConditionUnknown) +} + +// Exists check conditionType exists in object field .Status.Conditions, +// object must be a pointer. +func (c ConditionType) Exists(obj any) bool { + return findCond(obj, string(c)) != nil +} + // GetStatus get status from conditionType for object field .Status.Conditions. func (c ConditionType) GetStatus(obj any) string { return getStatus(obj, string(c)) @@ -157,8 +199,22 @@ func (c ConditionType) SetMessageIfBlank(obj any, message string) { // Reset clean the object field .Status.Conditions, // and set the status as Unknown type into the object field .Status.Conditions, // object must be a pointer. -func (c ConditionType) Reset(obj any, message string) { - resetCond(obj, string(c), string(meta.ConditionUnknown), message) +func (c ConditionType) Reset(obj any, reason, message string) { + resetCond(obj, string(c), string(meta.ConditionUnknown), reason, message) +} + +// ResetTrue clean the object field .Status.Conditions, +// and set the status as True type into the object field .Status.Conditions, +// object must be a pointer. +func (c ConditionType) ResetTrue(obj any, reason, message string) { + resetCond(obj, string(c), string(meta.ConditionTrue), reason, message) +} + +// ResetFalse clean the object field .Status.Conditions, +// and set the status as False type into the object field .Status.Conditions, +// object must be a pointer. +func (c ConditionType) ResetFalse(obj any, reason, message string) { + resetCond(obj, string(c), string(meta.ConditionFalse), reason, message) } // upsertTS create to update condition and set last transition time. @@ -264,12 +320,13 @@ func upsertCond(obj any, condName string) reflect.Value { } // resetCond clean the object field .Status.Conditions, and set the status to Unknown. -func resetCond(obj any, condName, status, message string) { +func resetCond(obj any, condName, status, reason, message string) { conds := getValue(obj, "Status", "Conditions") newCond := reflect.New(conds.Type().Elem()).Elem() newCond.FieldByName("Type").SetString(condName) newCond.FieldByName("Status").SetString(status) + newCond.FieldByName("Reason").SetString(reason) newCond.FieldByName("Message").SetString(message) setTS(newCond) diff --git a/pkg/apis/walruscore/v1/connector.go b/pkg/apis/walruscore/v1/connector.go index dd1913440..4385d1b5b 100644 --- a/pkg/apis/walruscore/v1/connector.go +++ b/pkg/apis/walruscore/v1/connector.go @@ -3,6 +3,7 @@ package v1 import ( meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/types" ) // Connector is the schema for the connectors API. @@ -20,40 +21,96 @@ type Connector struct { var _ runtime.Object = (*Connector)(nil) +// ConnectorReference is a reference to a connector. +type ConnectorReference struct { + // Name is the name of the connector. + Name string `json:"name"` + // Namespace is the namespace of the connector. + Namespace string `json:"namespace"` +} + +func (in *ConnectorReference) ToNamespacedName() types.NamespacedName { + return types.NamespacedName{ + Namespace: in.Namespace, + Name: in.Name, + } +} + +// ConnectorCategory is the category of the connector. +// +// +enum +type ConnectorCategory string + +const ( + ConnectorCategoryDocker ConnectorCategory = "Docker" + ConnectorCategoryKubernetes ConnectorCategory = "Kubernetes" + ConnectorCategoryCustom ConnectorCategory = "Custom" + ConnectorCategoryCloudProvider ConnectorCategory = "CloudProvider" +) + // ConnectorSpec defines the desired state of Connector. type ConnectorSpec struct { // ApplicableEnvironmentType is the environment type that the connector is applicable to. // + // +k8s:validation:cel[0]:rule="oldSelf == self" + // +k8s:validation:cel[0]:message="immutable field" // +k8s:validation:enum=["Development","Staging","Production"] ApplicableEnvironmentType EnvironmentType `json:"applicableEnvironmentType,omitempty"` // Category is the category of the connector. // + // +k8s:validation:cel[0]:rule="oldSelf == self" + // +k8s:validation:cel[0]:message="immutable field" // +k8s:validation:enum=["Docker","Kubernetes","Custom","CloudProvider"] Category ConnectorCategory `json:"category"` // Type is the type of the connector. + // + // +k8s:validation:cel[0]:rule="oldSelf == self" + // +k8s:validation:cel[0]:message="immutable field" Type string `json:"type"` // Config is the configuration of the connector. + // + // Any sensitive configuration entry will be erased before storing. Config ConnectorConfig `json:"config"` - // Description is the description of the connector. - Description string `json:"description,omitempty"` - - // SecretName is the auto-generated secret name for the connector configuration. Will be overridden if set. + // SecretName is the name of the secret that stores the Config. + // + // If the secret name is not provided, a secret will be created to store the Config, + // otherwise, the Config will be stored in the secret with the provided name. + // + // +k8s:validation:cel[0]:rule="oldSelf == self" + // +k8s:validation:cel[0]:message="immutable field" SecretName string `json:"secretName,omitempty"` -} -type ConnectorConfig struct { - Version string `json:"version"` - Data map[string]ConnectorConfigEntry `json:"data"` + // Description is the description of the connector. + Description string `json:"description,omitempty"` } -type ConnectorConfigEntry struct { - Value string `json:"value"` - Visible bool `json:"visible"` -} +type ( + // ConnectorConfig defines the configuration of the Connector. + ConnectorConfig struct { + // Version is the version of the configuration. + Version string `json:"version"` + // Data holds the configuration entries. + // + // +mapType=atomic + Data map[string]ConnectorConfigEntry `json:"data"` + } + + // ConnectorConfigEntry defines the configuration entry of the Connector. + ConnectorConfigEntry struct { + // Sensitive indicates whether the entry is sensitive. + Sensitive bool `json:"sensitive"` + // Value is the value of the configuration entry. + // + // When Sensitive is true, + // it is provided as a write-only input field, + // and returns "(sensitive)". + Value string `json:"value"` + } +) // ConnectorStatus defines the observed state of Connector. type ConnectorStatus struct { @@ -75,24 +132,3 @@ type ConnectorList struct { } var _ runtime.Object = (*ConnectorList)(nil) - -// ConnectorCategory is the category of the connector. -// -// +enum -type ConnectorCategory string - -const ( - ConnectorCategoryDocker ConnectorCategory = "Docker" - ConnectorCategoryKubernetes ConnectorCategory = "Kubernetes" - ConnectorCategoryCustom ConnectorCategory = "Custom" - ConnectorCategoryCloudProvider ConnectorCategory = "CloudProvider" -) - -// ConnectorReference is a reference to a connector. -type ConnectorReference struct { - // Name is the name of the connector. - Name string `json:"name"` - - // Namespace is the namespace of the connector. - Namespace string `json:"namespace"` -} diff --git a/pkg/apis/walruscore/v1/connector_binding.go b/pkg/apis/walruscore/v1/connector_binding.go index 98d4a32b7..5ad84df1f 100644 --- a/pkg/apis/walruscore/v1/connector_binding.go +++ b/pkg/apis/walruscore/v1/connector_binding.go @@ -5,19 +5,16 @@ import ( "k8s.io/apimachinery/pkg/runtime" ) -const ProviderLabelPrefix = "walrus.seal.io/provider-" - // ConnectorBinding is the schema for the connectorbindings API. // // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:crd-gen:resource:scope="Namespaced",subResources=["status"] +// +k8s:crd-gen:resource:scope="Namespaced" type ConnectorBinding struct { meta.TypeMeta `json:",inline"` meta.ObjectMeta `json:"metadata,omitempty"` - Spec ConnectorBindingSpec `json:"spec"` - Status ConnectorBindingStatus `json:"status,omitempty"` + Spec ConnectorBindingSpec `json:"spec"` } var _ runtime.Object = (*ConnectorBinding)(nil) @@ -25,16 +22,7 @@ var _ runtime.Object = (*ConnectorBinding)(nil) // ConnectorBindingSpec defines the desired state of ConnectorBinding. type ConnectorBindingSpec struct { // Connector is the reference to the connector. - Connector ConnectorReference `json:"connector"` -} - -// ConnectorBindingStatus defines the observed state of ConnectorBinding. -type ConnectorBindingStatus struct { - // Type is the type of the connector. - Type string `json:"Type"` - - // Category is the category of the connector. - Category ConnectorCategory `json:"Category"` + Connector ConnectorReferenceWithType `json:"connector"` } // ConnectorBindingList contains a list of ConnectorBinding. @@ -48,3 +36,26 @@ type ConnectorBindingList struct { } var _ runtime.Object = (*ConnectorList)(nil) + +// ConnectorReferenceWithType is a reference to a connector with its category and type. +type ConnectorReferenceWithType struct { + ConnectorReference `json:",inline"` + + // Category is the category of the connector. + // + // If the Category is empty, + // the Category will be set to the category of the connector. + // + // +k8s:validation:cel[0]:rule="oldSelf == self" + // +k8s:validation:cel[0]:message="immutable field" + Category ConnectorCategory `json:"category,omitempty"` + + // Type is the type of the connector. + // + // If the Type is empty, + // the Type will be set to the type of the connector. + // + // +k8s:validation:cel[0]:rule="oldSelf == self" + // +k8s:validation:cel[0]:message="immutable field" + Type string `json:"type,omitempty"` +} diff --git a/pkg/apis/walruscore/v1/generated.pb.go b/pkg/apis/walruscore/v1/generated.pb.go index cc948d93c..bb7eeaddc 100644 --- a/pkg/apis/walruscore/v1/generated.pb.go +++ b/pkg/apis/walruscore/v1/generated.pb.go @@ -16,6 +16,7 @@ import ( proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" v11 "k8s.io/api/core/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" math "math" math_bits "math/bits" @@ -314,38 +315,10 @@ func (m *ConnectorBindingSpec) XXX_DiscardUnknown() { var xxx_messageInfo_ConnectorBindingSpec proto.InternalMessageInfo -func (m *ConnectorBindingStatus) Reset() { *m = ConnectorBindingStatus{} } -func (*ConnectorBindingStatus) ProtoMessage() {} -func (*ConnectorBindingStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_ae9ec96380e8d097, []int{10} -} -func (m *ConnectorBindingStatus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConnectorBindingStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ConnectorBindingStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConnectorBindingStatus.Merge(m, src) -} -func (m *ConnectorBindingStatus) XXX_Size() int { - return m.Size() -} -func (m *ConnectorBindingStatus) XXX_DiscardUnknown() { - xxx_messageInfo_ConnectorBindingStatus.DiscardUnknown(m) -} - -var xxx_messageInfo_ConnectorBindingStatus proto.InternalMessageInfo - func (m *ConnectorConfig) Reset() { *m = ConnectorConfig{} } func (*ConnectorConfig) ProtoMessage() {} func (*ConnectorConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_ae9ec96380e8d097, []int{11} + return fileDescriptor_ae9ec96380e8d097, []int{10} } func (m *ConnectorConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -373,7 +346,7 @@ var xxx_messageInfo_ConnectorConfig proto.InternalMessageInfo func (m *ConnectorConfigEntry) Reset() { *m = ConnectorConfigEntry{} } func (*ConnectorConfigEntry) ProtoMessage() {} func (*ConnectorConfigEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_ae9ec96380e8d097, []int{12} + return fileDescriptor_ae9ec96380e8d097, []int{11} } func (m *ConnectorConfigEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -401,7 +374,7 @@ var xxx_messageInfo_ConnectorConfigEntry proto.InternalMessageInfo func (m *ConnectorList) Reset() { *m = ConnectorList{} } func (*ConnectorList) ProtoMessage() {} func (*ConnectorList) Descriptor() ([]byte, []int) { - return fileDescriptor_ae9ec96380e8d097, []int{13} + return fileDescriptor_ae9ec96380e8d097, []int{12} } func (m *ConnectorList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -429,7 +402,7 @@ var xxx_messageInfo_ConnectorList proto.InternalMessageInfo func (m *ConnectorReference) Reset() { *m = ConnectorReference{} } func (*ConnectorReference) ProtoMessage() {} func (*ConnectorReference) Descriptor() ([]byte, []int) { - return fileDescriptor_ae9ec96380e8d097, []int{14} + return fileDescriptor_ae9ec96380e8d097, []int{13} } func (m *ConnectorReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -454,6 +427,34 @@ func (m *ConnectorReference) XXX_DiscardUnknown() { var xxx_messageInfo_ConnectorReference proto.InternalMessageInfo +func (m *ConnectorReferenceWithType) Reset() { *m = ConnectorReferenceWithType{} } +func (*ConnectorReferenceWithType) ProtoMessage() {} +func (*ConnectorReferenceWithType) Descriptor() ([]byte, []int) { + return fileDescriptor_ae9ec96380e8d097, []int{14} +} +func (m *ConnectorReferenceWithType) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConnectorReferenceWithType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ConnectorReferenceWithType) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConnectorReferenceWithType.Merge(m, src) +} +func (m *ConnectorReferenceWithType) XXX_Size() int { + return m.Size() +} +func (m *ConnectorReferenceWithType) XXX_DiscardUnknown() { + xxx_messageInfo_ConnectorReferenceWithType.DiscardUnknown(m) +} + +var xxx_messageInfo_ConnectorReferenceWithType proto.InternalMessageInfo + func (m *ConnectorSpec) Reset() { *m = ConnectorSpec{} } func (*ConnectorSpec) ProtoMessage() {} func (*ConnectorSpec) Descriptor() ([]byte, []int) { @@ -2052,38 +2053,10 @@ func (m *StatusDescriptor) XXX_DiscardUnknown() { var xxx_messageInfo_StatusDescriptor proto.InternalMessageInfo -func (m *TempalteVersionReference) Reset() { *m = TempalteVersionReference{} } -func (*TempalteVersionReference) ProtoMessage() {} -func (*TempalteVersionReference) Descriptor() ([]byte, []int) { - return fileDescriptor_ae9ec96380e8d097, []int{72} -} -func (m *TempalteVersionReference) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TempalteVersionReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *TempalteVersionReference) XXX_Merge(src proto.Message) { - xxx_messageInfo_TempalteVersionReference.Merge(m, src) -} -func (m *TempalteVersionReference) XXX_Size() int { - return m.Size() -} -func (m *TempalteVersionReference) XXX_DiscardUnknown() { - xxx_messageInfo_TempalteVersionReference.DiscardUnknown(m) -} - -var xxx_messageInfo_TempalteVersionReference proto.InternalMessageInfo - func (m *Template) Reset() { *m = Template{} } func (*Template) ProtoMessage() {} func (*Template) Descriptor() ([]byte, []int) { - return fileDescriptor_ae9ec96380e8d097, []int{73} + return fileDescriptor_ae9ec96380e8d097, []int{72} } func (m *Template) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2111,7 +2084,7 @@ var xxx_messageInfo_Template proto.InternalMessageInfo func (m *TemplateList) Reset() { *m = TemplateList{} } func (*TemplateList) ProtoMessage() {} func (*TemplateList) Descriptor() ([]byte, []int) { - return fileDescriptor_ae9ec96380e8d097, []int{74} + return fileDescriptor_ae9ec96380e8d097, []int{73} } func (m *TemplateList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2136,10 +2109,66 @@ func (m *TemplateList) XXX_DiscardUnknown() { var xxx_messageInfo_TemplateList proto.InternalMessageInfo +func (m *TemplateReference) Reset() { *m = TemplateReference{} } +func (*TemplateReference) ProtoMessage() {} +func (*TemplateReference) Descriptor() ([]byte, []int) { + return fileDescriptor_ae9ec96380e8d097, []int{74} +} +func (m *TemplateReference) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TemplateReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *TemplateReference) XXX_Merge(src proto.Message) { + xxx_messageInfo_TemplateReference.Merge(m, src) +} +func (m *TemplateReference) XXX_Size() int { + return m.Size() +} +func (m *TemplateReference) XXX_DiscardUnknown() { + xxx_messageInfo_TemplateReference.DiscardUnknown(m) +} + +var xxx_messageInfo_TemplateReference proto.InternalMessageInfo + +func (m *TemplateReferenceWithVersion) Reset() { *m = TemplateReferenceWithVersion{} } +func (*TemplateReferenceWithVersion) ProtoMessage() {} +func (*TemplateReferenceWithVersion) Descriptor() ([]byte, []int) { + return fileDescriptor_ae9ec96380e8d097, []int{75} +} +func (m *TemplateReferenceWithVersion) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TemplateReferenceWithVersion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *TemplateReferenceWithVersion) XXX_Merge(src proto.Message) { + xxx_messageInfo_TemplateReferenceWithVersion.Merge(m, src) +} +func (m *TemplateReferenceWithVersion) XXX_Size() int { + return m.Size() +} +func (m *TemplateReferenceWithVersion) XXX_DiscardUnknown() { + xxx_messageInfo_TemplateReferenceWithVersion.DiscardUnknown(m) +} + +var xxx_messageInfo_TemplateReferenceWithVersion proto.InternalMessageInfo + func (m *TemplateSpec) Reset() { *m = TemplateSpec{} } func (*TemplateSpec) ProtoMessage() {} func (*TemplateSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_ae9ec96380e8d097, []int{75} + return fileDescriptor_ae9ec96380e8d097, []int{76} } func (m *TemplateSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2167,7 +2196,7 @@ var xxx_messageInfo_TemplateSpec proto.InternalMessageInfo func (m *TemplateStatus) Reset() { *m = TemplateStatus{} } func (*TemplateStatus) ProtoMessage() {} func (*TemplateStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_ae9ec96380e8d097, []int{76} + return fileDescriptor_ae9ec96380e8d097, []int{77} } func (m *TemplateStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2195,7 +2224,7 @@ var xxx_messageInfo_TemplateStatus proto.InternalMessageInfo func (m *TemplateVersion) Reset() { *m = TemplateVersion{} } func (*TemplateVersion) ProtoMessage() {} func (*TemplateVersion) Descriptor() ([]byte, []int) { - return fileDescriptor_ae9ec96380e8d097, []int{77} + return fileDescriptor_ae9ec96380e8d097, []int{78} } func (m *TemplateVersion) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2223,7 +2252,7 @@ var xxx_messageInfo_TemplateVersion proto.InternalMessageInfo func (m *VCSRepository) Reset() { *m = VCSRepository{} } func (*VCSRepository) ProtoMessage() {} func (*VCSRepository) Descriptor() ([]byte, []int) { - return fileDescriptor_ae9ec96380e8d097, []int{78} + return fileDescriptor_ae9ec96380e8d097, []int{79} } func (m *VCSRepository) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2251,7 +2280,7 @@ var xxx_messageInfo_VCSRepository proto.InternalMessageInfo func (m *VCSSource) Reset() { *m = VCSSource{} } func (*VCSSource) ProtoMessage() {} func (*VCSSource) Descriptor() ([]byte, []int) { - return fileDescriptor_ae9ec96380e8d097, []int{79} + return fileDescriptor_ae9ec96380e8d097, []int{80} } func (m *VCSSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2287,12 +2316,12 @@ func init() { proto.RegisterType((*ConnectorBinding)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.ConnectorBinding") proto.RegisterType((*ConnectorBindingList)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.ConnectorBindingList") proto.RegisterType((*ConnectorBindingSpec)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.ConnectorBindingSpec") - proto.RegisterType((*ConnectorBindingStatus)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.ConnectorBindingStatus") proto.RegisterType((*ConnectorConfig)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.ConnectorConfig") proto.RegisterMapType((map[string]ConnectorConfigEntry)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.ConnectorConfig.DataEntry") proto.RegisterType((*ConnectorConfigEntry)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.ConnectorConfigEntry") proto.RegisterType((*ConnectorList)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.ConnectorList") proto.RegisterType((*ConnectorReference)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.ConnectorReference") + proto.RegisterType((*ConnectorReferenceWithType)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.ConnectorReferenceWithType") proto.RegisterType((*ConnectorSpec)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.ConnectorSpec") proto.RegisterType((*ConnectorStatus)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.ConnectorStatus") proto.RegisterType((*Filters)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.Filters") @@ -2350,9 +2379,10 @@ func init() { proto.RegisterType((*SchemaList)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.SchemaList") proto.RegisterType((*SchemaStatus)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.SchemaStatus") proto.RegisterType((*StatusDescriptor)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.StatusDescriptor") - proto.RegisterType((*TempalteVersionReference)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.TempalteVersionReference") proto.RegisterType((*Template)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.Template") proto.RegisterType((*TemplateList)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.TemplateList") + proto.RegisterType((*TemplateReference)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.TemplateReference") + proto.RegisterType((*TemplateReferenceWithVersion)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.TemplateReferenceWithVersion") proto.RegisterType((*TemplateSpec)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.TemplateSpec") proto.RegisterType((*TemplateStatus)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.TemplateStatus") proto.RegisterType((*TemplateVersion)(nil), "github.com.seal_io.walrus.pkg.apis.walruscore.v1.TemplateVersion") @@ -2365,241 +2395,241 @@ func init() { } var fileDescriptor_ae9ec96380e8d097 = []byte{ - // 3737 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x3c, 0x5d, 0x6c, 0x1c, 0x57, - 0xd5, 0x99, 0xd9, 0xb5, 0xbd, 0x7b, 0x6c, 0x27, 0xce, 0x4d, 0x9a, 0x6e, 0xd2, 0x2f, 0xde, 0x74, - 0xd2, 0xbf, 0xef, 0xfb, 0xd4, 0x75, 0xd3, 0x9f, 0xef, 0x4b, 0x1b, 0xb5, 0xd4, 0xbb, 0x76, 0x52, - 0xb7, 0x49, 0x63, 0xae, 0x1d, 0x4b, 0xd0, 0xd2, 0x66, 0x3c, 0x7b, 0xbd, 0x9e, 0x78, 0x77, 0x66, - 0x32, 0x33, 0xeb, 0xd8, 0xa2, 0x14, 0x24, 0x1e, 0x0a, 0xaa, 0x8a, 0xfa, 0x52, 0xa9, 0xa8, 0x12, - 0x4f, 0x20, 0x81, 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 0x1b, 0x41, 0x0f, 0x41, 0xae, 0xa2, 0xba, 0xa4, 0x66, 0xda, 0x9b, 0x3c, 0xd4, - 0x1c, 0xa5, 0xd0, 0x1b, 0x5b, 0xc5, 0x83, 0x01, 0x2f, 0x1f, 0x01, 0x07, 0xa8, 0xca, 0x9b, 0x32, - 0x1c, 0x08, 0xe1, 0xa6, 0xb1, 0xa2, 0xd7, 0x68, 0x74, 0x5c, 0x27, 0xb6, 0x43, 0x53, 0x18, 0x49, - 0x8c, 0x8e, 0x4b, 0xde, 0x30, 0xf6, 0xe1, 0xa8, 0x01, 0x59, 0xf6, 0xf0, 0xbd, 0x27, 0xf4, 0x54, - 0x0f, 0xba, 0xf1, 0x64, 0x97, 0x66, 0x54, 0x57, 0x9d, 0x35, 0x5c, 0x7b, 0x33, 0x34, 0x7d, 0x3a, - 0x84, 0x99, 0x98, 0x63, 0x5f, 0x85, 0x7c, 0x80, 0x80, 0x26, 0x20, 0xb3, 0x46, 0x36, 0xbd, 0x29, - 0x62, 0xfa, 0x2f, 0x7a, 0x16, 0x86, 0xd6, 0xd5, 0x7a, 0x93, 0xf4, 0xc1, 0x09, 0xbd, 0xe9, 0x30, - 0x41, 0xd8, 0x63, 0xfa, 0x88, 0x7c, 0x5a, 0x52, 0x56, 0x22, 0x86, 0x12, 0x41, 0xa1, 0x3b, 0x82, - 0x27, 0x39, 0xb6, 0x23, 0x2c, 0xd1, 0x41, 0xce, 0x80, 0xe9, 0x55, 0x77, 0xf4, 0xe5, 0xba, 0x37, - 0xc1, 0x48, 0x26, 0xba, 0xe4, 0x0d, 0x63, 0x1f, 0xae, 0xfc, 0x56, 0x82, 0xf1, 0x40, 0xd0, 0x00, - 0x5c, 0xed, 0xb2, 0xe8, 0x6a, 0x67, 0x7a, 0x71, 0xb5, 0xd6, 0x3e, 0x56, 0x03, 0x94, 0xf4, 0x03, - 0x74, 0x02, 0xb2, 0x86, 0xda, 0xf0, 0xd5, 0x16, 0x3c, 0xf2, 0xa7, 0xd5, 0x06, 0xc1, 0x0c, 0x82, - 0xa6, 0x20, 0x4f, 0xff, 0x3a, 0x96, 0xaa, 0xf9, 0x7b, 0x68, 0xe0, 0x3c, 0x4f, 0xfb, 0x00, 0x1c, - 0xe2, 0x28, 0x3f, 0xcb, 0x44, 0x54, 0xc7, 0xbc, 0xd8, 0x86, 0xa3, 0xaa, 0x65, 0xd5, 0x75, 0x4d, - 0x5d, 0xae, 0x93, 0x59, 0x63, 0x5d, 0xb7, 0x4d, 0xa3, 0x41, 0x0c, 0x37, 0xe2, 0x49, 0x0f, 0x72, - 0x96, 0x47, 0xa7, 0xd3, 0x10, 0x69, 0xba, 0x13, 0x1b, 0xc2, 0xe9, 0x6c, 0xd1, 0x34, 0xe4, 0x34, - 0xd1, 0x1d, 0xef, 0xf4, 0xd5, 0xef, 0xfb, 0x5e, 0x8a, 0x6b, 0xfa, 0x64, 0x54, 0x37, 0x2c, 0x65, - 0xcb, 0x88, 0xba, 0x89, 0x64, 0x68, 0x3a, 0x0c, 0x6b, 0xcc, 0x08, 0x79, 0xdd, 0x30, 0xdd, 0xb3, - 0xc1, 0x87, 0x5b, 0x80, 0xf7, 0x1b, 0x73, 0x01, 0xf1, 0xd2, 0x66, 0x68, 0x87, 0xa5, 0xcd, 0xfd, - 0x00, 0x0e, 0xd1, 0x6c, 0xe2, 0xd2, 0x47, 0x55, 0x18, 0x66, 0x54, 0xc1, 0x3e, 0xba, 0x10, 0x40, - 0x70, 0x04, 0x4b, 0xf9, 0x95, 0x14, 0x09, 0x49, 0x9f, 0xbd, 0x22, 0x22, 0x92, 0x82, 0xcb, 0x1d, - 0x52, 0xf0, 0x37, 0x24, 0xf0, 0x6b, 0x31, 0x74, 0x0e, 0x0e, 0xea, 0x86, 0x56, 0x6f, 0x56, 0xc9, - 0xec, 0x86, 0x65, 0x13, 0x27, 0x12, 0x5e, 0x8f, 0x72, 0x06, 0x07, 0xe7, 0xe2, 0x08, 0x38, 0x49, - 0x43, 0x19, 0x91, 0x8d, 0x38, 0x23, 0x59, 0x64, 0x34, 0xbb, 0x91, 0x60, 0x94, 0xa0, 0x51, 0x7e, - 0x22, 0x43, 0x0e, 0x13, 0x87, 0xd5, 0x6d, 0x03, 0x48, 0x90, 0x2e, 0x0b, 0x09, 0xd2, 0x63, 0xbb, - 0x7f, 0x6a, 0xfe, 0x5c, 0x53, 0x13, 0xa3, 0xd5, 0x58, 0x62, 0xf4, 0x78, 0x0f, 0x32, 0xda, 0x27, - 0x44, 0x7f, 0x96, 0xe1, 0xa0, 0x8f, 0x5a, 0x31, 0x1b, 0x96, 0x69, 0x10, 0xc3, 0xdd, 0x41, 0x30, - 0xf3, 0x5d, 0x5a, 0x4e, 0x75, 0xe9, 0x87, 0x21, 0xdb, 0x30, 0xab, 0xbe, 0xd3, 0xfb, 0x31, 0x23, - 0x7b, 0xc1, 0xac, 0xd2, 0x08, 0x74, 0x4b, 0x42, 0x28, 0x05, 0x60, 0x46, 0x82, 0x1e, 0x85, 0x21, - 0x67, 0x55, 0xb5, 0x08, 0xaf, 0x7d, 0xee, 0xf6, 0xc3, 0xf0, 0x02, 0x1d, 0xbc, 0xb1, 0x55, 0x3c, - 0x92, 0x20, 0x66, 0x10, 0xec, 0x51, 0x51, 0xbb, 0x56, 0xab, 0x55, 0x6a, 0x1c, 0xf1, 0x9a, 0x68, - 0xda, 0x1b, 0xc6, 0x3e, 0x1c, 0x5d, 0x8d, 0xa6, 0x45, 0xc3, 0x7d, 0x4c, 0x8b, 0xc6, 0x53, 0x53, - 0xa2, 0x1f, 0x4a, 0x70, 0x34, 0x31, 0xff, 0x69, 0xcb, 0x22, 0x46, 0x55, 0xdf, 0x40, 0xaf, 0x48, - 0x30, 0x6e, 0x5a, 0xc4, 0x56, 0x69, 0xd0, 0x79, 0x8a, 0x6c, 0x3a, 0xdc, 0x86, 0xe7, 0xbb, 0xb7, - 0x80, 0x40, 0xc8, 0xc5, 0x28, 0xdf, 0xb0, 0x8a, 0x17, 0x86, 0xb1, 0x28, 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0x90, 0x5d, 0xa3, 0x46, 0xe8, 0x25, 0x53, 0x17, 0xfb, 0x6c, 0x84, 0xa1, 0xe2, - 0x98, 0xe9, 0x31, 0x51, 0xca, 0xef, 0x65, 0x40, 0x09, 0x2a, 0x67, 0x00, 0x61, 0xfd, 0x8a, 0x10, - 0xd6, 0x9f, 0xe8, 0xc3, 0x5a, 0x9d, 0xd4, 0x00, 0x6f, 0xc7, 0x02, 0xfc, 0x93, 0x7d, 0x91, 0xd6, - 0x3e, 0xd4, 0x5f, 0x97, 0x20, 0x19, 0x38, 0x9d, 0x01, 0xa4, 0xe4, 0xba, 0x98, 0x92, 0xcf, 0xf4, - 0x63, 0xad, 0x29, 0xb9, 0x79, 0xa1, 0xd5, 0x12, 0xa9, 0xde, 0x95, 0xef, 0x0c, 0x43, 0x21, 0x4d, - 0x65, 0x37, 0x67, 0x52, 0x86, 0xee, 0x83, 0x9c, 0xcd, 0x57, 0xc4, 0x77, 0xd9, 0xa0, 0x27, 0xe7, - 0xaf, 0x94, 0x05, 0xa4, 0x00, 0x0b, 0xbd, 0x21, 0x41, 0xc1, 0xef, 0xd2, 0xfa, 0x15, 0xb0, 0xbf, - 0x65, 0xf1, 0xcc, 0xbb, 0x0b, 0x4b, 0x5c, 0x24, 0x0d, 0x4b, 0xad, 0x27, 0x39, 0x96, 0x0f, 0x6d, - 0x6f, 0x15, 0x0f, 0x2c, 0xc6, 0xe4, 0xa5, 0x4e, 0x00, 0x6d, 0x02, 0xd2, 0xcc, 0x86, 0xd5, 0x74, - 0x49, 0x75, 0xda, 0x75, 0x6d, 0x7d, 0xb9, 0xe9, 0x12, 0x87, 0x37, 0xf9, 0xef, 0x4d, 0xb5, 0x47, - 0x7e, 0x94, 0x56, 0xc2, 0xea, 0xb5, 0xd9, 0x0d, 0x97, 0x18, 0x94, 0x67, 0xd8, 0x6e, 0xad, 0x24, - 0x18, 0xe2, 0x16, 0x42, 0xd0, 0x35, 0x00, 0x2d, 0x30, 0x8a, 0xc2, 0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x50, 0x6c, 0x3e, 0x77, - 0x76, 0x64, 0x10, 0x99, 0xd1, 0x09, 0xc8, 0x52, 0xc9, 0xf1, 0x18, 0x46, 0x71, 0x31, 0x83, 0xa0, - 0xf3, 0x90, 0x75, 0xbb, 0x7b, 0x9f, 0x20, 0xbc, 0x71, 0x43, 0x7d, 0x94, 0x71, 0xa1, 0x89, 0xaf, - 0x66, 0x36, 0x1a, 0xc4, 0x70, 0x79, 0x02, 0x10, 0x3c, 0x99, 0x8a, 0x37, 0x8c, 0x7d, 0xb8, 0xf2, - 0x27, 0x19, 0xd2, 0xaa, 0xf0, 0x01, 0x54, 0x57, 0xa6, 0x50, 0x5d, 0x5d, 0xe8, 0x5b, 0xf4, 0x4d, - 0xad, 0xb4, 0xae, 0xc5, 0x2a, 0xad, 0x8b, 0xfd, 0x13, 0xd9, 0xbe, 0xea, 0xfa, 0x44, 0x0a, 0x7b, - 0xba, 0x31, 0xca, 0x01, 0x54, 0x60, 0x86, 0x58, 0x81, 0xcd, 0xf5, 0x6d, 0xd5, 0x29, 0xd5, 0x58, - 0x13, 0x4e, 0x74, 0xda, 0x17, 0xf7, 0xa2, 0x09, 0xf8, 0x71, 0xba, 0x92, 0x59, 0x41, 0x28, 0x6c, - 0x36, 0x52, 0x6f, 0x9b, 0xcd, 0x97, 0x21, 0xe7, 0x07, 0x7c, 0x6e, 0xbe, 0x9f, 0xef, 0x5b, 0x4c, - 0x0d, 0xb4, 0xcb, 0x72, 0x87, 0x60, 0xd7, 0x08, 0x04, 0x2a, 0xc5, 0xc4, 0xd6, 0x22, 0x9a, 0xa1, - 0xf2, 0x07, 0x19, 0x5a, 0x65, 0x9a, 0x03, 0x70, 0xe9, 0x35, 0xc1, 0xa5, 0xe7, 0xfa, 0x92, 0x42, - 0xa7, 0xba, 0xb3, 0x13, 0x73, 0xe7, 0xa7, 0xfa, 0x23, 0xae, 0xbd, 0x2b, 0x7f, 0x24, 0x09, 0x21, - 0x73, 0x80, 0x6e, 0x7c, 0x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xdb, 0x61, 0x89, 0x6b, 0x21, 0xe6, 0x9b, 0x7d, + 0xdb, 0xc1, 0x0c, 0xa2, 0xfd, 0xd6, 0x08, 0x1c, 0x97, 0xef, 0x8e, 0xdf, 0xa7, 0xb7, 0xe3, 0xda, + 0x97, 0x04, 0x73, 0x83, 0x28, 0x09, 0x3e, 0x9b, 0xb8, 0xf3, 0x95, 0x67, 0x19, 0xcd, 0x44, 0xe7, + 0x0b, 0x5a, 0xe8, 0x5d, 0x18, 0x73, 0x63, 0xa7, 0x25, 0xbc, 0xb8, 0x70, 0xa5, 0xb7, 0x33, 0x17, + 0x61, 0xad, 0x13, 0xf1, 0xaa, 0x37, 0x03, 0x49, 0xec, 0xd0, 0x87, 0x0a, 0x20, 0x37, 0x75, 0x25, + 0x80, 0x17, 0x21, 0xae, 0xf6, 0xe3, 0xba, 0x87, 0x18, 0xcb, 0x69, 0x2a, 0xcc, 0x36, 0x08, 0x6d, + 0x06, 0x80, 0xfe, 0x41, 0x81, 0x19, 0xb7, 0xe3, 0xf5, 0x0a, 0x5e, 0xf7, 0xfb, 0x95, 0x7e, 0x5f, + 0x49, 0x11, 0xe3, 0xd5, 0xf6, 0x76, 0x4b, 0xfb, 0xdc, 0x7f, 0xc2, 0xfb, 0x0c, 0x12, 0xfd, 0x1c, + 0x14, 0x89, 0x55, 0x73, 0x6c, 0xd3, 0xf2, 0x83, 0xe2, 0x60, 0x31, 0x70, 0x6c, 0x0b, 0x61, 0x23, + 0x16, 0x70, 0xed, 0x0b, 0x05, 0x86, 0x57, 0xd8, 0xeb, 0x23, 0x03, 0x88, 0xfd, 0xd6, 0xa5, 0xcf, + 0xec, 0xbb, 0xba, 0x36, 0x10, 0x8c, 0x75, 0x9f, 0x08, 0xec, 0x9f, 0x14, 0x80, 0x00, 0x71, 0x00, + 0x41, 0xd7, 0xaf, 0xc9, 0x41, 0xd7, 0xc5, 0x6e, 0xe7, 0x94, 0x11, 0x67, 0x7d, 0xaf, 0xc0, 0x58, + 0x7c, 0xd2, 0x08, 0x87, 0xf7, 0xfd, 0xbb, 0xda, 0x74, 0xda, 0x7f, 0x1e, 0x70, 0x08, 0x6f, 0x67, + 0x03, 0x18, 0xe1, 0x23, 0x01, 0x61, 0xb5, 0xa8, 0xbb, 0x4f, 0x42, 0x03, 0x1a, 0xf1, 0x8b, 0xad, + 0x21, 0x59, 0x1c, 0x63, 0xa1, 0xfd, 0xa1, 0x0a, 0x29, 0x87, 0xcd, 0x76, 0x0a, 0x23, 0xf1, 0x56, + 0x41, 0xf7, 0x3b, 0x45, 0xf2, 0xd5, 0x03, 0xe9, 0x40, 0x44, 0x82, 0xe0, 0x14, 0xd7, 0x84, 0x40, + 0xd4, 0xa3, 0x17, 0xc8, 0xc7, 0x2a, 0x14, 0x06, 0x98, 0xb0, 0xf5, 0xfc, 0x11, 0xda, 0xbe, 0x59, + 0x5a, 0x1f, 0x3e, 0x42, 0x3b, 0x60, 0x6a, 0xf6, 0x99, 0x02, 0x63, 0x03, 0xcc, 0xc7, 0x7a, 0xbf, + 0xb2, 0xb1, 0x4f, 0x12, 0xb6, 0x0e, 0x93, 0x03, 0xc9, 0xbc, 0xbe, 0x52, 0xe0, 0xe1, 0x4e, 0x91, + 0x24, 0xfa, 0x7d, 0x05, 0x26, 0xfd, 0x24, 0x02, 0x97, 0x68, 0xb5, 0x0f, 0x51, 0xab, 0x38, 0x35, + 0x48, 0x81, 0x70, 0x9a, 0x71, 0xfc, 0xad, 0x02, 0xb5, 0xf3, 0x5b, 0x05, 0xda, 0xff, 0xc7, 0x54, + 0x82, 0x45, 0xf6, 0xe9, 0x63, 0x56, 0xe5, 0x50, 0xc7, 0xac, 0x5d, 0x66, 0x55, 0xdb, 0x30, 0xbe, + 0x65, 0x78, 0x98, 0x38, 0xb6, 0x67, 0xfa, 0xb6, 0xbb, 0xd3, 0xfd, 0x1b, 0x59, 0x37, 0xaa, 0x2b, + 0x82, 0x4c, 0x65, 0x72, 0x6f, 0xb7, 0x34, 0x2e, 0x35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 0x47, + 0x1d, 0xf6, 0x91, 0xb1, 0x56, 0x07, 0xf1, 0x6c, 0xd9, 0x51, 0x32, 0xaa, 0xdc, 0xf8, 0xf4, 0xee, + 0xcc, 0xb1, 0xcf, 0xef, 0xce, 0x1c, 0xfb, 0xea, 0xee, 0xcc, 0xb1, 0xdf, 0xdc, 0x9b, 0x51, 0x3e, + 0xdd, 0x9b, 0x51, 0x3e, 0xdf, 0x9b, 0x51, 0xbe, 0xda, 0x9b, 0x51, 0xbe, 0xde, 0x9b, 0x51, 0x3e, + 0xf8, 0x66, 0xe6, 0xd8, 0xaf, 0xc6, 0x5e, 0x75, 0x9c, 0xa5, 0xe6, 0xf2, 0xa4, 0x69, 0xf3, 0x77, + 0x20, 0x67, 0xdb, 0xbf, 0x0b, 0xf9, 0xd3, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa0, 0x1e, 0x9c, 0x4b, + 0x30, 0x52, 0x00, 0x00, } func (m *Catalog) Marshal() (dAtA []byte, err error) { @@ -2746,16 +2776,11 @@ func (m *CatalogSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 } - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x1a i -= len(m.TemplateFormat) copy(dAtA[i:], m.TemplateFormat) i = encodeVarintGenerated(dAtA, i, uint64(len(m.TemplateFormat))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a i-- if m.Builtin { dAtA[i] = 1 @@ -2763,7 +2788,12 @@ func (m *CatalogSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x8 + dAtA[i] = 0x10 + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -2787,27 +2817,29 @@ func (m *CatalogStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - i -= len(m.Project) - copy(dAtA[i:], m.Project) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Project))) + if m.LastSuccessfulSyncTime != nil { + { + size, err := m.LastSuccessfulSyncTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + i = encodeVarintGenerated(dAtA, i, uint64(m.TemplateCount)) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x20 i -= len(m.URL) copy(dAtA[i:], m.URL) i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) i-- - dAtA[i] = 0x22 - i = encodeVarintGenerated(dAtA, i, uint64(m.TemplateCount)) - i-- - dAtA[i] = 0x18 - { - size, err := m.LastSyncTime.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } + dAtA[i] = 0x1a + i -= len(m.Project) + copy(dAtA[i:], m.Project) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Project))) i-- dAtA[i] = 0x12 { @@ -2982,16 +3014,6 @@ func (m *ConnectorBinding) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a { size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -3095,39 +3117,6 @@ func (m *ConnectorBindingSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ConnectorBindingStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ConnectorBindingStatus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConnectorBindingStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i -= len(m.Category) - copy(dAtA[i:], m.Category) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Category))) - i-- - dAtA[i] = 0x12 - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func (m *ConnectorConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3205,19 +3194,19 @@ func (m *ConnectorConfigEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 i-- - if m.Visible { + if m.Sensitive { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- - dAtA[i] = 0x10 - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 return len(dAtA) - i, nil } @@ -3301,6 +3290,49 @@ func (m *ConnectorReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ConnectorReferenceWithType) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConnectorReferenceWithType) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConnectorReferenceWithType) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x1a + i -= len(m.Category) + copy(dAtA[i:], m.Category) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Category))) + i-- + dAtA[i] = 0x12 + { + size, err := m.ConnectorReference.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *ConnectorSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3321,15 +3353,15 @@ func (m *ConnectorSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - i -= len(m.SecretName) - copy(dAtA[i:], m.SecretName) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.SecretName))) - i-- - dAtA[i] = 0x32 i -= len(m.Description) copy(dAtA[i:], m.Description) i = encodeVarintGenerated(dAtA, i, uint64(len(m.Description))) i-- + dAtA[i] = 0x32 + i -= len(m.SecretName) + copy(dAtA[i:], m.SecretName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.SecretName))) + i-- dAtA[i] = 0x2a { size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) @@ -3927,18 +3959,16 @@ func (m *ResourceComponentsStatus) MarshalToSizedBuffer(dAtA []byte) (int, error } i-- dAtA[i] = 0x2a - if m.TemplateVersion != nil { - { - size, err := m.TemplateVersion.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + { + size, err := m.Template.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x22 + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x22 i -= len(m.ResourceName) copy(dAtA[i:], m.ResourceName) i = encodeVarintGenerated(dAtA, i, uint64(len(m.ResourceName))) @@ -4789,18 +4819,16 @@ func (m *ResourceRunSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.TemplateVersion != nil { - { - size, err := m.TemplateVersion.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + { + size, err := m.Template.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x2a + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x2a { size, err := m.Attributes.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -5658,14 +5686,16 @@ func (m *ResourceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x20 - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0x1a - if m.TemplateVersion != nil { + if m.Type != nil { + i -= len(*m.Type) + copy(dAtA[i:], *m.Type) + i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Type))) + i-- + dAtA[i] = 0x1a + } + if m.Template != nil { { - size, err := m.TemplateVersion.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Template.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -5979,44 +6009,6 @@ func (m *StatusDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *TempalteVersionReference) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TempalteVersionReference) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TempalteVersionReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x1a - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - i -= len(m.Namespace) - copy(dAtA[i:], m.Namespace) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func (m *Template) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -6117,6 +6109,77 @@ func (m *TemplateList) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *TemplateReference) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TemplateReference) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TemplateReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *TemplateReferenceWithVersion) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TemplateReferenceWithVersion) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TemplateReferenceWithVersion) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x12 + { + size, err := m.TemplateReference.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *TemplateSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -6182,6 +6245,18 @@ func (m *TemplateStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.LastSuccessfulSyncTime != nil { + { + size, err := m.LastSuccessfulSyncTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } if len(m.Versions) > 0 { for iNdEx := len(m.Versions) - 1; iNdEx >= 0; iNdEx-- { { @@ -6193,37 +6268,22 @@ func (m *TemplateStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x3a + dAtA[i] = 0x2a } } i -= len(m.Icon) copy(dAtA[i:], m.Icon) i = encodeVarintGenerated(dAtA, i, uint64(len(m.Icon))) i-- - dAtA[i] = 0x32 - i -= len(m.Project) - copy(dAtA[i:], m.Project) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Project))) - i-- - dAtA[i] = 0x2a + dAtA[i] = 0x22 i -= len(m.URL) copy(dAtA[i:], m.URL) i = encodeVarintGenerated(dAtA, i, uint64(len(m.URL))) i-- - dAtA[i] = 0x22 - i -= len(m.OriginalName) - copy(dAtA[i:], m.OriginalName) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.OriginalName))) - i-- dAtA[i] = 0x1a - { - size, err := m.LastSyncTime.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } + i -= len(m.Project) + copy(dAtA[i:], m.Project) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Project))) i-- dAtA[i] = 0x12 { @@ -6416,11 +6476,11 @@ func (m *CatalogSpec) Size() (n int) { } var l int _ = l + l = len(m.Description) + n += 1 + l + sovGenerated(uint64(l)) n += 2 l = len(m.TemplateFormat) n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Description) - n += 1 + l + sovGenerated(uint64(l)) if m.Filters != nil { l = m.Filters.Size() n += 1 + l + sovGenerated(uint64(l)) @@ -6440,13 +6500,15 @@ func (m *CatalogStatus) Size() (n int) { _ = l l = m.StatusDescriptor.Size() n += 1 + l + sovGenerated(uint64(l)) - l = m.LastSyncTime.Size() + l = len(m.Project) n += 1 + l + sovGenerated(uint64(l)) - n += 1 + sovGenerated(uint64(m.TemplateCount)) l = len(m.URL) n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Project) - n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.TemplateCount)) + if m.LastSuccessfulSyncTime != nil { + l = m.LastSuccessfulSyncTime.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -6507,8 +6569,6 @@ func (m *ConnectorBinding) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = m.Spec.Size() n += 1 + l + sovGenerated(uint64(l)) - l = m.Status.Size() - n += 1 + l + sovGenerated(uint64(l)) return n } @@ -6540,19 +6600,6 @@ func (m *ConnectorBindingSpec) Size() (n int) { return n } -func (m *ConnectorBindingStatus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Type) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Category) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - func (m *ConnectorConfig) Size() (n int) { if m == nil { return 0 @@ -6579,9 +6626,9 @@ func (m *ConnectorConfigEntry) Size() (n int) { } var l int _ = l + n += 2 l = len(m.Value) n += 1 + l + sovGenerated(uint64(l)) - n += 2 return n } @@ -6615,6 +6662,21 @@ func (m *ConnectorReference) Size() (n int) { return n } +func (m *ConnectorReferenceWithType) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ConnectorReference.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Category) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Type) + n += 1 + l + sovGenerated(uint64(l)) + return n +} + func (m *ConnectorSpec) Size() (n int) { if m == nil { return 0 @@ -6629,10 +6691,10 @@ func (m *ConnectorSpec) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = m.Config.Size() n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Description) - n += 1 + l + sovGenerated(uint64(l)) l = len(m.SecretName) n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Description) + n += 1 + l + sovGenerated(uint64(l)) return n } @@ -6835,10 +6897,8 @@ func (m *ResourceComponentsStatus) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = len(m.ResourceName) n += 1 + l + sovGenerated(uint64(l)) - if m.TemplateVersion != nil { - l = m.TemplateVersion.Size() - n += 1 + l + sovGenerated(uint64(l)) - } + l = m.Template.Size() + n += 1 + l + sovGenerated(uint64(l)) l = m.ComputedAttributes.Size() n += 1 + l + sovGenerated(uint64(l)) if len(m.Components) > 0 { @@ -7152,10 +7212,8 @@ func (m *ResourceRunSpec) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = m.Attributes.Size() n += 1 + l + sovGenerated(uint64(l)) - if m.TemplateVersion != nil { - l = m.TemplateVersion.Size() - n += 1 + l + sovGenerated(uint64(l)) - } + l = m.Template.Size() + n += 1 + l + sovGenerated(uint64(l)) return n } @@ -7448,12 +7506,14 @@ func (m *ResourceSpec) Size() (n int) { _ = l l = m.Attributes.Size() n += 1 + l + sovGenerated(uint64(l)) - if m.TemplateVersion != nil { - l = m.TemplateVersion.Size() + if m.Template != nil { + l = m.Template.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + if m.Type != nil { + l = len(*m.Type) n += 1 + l + sovGenerated(uint64(l)) } - l = len(m.Type) - n += 1 + l + sovGenerated(uint64(l)) n += 2 n += 2 return n @@ -7564,21 +7624,6 @@ func (m *StatusDescriptor) Size() (n int) { return n } -func (m *TempalteVersionReference) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Namespace) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Name) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Version) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - func (m *Template) Size() (n int) { if m == nil { return 0 @@ -7611,39 +7656,61 @@ func (m *TemplateList) Size() (n int) { return n } -func (m *TemplateSpec) Size() (n int) { +func (m *TemplateReference) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.TemplateFormat) + l = len(m.Namespace) n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Description) + l = len(m.Name) n += 1 + l + sovGenerated(uint64(l)) - if m.VCSRepository != nil { - l = m.VCSRepository.Size() - n += 1 + l + sovGenerated(uint64(l)) - } return n } -func (m *TemplateStatus) Size() (n int) { +func (m *TemplateReferenceWithVersion) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.StatusDescriptor.Size() + l = m.TemplateReference.Size() n += 1 + l + sovGenerated(uint64(l)) - l = m.LastSyncTime.Size() + l = len(m.Version) n += 1 + l + sovGenerated(uint64(l)) - l = len(m.OriginalName) + return n +} + +func (m *TemplateSpec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.TemplateFormat) n += 1 + l + sovGenerated(uint64(l)) - l = len(m.URL) + l = len(m.Description) + n += 1 + l + sovGenerated(uint64(l)) + if m.VCSRepository != nil { + l = m.VCSRepository.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + return n +} + +func (m *TemplateStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.StatusDescriptor.Size() n += 1 + l + sovGenerated(uint64(l)) l = len(m.Project) n += 1 + l + sovGenerated(uint64(l)) + l = len(m.URL) + n += 1 + l + sovGenerated(uint64(l)) l = len(m.Icon) n += 1 + l + sovGenerated(uint64(l)) if len(m.Versions) > 0 { @@ -7652,6 +7719,10 @@ func (m *TemplateStatus) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) } } + if m.LastSuccessfulSyncTime != nil { + l = m.LastSuccessfulSyncTime.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -7746,9 +7817,9 @@ func (this *CatalogSpec) String() string { return "nil" } s := strings.Join([]string{`&CatalogSpec{`, + `Description:` + fmt.Sprintf("%v", this.Description) + `,`, `Builtin:` + fmt.Sprintf("%v", this.Builtin) + `,`, `TemplateFormat:` + fmt.Sprintf("%v", this.TemplateFormat) + `,`, - `Description:` + fmt.Sprintf("%v", this.Description) + `,`, `Filters:` + strings.Replace(this.Filters.String(), "Filters", "Filters", 1) + `,`, `VCSSource:` + strings.Replace(this.VCSSource.String(), "VCSSource", "VCSSource", 1) + `,`, `}`, @@ -7761,10 +7832,10 @@ func (this *CatalogStatus) String() string { } s := strings.Join([]string{`&CatalogStatus{`, `StatusDescriptor:` + strings.Replace(strings.Replace(this.StatusDescriptor.String(), "StatusDescriptor", "StatusDescriptor", 1), `&`, ``, 1) + `,`, - `LastSyncTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastSyncTime), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, - `TemplateCount:` + fmt.Sprintf("%v", this.TemplateCount) + `,`, - `URL:` + fmt.Sprintf("%v", this.URL) + `,`, `Project:` + fmt.Sprintf("%v", this.Project) + `,`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, + `TemplateCount:` + fmt.Sprintf("%v", this.TemplateCount) + `,`, + `LastSuccessfulSyncTime:` + strings.Replace(fmt.Sprintf("%v", this.LastSuccessfulSyncTime), "Time", "v1.Time", 1) + `,`, `}`, }, "") return s @@ -7813,7 +7884,6 @@ func (this *ConnectorBinding) String() string { s := strings.Join([]string{`&ConnectorBinding{`, `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ConnectorBindingSpec", "ConnectorBindingSpec", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "ConnectorBindingStatus", "ConnectorBindingStatus", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -7839,18 +7909,7 @@ func (this *ConnectorBindingSpec) String() string { return "nil" } s := strings.Join([]string{`&ConnectorBindingSpec{`, - `Connector:` + strings.Replace(strings.Replace(this.Connector.String(), "ConnectorReference", "ConnectorReference", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *ConnectorBindingStatus) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ConnectorBindingStatus{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Category:` + fmt.Sprintf("%v", this.Category) + `,`, + `Connector:` + strings.Replace(strings.Replace(this.Connector.String(), "ConnectorReferenceWithType", "ConnectorReferenceWithType", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -7881,8 +7940,8 @@ func (this *ConnectorConfigEntry) String() string { return "nil" } s := strings.Join([]string{`&ConnectorConfigEntry{`, + `Sensitive:` + fmt.Sprintf("%v", this.Sensitive) + `,`, `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `Visible:` + fmt.Sprintf("%v", this.Visible) + `,`, `}`, }, "") return s @@ -7914,6 +7973,18 @@ func (this *ConnectorReference) String() string { }, "") return s } +func (this *ConnectorReferenceWithType) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ConnectorReferenceWithType{`, + `ConnectorReference:` + strings.Replace(strings.Replace(this.ConnectorReference.String(), "ConnectorReference", "ConnectorReference", 1), `&`, ``, 1) + `,`, + `Category:` + fmt.Sprintf("%v", this.Category) + `,`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `}`, + }, "") + return s +} func (this *ConnectorSpec) String() string { if this == nil { return "nil" @@ -7923,8 +7994,8 @@ func (this *ConnectorSpec) String() string { `Category:` + fmt.Sprintf("%v", this.Category) + `,`, `Type:` + fmt.Sprintf("%v", this.Type) + `,`, `Config:` + strings.Replace(strings.Replace(this.Config.String(), "ConnectorConfig", "ConnectorConfig", 1), `&`, ``, 1) + `,`, - `Description:` + fmt.Sprintf("%v", this.Description) + `,`, `SecretName:` + fmt.Sprintf("%v", this.SecretName) + `,`, + `Description:` + fmt.Sprintf("%v", this.Description) + `,`, `}`, }, "") return s @@ -8095,7 +8166,7 @@ func (this *ResourceComponentsStatus) String() string { `StatusDescriptor:` + strings.Replace(strings.Replace(this.StatusDescriptor.String(), "StatusDescriptor", "StatusDescriptor", 1), `&`, ``, 1) + `,`, `Project:` + fmt.Sprintf("%v", this.Project) + `,`, `ResourceName:` + fmt.Sprintf("%v", this.ResourceName) + `,`, - `TemplateVersion:` + strings.Replace(this.TemplateVersion.String(), "TempalteVersionReference", "TempalteVersionReference", 1) + `,`, + `Template:` + strings.Replace(strings.Replace(this.Template.String(), "TemplateReferenceWithVersion", "TemplateReferenceWithVersion", 1), `&`, ``, 1) + `,`, `ComputedAttributes:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ComputedAttributes), "RawExtension", "runtime.RawExtension", 1), `&`, ``, 1) + `,`, `Components:` + repeatedStringForComponents + `,`, `Dependencies:` + repeatedStringForDependencies + `,`, @@ -8362,7 +8433,7 @@ func (this *ResourceRunSpec) String() string { `ResourceName:` + fmt.Sprintf("%v", this.ResourceName) + `,`, `Type:` + fmt.Sprintf("%v", this.Type) + `,`, `Attributes:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Attributes), "RawExtension", "runtime.RawExtension", 1), `&`, ``, 1) + `,`, - `TemplateVersion:` + strings.Replace(this.TemplateVersion.String(), "TempalteVersionReference", "TempalteVersionReference", 1) + `,`, + `Template:` + strings.Replace(strings.Replace(this.Template.String(), "TemplateReferenceWithVersion", "TemplateReferenceWithVersion", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -8585,8 +8656,8 @@ func (this *ResourceSpec) String() string { } s := strings.Join([]string{`&ResourceSpec{`, `Attributes:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Attributes), "RawExtension", "runtime.RawExtension", 1), `&`, ``, 1) + `,`, - `TemplateVersion:` + strings.Replace(this.TemplateVersion.String(), "TempalteVersionReference", "TempalteVersionReference", 1) + `,`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Template:` + strings.Replace(this.Template.String(), "TemplateReferenceWithVersion", "TemplateReferenceWithVersion", 1) + `,`, + `Type:` + valueToStringGenerated(this.Type) + `,`, `Draft:` + fmt.Sprintf("%v", this.Draft) + `,`, `Stop:` + fmt.Sprintf("%v", this.Stop) + `,`, `}`, @@ -8670,18 +8741,6 @@ func (this *StatusDescriptor) String() string { }, "") return s } -func (this *TempalteVersionReference) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&TempalteVersionReference{`, - `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Version:` + fmt.Sprintf("%v", this.Version) + `,`, - `}`, - }, "") - return s -} func (this *Template) String() string { if this == nil { return "nil" @@ -8710,6 +8769,28 @@ func (this *TemplateList) String() string { }, "") return s } +func (this *TemplateReference) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TemplateReference{`, + `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `}`, + }, "") + return s +} +func (this *TemplateReferenceWithVersion) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TemplateReferenceWithVersion{`, + `TemplateReference:` + strings.Replace(strings.Replace(this.TemplateReference.String(), "TemplateReference", "TemplateReference", 1), `&`, ``, 1) + `,`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, + `}`, + }, "") + return s +} func (this *TemplateSpec) String() string { if this == nil { return "nil" @@ -8733,12 +8814,11 @@ func (this *TemplateStatus) String() string { repeatedStringForVersions += "}" s := strings.Join([]string{`&TemplateStatus{`, `StatusDescriptor:` + strings.Replace(strings.Replace(this.StatusDescriptor.String(), "StatusDescriptor", "StatusDescriptor", 1), `&`, ``, 1) + `,`, - `LastSyncTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastSyncTime), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, - `OriginalName:` + fmt.Sprintf("%v", this.OriginalName) + `,`, - `URL:` + fmt.Sprintf("%v", this.URL) + `,`, `Project:` + fmt.Sprintf("%v", this.Project) + `,`, + `URL:` + fmt.Sprintf("%v", this.URL) + `,`, `Icon:` + fmt.Sprintf("%v", this.Icon) + `,`, `Versions:` + repeatedStringForVersions + `,`, + `LastSuccessfulSyncTime:` + strings.Replace(fmt.Sprintf("%v", this.LastSuccessfulSyncTime), "Time", "v1.Time", 1) + `,`, `}`, }, "") return s @@ -9084,28 +9164,8 @@ func (m *CatalogSpec) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Builtin", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Builtin = bool(v != 0) - case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TemplateFormat", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9133,11 +9193,31 @@ func (m *CatalogSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TemplateFormat = string(dAtA[iNdEx:postIndex]) + m.Description = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Builtin", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Builtin = bool(v != 0) case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TemplateFormat", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9165,7 +9245,7 @@ func (m *CatalogSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Description = string(dAtA[iNdEx:postIndex]) + m.TemplateFormat = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -9324,9 +9404,9 @@ func (m *CatalogStatus) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastSyncTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Project", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9336,45 +9416,25 @@ func (m *CatalogStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.LastSyncTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Project = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TemplateCount", wireType) - } - m.TemplateCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TemplateCount |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) } @@ -9406,11 +9466,30 @@ func (m *CatalogStatus) Unmarshal(dAtA []byte) error { } m.URL = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TemplateCount", wireType) + } + m.TemplateCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TemplateCount |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Project", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LastSuccessfulSyncTime", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -9420,23 +9499,27 @@ func (m *CatalogStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Project = string(dAtA[iNdEx:postIndex]) + if m.LastSuccessfulSyncTime == nil { + m.LastSuccessfulSyncTime = &v1.Time{} + } + if err := m.LastSuccessfulSyncTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -10028,39 +10111,6 @@ func (m *ConnectorBinding) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -10282,7 +10332,7 @@ func (m *ConnectorBindingSpec) Unmarshal(dAtA []byte) error { } return nil } -func (m *ConnectorBindingStatus) Unmarshal(dAtA []byte) error { +func (m *ConnectorConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10305,15 +10355,15 @@ func (m *ConnectorBindingStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ConnectorBindingStatus: wiretype end group for non-group") + return fmt.Errorf("proto: ConnectorConfig: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ConnectorBindingStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ConnectorConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -10341,13 +10391,13 @@ func (m *ConnectorBindingStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Type = string(dAtA[iNdEx:postIndex]) + m.Version = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Category", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -10357,137 +10407,23 @@ func (m *ConnectorBindingStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Category = ConnectorCategory(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConnectorConfig) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ConnectorConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConnectorConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Data == nil { - m.Data = make(map[string]ConnectorConfigEntry) + if m.Data == nil { + m.Data = make(map[string]ConnectorConfigEntry) } var mapkey string mapvalue := &ConnectorConfigEntry{} @@ -10637,6 +10573,26 @@ func (m *ConnectorConfigEntry) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sensitive", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Sensitive = bool(v != 0) + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } @@ -10668,26 +10624,6 @@ func (m *ConnectorConfigEntry) Unmarshal(dAtA []byte) error { } m.Value = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Visible", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Visible = bool(v != 0) default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -10940,6 +10876,153 @@ func (m *ConnectorReference) Unmarshal(dAtA []byte) error { } return nil } +func (m *ConnectorReferenceWithType) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConnectorReferenceWithType: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConnectorReferenceWithType: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectorReference", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ConnectorReference.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Category", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Category = ConnectorCategory(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ConnectorSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -11100,7 +11183,7 @@ func (m *ConnectorSpec) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SecretName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -11128,11 +11211,11 @@ func (m *ConnectorSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Description = string(dAtA[iNdEx:postIndex]) + m.SecretName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SecretName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -11160,7 +11243,7 @@ func (m *ConnectorSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SecretName = string(dAtA[iNdEx:postIndex]) + m.Description = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -12830,7 +12913,7 @@ func (m *ResourceComponentsStatus) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TemplateVersion", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Template", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -12857,10 +12940,7 @@ func (m *ResourceComponentsStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.TemplateVersion == nil { - m.TemplateVersion = &TempalteVersionReference{} - } - if err := m.TemplateVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Template.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -15307,7 +15387,7 @@ func (m *ResourceRunSpec) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TemplateVersion", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Template", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -15334,10 +15414,7 @@ func (m *ResourceRunSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.TemplateVersion == nil { - m.TemplateVersion = &TempalteVersionReference{} - } - if err := m.TemplateVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Template.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -17808,7 +17885,7 @@ func (m *ResourceSpec) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TemplateVersion", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Template", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -17835,10 +17912,10 @@ func (m *ResourceSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.TemplateVersion == nil { - m.TemplateVersion = &TempalteVersionReference{} + if m.Template == nil { + m.Template = &TemplateReferenceWithVersion{} } - if err := m.TemplateVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Template.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -17872,7 +17949,8 @@ func (m *ResourceSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Type = string(dAtA[iNdEx:postIndex]) + s := string(dAtA[iNdEx:postIndex]) + m.Type = &s iNdEx = postIndex case 4: if wireType != 0 { @@ -18754,7 +18832,7 @@ func (m *StatusDescriptor) Unmarshal(dAtA []byte) error { } return nil } -func (m *TempalteVersionReference) Unmarshal(dAtA []byte) error { +func (m *Template) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18777,17 +18855,17 @@ func (m *TempalteVersionReference) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TempalteVersionReference: wiretype end group for non-group") + return fmt.Errorf("proto: Template: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TempalteVersionReference: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Template: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -18797,29 +18875,30 @@ func (m *TempalteVersionReference) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Namespace = string(dAtA[iNdEx:postIndex]) + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -18829,29 +18908,30 @@ func (m *TempalteVersionReference) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -18861,23 +18941,24 @@ func (m *TempalteVersionReference) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Version = string(dAtA[iNdEx:postIndex]) + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -18900,7 +18981,7 @@ func (m *TempalteVersionReference) Unmarshal(dAtA []byte) error { } return nil } -func (m *Template) Unmarshal(dAtA []byte) error { +func (m *TemplateList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18923,15 +19004,15 @@ func (m *Template) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Template: wiretype end group for non-group") + return fmt.Errorf("proto: TemplateList: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Template: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TemplateList: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -18958,13 +19039,13 @@ func (m *Template) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -18991,15 +19072,66 @@ func (m *Template) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Items = append(m.Items, Template{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TemplateReference) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TemplateReference: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TemplateReference: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -19009,24 +19141,55 @@ func (m *Template) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Namespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF } + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -19049,7 +19212,7 @@ func (m *Template) Unmarshal(dAtA []byte) error { } return nil } -func (m *TemplateList) Unmarshal(dAtA []byte) error { +func (m *TemplateReferenceWithVersion) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -19072,15 +19235,15 @@ func (m *TemplateList) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TemplateList: wiretype end group for non-group") + return fmt.Errorf("proto: TemplateReferenceWithVersion: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TemplateList: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TemplateReferenceWithVersion: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TemplateReference", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -19107,15 +19270,15 @@ func (m *TemplateList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.TemplateReference.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -19125,25 +19288,23 @@ func (m *TemplateList) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, Template{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Version = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -19380,40 +19541,7 @@ func (m *TemplateStatus) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastSyncTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.LastSyncTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OriginalName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Project", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -19441,9 +19569,9 @@ func (m *TemplateStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.OriginalName = string(dAtA[iNdEx:postIndex]) + m.Project = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) } @@ -19475,9 +19603,9 @@ func (m *TemplateStatus) Unmarshal(dAtA []byte) error { } m.URL = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Project", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -19505,13 +19633,13 @@ func (m *TemplateStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Project = string(dAtA[iNdEx:postIndex]) + m.Icon = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Icon", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Versions", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -19521,27 +19649,29 @@ func (m *TemplateStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Icon = string(dAtA[iNdEx:postIndex]) + m.Versions = append(m.Versions, TemplateVersion{}) + if err := m.Versions[len(m.Versions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 7: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Versions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LastSuccessfulSyncTime", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -19568,8 +19698,10 @@ func (m *TemplateStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Versions = append(m.Versions, TemplateVersion{}) - if err := m.Versions[len(m.Versions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.LastSuccessfulSyncTime == nil { + m.LastSuccessfulSyncTime = &v1.Time{} + } + if err := m.LastSuccessfulSyncTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/pkg/apis/walruscore/v1/generated.proto b/pkg/apis/walruscore/v1/generated.proto index 03ac90adb..41bffd27b 100644 --- a/pkg/apis/walruscore/v1/generated.proto +++ b/pkg/apis/walruscore/v1/generated.proto @@ -42,20 +42,20 @@ message CatalogList { // CatalogSpec defines the desired state of Catalog. message CatalogSpec { + // Description of the catalog. + optional string description = 1; + // Builtin indicate the catalog is builtin catalog. // // +k8s:validation:cel[0]:rule="oldSelf == self" // +k8s:validation:cel[0]:message="immutable field" - optional bool builtin = 1; + optional bool builtin = 2; // TemplateFormat of the catalog. // // +k8s:validation:cel[0]:rule="oldSelf == self" // +k8s:validation:cel[0]:message="immutable field" - optional string templateFormat = 2; - - // Description of the catalog. - optional string description = 3; + optional string templateFormat = 3; // Filters specifies the filtering rules for the catalog. optional Filters filters = 4; @@ -69,17 +69,17 @@ message CatalogStatus { // StatusDescriptor defines the status of the catalog. optional StatusDescriptor statusDescriptor = 1; - // LastSyncTime record the last sync catalog time. - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastSyncTime = 2; - - // TemplateCount is the count of templates. - optional int64 templateCount = 3; + // Project is the project to which the catalog belongs. + optional string project = 2; // URL of the catalog. - optional string url = 4; + optional string url = 3; - // Project is the project to which the catalog belongs. - optional string project = 5; + // TemplateCount records the count of the related templates. + optional int64 templateCount = 4; + + // LastSuccessfulSyncTime records the last time the catalog was synchronized successfully. + optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastSuccessfulSyncTime = 5; } // Condition describes the state of a condition at a certain point. @@ -128,13 +128,11 @@ message Connector { // // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:crd-gen:resource:scope="Namespaced",subResources=["status"] +// +k8s:crd-gen:resource:scope="Namespaced" message ConnectorBinding { optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; optional ConnectorBindingSpec spec = 2; - - optional ConnectorBindingStatus status = 3; } // ConnectorBindingList contains a list of ConnectorBinding. @@ -149,28 +147,31 @@ message ConnectorBindingList { // ConnectorBindingSpec defines the desired state of ConnectorBinding. message ConnectorBindingSpec { // Connector is the reference to the connector. - optional ConnectorReference connector = 1; -} - -// ConnectorBindingStatus defines the observed state of ConnectorBinding. -message ConnectorBindingStatus { - // Type is the type of the connector. - optional string Type = 1; - - // Category is the category of the connector. - optional string Category = 2; + optional ConnectorReferenceWithType connector = 1; } +// ConnectorConfig defines the configuration of the Connector. message ConnectorConfig { + // Version is the version of the configuration. optional string version = 1; + // Data holds the configuration entries. + // + // +mapType=atomic map data = 2; } +// ConnectorConfigEntry defines the configuration entry of the Connector. message ConnectorConfigEntry { - optional string value = 1; + // Sensitive indicates whether the entry is sensitive. + optional bool sensitive = 1; - optional bool visible = 2; + // Value is the value of the configuration entry. + // + // When Sensitive is true, + // it is provided as a write-only input field, + // and returns "(sensitive)". + optional string value = 2; } // ConnectorList holds the list of Connector. @@ -191,29 +192,67 @@ message ConnectorReference { optional string namespace = 2; } +// ConnectorReferenceWithType is a reference to a connector with its category and type. +message ConnectorReferenceWithType { + optional ConnectorReference connectorReference = 1; + + // Category is the category of the connector. + // + // If the Category is empty, + // the Category will be set to the category of the connector. + // + // +k8s:validation:cel[0]:rule="oldSelf == self" + // +k8s:validation:cel[0]:message="immutable field" + optional string category = 2; + + // Type is the type of the connector. + // + // If the Type is empty, + // the Type will be set to the type of the connector. + // + // +k8s:validation:cel[0]:rule="oldSelf == self" + // +k8s:validation:cel[0]:message="immutable field" + optional string type = 3; +} + // ConnectorSpec defines the desired state of Connector. message ConnectorSpec { // ApplicableEnvironmentType is the environment type that the connector is applicable to. // + // +k8s:validation:cel[0]:rule="oldSelf == self" + // +k8s:validation:cel[0]:message="immutable field" // +k8s:validation:enum=["Development","Staging","Production"] optional string applicableEnvironmentType = 1; // Category is the category of the connector. // + // +k8s:validation:cel[0]:rule="oldSelf == self" + // +k8s:validation:cel[0]:message="immutable field" // +k8s:validation:enum=["Docker","Kubernetes","Custom","CloudProvider"] optional string category = 2; // Type is the type of the connector. + // + // +k8s:validation:cel[0]:rule="oldSelf == self" + // +k8s:validation:cel[0]:message="immutable field" optional string type = 3; // Config is the configuration of the connector. + // + // Any sensitive configuration entry will be erased before storing. optional ConnectorConfig config = 4; - // Description is the description of the connector. - optional string description = 5; + // SecretName is the name of the secret that stores the Config. + // + // If the secret name is not provided, a secret will be created to store the Config, + // otherwise, the Config will be stored in the secret with the provided name. + // + // +k8s:validation:cel[0]:rule="oldSelf == self" + // +k8s:validation:cel[0]:message="immutable field" + optional string secretName = 5; - // SecretName is the auto-generated secret name for the connector configuration. Will be overridden if set. - optional string secretName = 6; + // Description is the description of the connector. + optional string description = 6; } // ConnectorStatus defines the observed state of Connector. @@ -354,8 +393,9 @@ message ResourceComponentsStatus { // ResourceName is the resource name of the resource components. optional string resource = 3; - // TemplateVersion template version to which is used to create the resource components. - optional TempalteVersionReference templateVersionReference = 4; + // Template is the reference to the Template which to create the resource components, + // it must point to a specific version of the Template. + optional TemplateReferenceWithVersion template = 4; // ComputedAttributes stores the computed attributes of the component. // It stores the attributes of the resource that used to create the component. @@ -562,11 +602,9 @@ message ResourceRunSpec { // +k8s:validation:cel[0]:message="immutable field" optional k8s.io.apimachinery.pkg.runtime.RawExtension attributes = 4; - // TemplateVersion template version to which the resource belongs. - // - // +k8s:validation:cel[0]:rule="oldSelf == self" - // +k8s:validation:cel[0]:message="immutable field" - optional TempalteVersionReference templateVersionReference = 5; + // Template is the reference to the Template which to create the resource components, + // it must point to a specific version of the Template. + optional TemplateReferenceWithVersion template = 5; } // ResourceRunStatus defines the observed state of ResourceRun. @@ -778,10 +816,14 @@ message ResourceSpec { // Attributes to configure the template. optional k8s.io.apimachinery.pkg.runtime.RawExtension attributes = 1; - // TemplateVersion template version to which the resource belongs. - optional TempalteVersionReference templateVersionReference = 2; + // Template is the reference to the Template which the resource used, + // it is able to pointed to a specific version of the Template. + // + // If the version is not specified, + // the default version of the Template will be used. + optional TemplateReferenceWithVersion template = 2; - // Type is a resource definition type. + // Type is the type of the ResourceDefinition which the resource be. optional string type = 3; // Draft indicates whether the resource is a draft. @@ -859,14 +901,6 @@ message StatusDescriptor { repeated Condition conditions = 2; } -message TempalteVersionReference { - optional string namespace = 1; - - optional string name = 2; - - optional string version = 3; -} - // Template is the schema for the templates API. // // +genclient @@ -889,6 +923,23 @@ message TemplateList { repeated Template items = 2; } +// TemplateReference is a reference to a template. +message TemplateReference { + // Namespace is the namespace of the template. + optional string namespace = 1; + + // Name is the name of the template. + optional string name = 2; +} + +// TemplateReferenceWithVersion is a reference to a template with a specific version. +message TemplateReferenceWithVersion { + optional TemplateReference templateReference = 1; + + // Version is a specific version of the template. + optional string version = 2; +} + // TemplateSpec defines the desired state of Template. message TemplateSpec { // TemplateFormat of the content. @@ -909,23 +960,20 @@ message TemplateStatus { // StatusDescriptor defines the status of the catalog. optional StatusDescriptor statusDescriptor = 1; - // LastSyncTime record the last sync catalog time. - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastSyncTime = 2; - - // The original name of the template. - optional string originalName = 3; + // Project is the project that the template belongs to. + optional string project = 2; // URL of the template. - optional string url = 4; - - // Project is the project that the catalog belongs to. - optional string project = 5; + optional string url = 3; // A URL to an SVG or PNG image to be used as an icon. - optional string icon = 6; + optional string icon = 4; // Versions contains the versions for the template. - repeated TemplateVersion versions = 7; + repeated TemplateVersion versions = 5; + + // LastSuccessfulSyncTime record the last sync time the template was synchronized successfully. + optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastSuccessfulSyncTime = 6; } // TemplateVersion defines the version of Template. diff --git a/pkg/apis/walruscore/v1/resource.go b/pkg/apis/walruscore/v1/resource.go index 9a06be2a9..aeaa0d18e 100644 --- a/pkg/apis/walruscore/v1/resource.go +++ b/pkg/apis/walruscore/v1/resource.go @@ -25,11 +25,15 @@ type ResourceSpec struct { // Attributes to configure the template. Attributes runtime.RawExtension `json:"attributes,omitempty"` - // TemplateVersion template version to which the resource belongs. - TemplateVersion *TempalteVersionReference `json:"templateVersionReference,omitempty"` - - // Type is a resource definition type. - Type string `json:"type,omitempty"` + // Template is the reference to the Template which the resource used, + // it is able to pointed to a specific version of the Template. + // + // If the version is not specified, + // the default version of the Template will be used. + Template *TemplateReferenceWithVersion `json:"template,omitempty"` + + // Type is the type of the ResourceDefinition which the resource be. + Type *string `json:"type,omitempty"` // Draft indicates whether the resource is a draft. Draft bool `json:"draft,omitempty"` diff --git a/pkg/apis/walruscore/v1/resource_components.go b/pkg/apis/walruscore/v1/resource_components.go index 69972b003..56a3ddfaa 100644 --- a/pkg/apis/walruscore/v1/resource_components.go +++ b/pkg/apis/walruscore/v1/resource_components.go @@ -34,8 +34,9 @@ type ResourceComponentsStatus struct { // ResourceName is the resource name of the resource components. ResourceName string `json:"resource"` - // TemplateVersion template version to which is used to create the resource components. - TemplateVersion *TempalteVersionReference `json:"templateVersionReference"` + // Template is the reference to the Template which to create the resource components, + // it must point to a specific version of the Template. + Template TemplateReferenceWithVersion `json:"template"` // ComputedAttributes stores the computed attributes of the component. // It stores the attributes of the resource that used to create the component. diff --git a/pkg/apis/walruscore/v1/resource_run.go b/pkg/apis/walruscore/v1/resource_run.go index c9326f25a..52c697c0e 100644 --- a/pkg/apis/walruscore/v1/resource_run.go +++ b/pkg/apis/walruscore/v1/resource_run.go @@ -47,11 +47,9 @@ type ResourceRunSpec struct { // +k8s:validation:cel[0]:message="immutable field" Attributes runtime.RawExtension `json:"attributes"` - // TemplateVersion template version to which the resource belongs. - // - // +k8s:validation:cel[0]:rule="oldSelf == self" - // +k8s:validation:cel[0]:message="immutable field" - TemplateVersion *TempalteVersionReference `json:"templateVersionReference"` + // Template is the reference to the Template which to create the resource components, + // it must point to a specific version of the Template. + Template TemplateReferenceWithVersion `json:"template"` } // ResourceRunStatus defines the observed state of ResourceRun. diff --git a/pkg/apis/walruscore/v1/template.go b/pkg/apis/walruscore/v1/template.go index 5b32c1512..3e1c87cc6 100644 --- a/pkg/apis/walruscore/v1/template.go +++ b/pkg/apis/walruscore/v1/template.go @@ -3,6 +3,7 @@ package v1 import ( meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/types" ) // Template is the schema for the templates API. @@ -20,6 +21,21 @@ type Template struct { var _ runtime.Object = (*Template)(nil) +// TemplateReference is a reference to a template. +type TemplateReference struct { + // Namespace is the namespace of the template. + Namespace string `json:"namespace"` + // Name is the name of the template. + Name string `json:"name"` +} + +func (in *TemplateReference) ToNamespacedName() types.NamespacedName { + return types.NamespacedName{ + Namespace: in.Namespace, + Name: in.Name, + } +} + // TemplateSpec defines the desired state of Template. type TemplateSpec struct { // TemplateFormat of the content. @@ -40,23 +56,20 @@ type TemplateStatus struct { // StatusDescriptor defines the status of the catalog. StatusDescriptor `json:",inline"` - // LastSyncTime record the last sync catalog time. - LastSyncTime meta.Time `json:"lastSyncTime,omitempty"` - - // The original name of the template. - OriginalName string `json:"originalName,omitempty"` + // Project is the project that the template belongs to. + Project string `json:"project,omitempty"` // URL of the template. URL string `json:"url,omitempty"` - // Project is the project that the catalog belongs to. - Project string `json:"project,omitempty"` - // A URL to an SVG or PNG image to be used as an icon. Icon string `json:"icon,omitempty"` // Versions contains the versions for the template. Versions []TemplateVersion `json:"versions,omitempty"` + + // LastSuccessfulSyncTime record the last sync time the template was synchronized successfully. + LastSuccessfulSyncTime *meta.Time `json:"lastSuccessfulSyncTime,omitempty"` } // TemplateList holds the list of Template. @@ -109,8 +122,10 @@ type TemplateVersion struct { Removed bool `json:"removed,omitempty"` } -type TempalteVersionReference struct { - Namespace string `json:"namespace"` - Name string `json:"name"` - Version string `json:"version"` +// TemplateReferenceWithVersion is a reference to a template with a specific version. +type TemplateReferenceWithVersion struct { + TemplateReference `json:",inline"` + + // Version is a specific version of the template. + Version string `json:"version,omitempty"` } diff --git a/pkg/apis/walruscore/v1/zz_generated.crds.go b/pkg/apis/walruscore/v1/zz_generated.crds.go index b5ea680b5..e2214a131 100644 --- a/pkg/apis/walruscore/v1/zz_generated.crds.go +++ b/pkg/apis/walruscore/v1/zz_generated.crds.go @@ -216,10 +216,11 @@ func crd_pkg_apis_walruscore_v1_Catalog() *v1.CustomResourceDefinition { }, Nullable: true, }, - "lastSyncTime": { - Description: "LastSyncTime record the last sync catalog time.", + "lastSuccessfulSyncTime": { + Description: "LastSuccessfulSyncTime records the last time the catalog was synchronized successfully.", Type: "string", Format: "date-time", + Nullable: true, }, "phase": { Description: "Phase is the summary of conditions.", @@ -234,7 +235,7 @@ func crd_pkg_apis_walruscore_v1_Catalog() *v1.CustomResourceDefinition { Type: "string", }, "templateCount": { - Description: "TemplateCount is the count of templates.", + Description: "TemplateCount records the count of the related templates.", Type: "integer", Format: "int64", }, @@ -318,6 +319,12 @@ func crd_pkg_apis_walruscore_v1_Connector() *v1.CustomResourceDefinition { Raw: []byte(`"Production"`), }, }, + XValidations: []v1.ValidationRule{ + { + Rule: "oldSelf == self", + Message: "immutable field", + }, + }, }, "category": { Description: "Category is the category of the connector.", @@ -336,9 +343,15 @@ func crd_pkg_apis_walruscore_v1_Connector() *v1.CustomResourceDefinition { Raw: []byte(`"CloudProvider"`), }, }, + XValidations: []v1.ValidationRule{ + { + Rule: "oldSelf == self", + Message: "immutable field", + }, + }, }, "config": { - Description: "Config is the configuration of the connector.", + Description: "Config is the configuration of the connector.\nAny sensitive configuration entry will be erased before storing.", Type: "object", Required: []string{ "version", @@ -346,29 +359,34 @@ func crd_pkg_apis_walruscore_v1_Connector() *v1.CustomResourceDefinition { }, Properties: map[string]v1.JSONSchemaProps{ "data": { - Type: "object", + Description: "Data holds the configuration entries.", + Type: "object", AdditionalProperties: &v1.JSONSchemaPropsOrBool{ Allows: true, Schema: &v1.JSONSchemaProps{ Type: "object", Required: []string{ + "sensitive", "value", - "visible", }, Properties: map[string]v1.JSONSchemaProps{ - "value": { - Type: "string", + "sensitive": { + Description: "Sensitive indicates whether the entry is sensitive.", + Type: "boolean", }, - "visible": { - Type: "boolean", + "value": { + Description: "Value is the value of the configuration entry.\nWhen Sensitive is true,\nit is provided as a write-only input field,\nand returns \"(sensitive)\".", + Type: "string", }, }, }, }, Nullable: true, + XMapType: ptr.To[string]("atomic"), }, "version": { - Type: "string", + Description: "Version is the version of the configuration.", + Type: "string", }, }, }, @@ -377,12 +395,24 @@ func crd_pkg_apis_walruscore_v1_Connector() *v1.CustomResourceDefinition { Type: "string", }, "secretName": { - Description: "SecretName is the auto-generated secret name for the connector configuration. Will be overridden if set.", + Description: "SecretName is the name of the secret that stores the Config.\nIf the secret name is not provided, a secret will be created to store the Config,\notherwise, the Config will be stored in the secret with the provided name.", Type: "string", + XValidations: []v1.ValidationRule{ + { + Rule: "oldSelf == self", + Message: "immutable field", + }, + }, }, "type": { Description: "Type is the type of the connector.", Type: "string", + XValidations: []v1.ValidationRule{ + { + Rule: "oldSelf == self", + Message: "immutable field", + }, + }, }, }, }, @@ -515,11 +545,17 @@ func crd_pkg_apis_walruscore_v1_ConnectorBinding() *v1.CustomResourceDefinition "connector": { Description: "Connector is the reference to the connector.", Type: "object", - Required: []string{ - "name", - "namespace", - }, Properties: map[string]v1.JSONSchemaProps{ + "category": { + Description: "Category is the category of the connector.\nIf the Category is empty,\nthe Category will be set to the category of the connector.", + Type: "string", + XValidations: []v1.ValidationRule{ + { + Rule: "oldSelf == self", + Message: "immutable field", + }, + }, + }, "name": { Description: "Name is the name of the connector.", Type: "string", @@ -528,33 +564,23 @@ func crd_pkg_apis_walruscore_v1_ConnectorBinding() *v1.CustomResourceDefinition Description: "Namespace is the namespace of the connector.", Type: "string", }, + "type": { + Description: "Type is the type of the connector.\nIf the Type is empty,\nthe Type will be set to the type of the connector.", + Type: "string", + XValidations: []v1.ValidationRule{ + { + Rule: "oldSelf == self", + Message: "immutable field", + }, + }, + }, }, }, }, }, - "status": { - Type: "object", - Required: []string{ - "Type", - "Category", - }, - Properties: map[string]v1.JSONSchemaProps{ - "Category": { - Description: "Category is the category of the connector.", - Type: "string", - }, - "Type": { - Description: "Type is the type of the connector.", - Type: "string", - }, - }, - }, }, }, }, - Subresources: &v1.CustomResourceSubresources{ - Status: &v1.CustomResourceSubresourceStatus{}, - }, }, }, }, @@ -614,30 +640,29 @@ func crd_pkg_apis_walruscore_v1_Resource() *v1.CustomResourceDefinition { Description: "Stop indicates whether to stop the resource.", Type: "boolean", }, - "templateVersionReference": { - Description: "TemplateVersion template version to which the resource belongs.", + "template": { + Description: "Template is the reference to the Template which the resource used,\nit is able to pointed to a specific version of the Template.\nIf the version is not specified,\nthe default version of the Template will be used.", Type: "object", - Required: []string{ - "namespace", - "name", - "version", - }, Properties: map[string]v1.JSONSchemaProps{ "name": { - Type: "string", + Description: "Name is the name of the template.", + Type: "string", }, "namespace": { - Type: "string", + Description: "Namespace is the namespace of the template.", + Type: "string", }, "version": { - Type: "string", + Description: "Version is a specific version of the template.", + Type: "string", }, }, Nullable: true, }, "type": { - Description: "Type is a resource definition type.", + Description: "Type is the type of the ResourceDefinition which the resource be.", Type: "string", + Nullable: true, }, }, }, @@ -847,7 +872,7 @@ func crd_pkg_apis_walruscore_v1_ResourceComponents() *v1.CustomResourceDefinitio Required: []string{ "project", "resource", - "templateVersionReference", + "template", "computedAttributes", "components", "dependencies", @@ -1006,26 +1031,23 @@ func crd_pkg_apis_walruscore_v1_ResourceComponents() *v1.CustomResourceDefinitio Description: "ResourceName is the resource name of the resource components.", Type: "string", }, - "templateVersionReference": { - Description: "TemplateVersion template version to which is used to create the resource components.", + "template": { + Description: "Template is the reference to the Template which to create the resource components,\nit must point to a specific version of the Template.", Type: "object", - Required: []string{ - "namespace", - "name", - "version", - }, Properties: map[string]v1.JSONSchemaProps{ "name": { - Type: "string", + Description: "Name is the name of the template.", + Type: "string", }, "namespace": { - Type: "string", + Description: "Namespace is the namespace of the template.", + Type: "string", }, "version": { - Type: "string", + Description: "Version is a specific version of the template.", + Type: "string", }, }, - Nullable: true, }, }, }, @@ -6716,7 +6738,7 @@ func crd_pkg_apis_walruscore_v1_ResourceRun() *v1.CustomResourceDefinition { "resource", "type", "attributes", - "templateVersionReference", + "template", }, Properties: map[string]v1.JSONSchemaProps{ "attributes": { @@ -6750,30 +6772,21 @@ func crd_pkg_apis_walruscore_v1_ResourceRun() *v1.CustomResourceDefinition { }, }, }, - "templateVersionReference": { - Description: "TemplateVersion template version to which the resource belongs.", + "template": { + Description: "Template is the reference to the Template which to create the resource components,\nit must point to a specific version of the Template.", Type: "object", - Required: []string{ - "namespace", - "name", - "version", - }, Properties: map[string]v1.JSONSchemaProps{ "name": { - Type: "string", + Description: "Name is the name of the template.", + Type: "string", }, "namespace": { - Type: "string", + Description: "Namespace is the namespace of the template.", + Type: "string", }, "version": { - Type: "string", - }, - }, - Nullable: true, - XValidations: []v1.ValidationRule{ - { - Rule: "oldSelf == self", - Message: "immutable field", + Description: "Version is a specific version of the template.", + Type: "string", }, }, }, @@ -15651,14 +15664,11 @@ func crd_pkg_apis_walruscore_v1_Template() *v1.CustomResourceDefinition { Description: "A URL to an SVG or PNG image to be used as an icon.", Type: "string", }, - "lastSyncTime": { - Description: "LastSyncTime record the last sync catalog time.", + "lastSuccessfulSyncTime": { + Description: "LastSuccessfulSyncTime record the last sync time the template was synchronized successfully.", Type: "string", Format: "date-time", - }, - "originalName": { - Description: "The original name of the template.", - Type: "string", + Nullable: true, }, "phase": { Description: "Phase is the summary of conditions.", @@ -15669,7 +15679,7 @@ func crd_pkg_apis_walruscore_v1_Template() *v1.CustomResourceDefinition { Type: "string", }, "project": { - Description: "Project is the project that the catalog belongs to.", + Description: "Project is the project that the template belongs to.", Type: "string", }, "url": { diff --git a/pkg/apis/walruscore/v1/zz_generated.deepcopy.go b/pkg/apis/walruscore/v1/zz_generated.deepcopy.go index f6214a2fc..9d486f358 100644 --- a/pkg/apis/walruscore/v1/zz_generated.deepcopy.go +++ b/pkg/apis/walruscore/v1/zz_generated.deepcopy.go @@ -104,7 +104,10 @@ func (in *CatalogSpec) DeepCopy() *CatalogSpec { func (in *CatalogStatus) DeepCopyInto(out *CatalogStatus) { *out = *in in.StatusDescriptor.DeepCopyInto(&out.StatusDescriptor) - in.LastSyncTime.DeepCopyInto(&out.LastSyncTime) + if in.LastSuccessfulSyncTime != nil { + in, out := &in.LastSuccessfulSyncTime, &out.LastSuccessfulSyncTime + *out = (*in).DeepCopy() + } return } @@ -185,7 +188,6 @@ func (in *ConnectorBinding) DeepCopyInto(out *ConnectorBinding) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) out.Spec = in.Spec - out.Status = in.Status return } @@ -257,22 +259,6 @@ func (in *ConnectorBindingSpec) DeepCopy() *ConnectorBindingSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConnectorBindingStatus) DeepCopyInto(out *ConnectorBindingStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectorBindingStatus. -func (in *ConnectorBindingStatus) DeepCopy() *ConnectorBindingStatus { - if in == nil { - return nil - } - out := new(ConnectorBindingStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ConnectorConfig) DeepCopyInto(out *ConnectorConfig) { *out = *in @@ -361,6 +347,23 @@ func (in *ConnectorReference) DeepCopy() *ConnectorReference { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConnectorReferenceWithType) DeepCopyInto(out *ConnectorReferenceWithType) { + *out = *in + out.ConnectorReference = in.ConnectorReference + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectorReferenceWithType. +func (in *ConnectorReferenceWithType) DeepCopy() *ConnectorReferenceWithType { + if in == nil { + return nil + } + out := new(ConnectorReferenceWithType) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ConnectorSpec) DeepCopyInto(out *ConnectorSpec) { *out = *in @@ -659,11 +662,7 @@ func (in *ResourceComponentsSpec) DeepCopy() *ResourceComponentsSpec { func (in *ResourceComponentsStatus) DeepCopyInto(out *ResourceComponentsStatus) { *out = *in in.StatusDescriptor.DeepCopyInto(&out.StatusDescriptor) - if in.TemplateVersion != nil { - in, out := &in.TemplateVersion, &out.TemplateVersion - *out = new(TempalteVersionReference) - **out = **in - } + out.Template = in.Template in.ComputedAttributes.DeepCopyInto(&out.ComputedAttributes) if in.Components != nil { in, out := &in.Components, &out.Components @@ -1173,11 +1172,7 @@ func (in *ResourceRunList) DeepCopyObject() runtime.Object { func (in *ResourceRunSpec) DeepCopyInto(out *ResourceRunSpec) { *out = *in in.Attributes.DeepCopyInto(&out.Attributes) - if in.TemplateVersion != nil { - in, out := &in.TemplateVersion, &out.TemplateVersion - *out = new(TempalteVersionReference) - **out = **in - } + out.Template = in.Template return } @@ -1587,9 +1582,14 @@ func (in *ResourceRunTemplateStep) DeepCopy() *ResourceRunTemplateStep { func (in *ResourceSpec) DeepCopyInto(out *ResourceSpec) { *out = *in in.Attributes.DeepCopyInto(&out.Attributes) - if in.TemplateVersion != nil { - in, out := &in.TemplateVersion, &out.TemplateVersion - *out = new(TempalteVersionReference) + if in.Template != nil { + in, out := &in.Template, &out.Template + *out = new(TemplateReferenceWithVersion) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) **out = **in } return @@ -1756,22 +1756,6 @@ func (in *StatusDescriptor) DeepCopy() *StatusDescriptor { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TempalteVersionReference) DeepCopyInto(out *TempalteVersionReference) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TempalteVersionReference. -func (in *TempalteVersionReference) DeepCopy() *TempalteVersionReference { - if in == nil { - return nil - } - out := new(TempalteVersionReference) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Template) DeepCopyInto(out *Template) { *out = *in @@ -1833,6 +1817,39 @@ func (in *TemplateList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TemplateReference) DeepCopyInto(out *TemplateReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateReference. +func (in *TemplateReference) DeepCopy() *TemplateReference { + if in == nil { + return nil + } + out := new(TemplateReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TemplateReferenceWithVersion) DeepCopyInto(out *TemplateReferenceWithVersion) { + *out = *in + out.TemplateReference = in.TemplateReference + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateReferenceWithVersion. +func (in *TemplateReferenceWithVersion) DeepCopy() *TemplateReferenceWithVersion { + if in == nil { + return nil + } + out := new(TemplateReferenceWithVersion) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TemplateSpec) DeepCopyInto(out *TemplateSpec) { *out = *in @@ -1858,7 +1875,6 @@ func (in *TemplateSpec) DeepCopy() *TemplateSpec { func (in *TemplateStatus) DeepCopyInto(out *TemplateStatus) { *out = *in in.StatusDescriptor.DeepCopyInto(&out.StatusDescriptor) - in.LastSyncTime.DeepCopyInto(&out.LastSyncTime) if in.Versions != nil { in, out := &in.Versions, &out.Versions *out = make([]TemplateVersion, len(*in)) @@ -1866,6 +1882,10 @@ func (in *TemplateStatus) DeepCopyInto(out *TemplateStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.LastSuccessfulSyncTime != nil { + in, out := &in.LastSuccessfulSyncTime, &out.LastSuccessfulSyncTime + *out = (*in).DeepCopy() + } return } diff --git a/pkg/apis/zz_generated.openapi.go b/pkg/apis/zz_generated.openapi.go index 5bf36b67a..c459faf9a 100644 --- a/pkg/apis/zz_generated.openapi.go +++ b/pkg/apis/zz_generated.openapi.go @@ -26,6 +26,8 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/seal-io/walrus/pkg/apis/walrus/v1.Connector": schema_pkg_apis_walrus_v1_Connector(ref), "github.com/seal-io/walrus/pkg/apis/walrus/v1.ConnectorBinding": schema_pkg_apis_walrus_v1_ConnectorBinding(ref), "github.com/seal-io/walrus/pkg/apis/walrus/v1.ConnectorBindingList": schema_pkg_apis_walrus_v1_ConnectorBindingList(ref), + "github.com/seal-io/walrus/pkg/apis/walrus/v1.ConnectorConfig": schema_pkg_apis_walrus_v1_ConnectorConfig(ref), + "github.com/seal-io/walrus/pkg/apis/walrus/v1.ConnectorConfigStatus": schema_pkg_apis_walrus_v1_ConnectorConfigStatus(ref), "github.com/seal-io/walrus/pkg/apis/walrus/v1.ConnectorList": schema_pkg_apis_walrus_v1_ConnectorList(ref), "github.com/seal-io/walrus/pkg/apis/walrus/v1.Environment": schema_pkg_apis_walrus_v1_Environment(ref), "github.com/seal-io/walrus/pkg/apis/walrus/v1.EnvironmentList": schema_pkg_apis_walrus_v1_EnvironmentList(ref), @@ -98,11 +100,11 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorBinding": schema_pkg_apis_walruscore_v1_ConnectorBinding(ref), "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorBindingList": schema_pkg_apis_walruscore_v1_ConnectorBindingList(ref), "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorBindingSpec": schema_pkg_apis_walruscore_v1_ConnectorBindingSpec(ref), - "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorBindingStatus": schema_pkg_apis_walruscore_v1_ConnectorBindingStatus(ref), "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorConfig": schema_pkg_apis_walruscore_v1_ConnectorConfig(ref), "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorConfigEntry": schema_pkg_apis_walruscore_v1_ConnectorConfigEntry(ref), "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorList": schema_pkg_apis_walruscore_v1_ConnectorList(ref), "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorReference": schema_pkg_apis_walruscore_v1_ConnectorReference(ref), + "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorReferenceWithType": schema_pkg_apis_walruscore_v1_ConnectorReferenceWithType(ref), "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorSpec": schema_pkg_apis_walruscore_v1_ConnectorSpec(ref), "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorStatus": schema_pkg_apis_walruscore_v1_ConnectorStatus(ref), "github.com/seal-io/walrus/pkg/apis/walruscore/v1.Filters": schema_pkg_apis_walruscore_v1_Filters(ref), @@ -160,9 +162,10 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/seal-io/walrus/pkg/apis/walruscore/v1.SchemaList": schema_pkg_apis_walruscore_v1_SchemaList(ref), "github.com/seal-io/walrus/pkg/apis/walruscore/v1.SchemaStatus": schema_pkg_apis_walruscore_v1_SchemaStatus(ref), "github.com/seal-io/walrus/pkg/apis/walruscore/v1.StatusDescriptor": schema_pkg_apis_walruscore_v1_StatusDescriptor(ref), - "github.com/seal-io/walrus/pkg/apis/walruscore/v1.TempalteVersionReference": schema_pkg_apis_walruscore_v1_TempalteVersionReference(ref), "github.com/seal-io/walrus/pkg/apis/walruscore/v1.Template": schema_pkg_apis_walruscore_v1_Template(ref), "github.com/seal-io/walrus/pkg/apis/walruscore/v1.TemplateList": schema_pkg_apis_walruscore_v1_TemplateList(ref), + "github.com/seal-io/walrus/pkg/apis/walruscore/v1.TemplateReference": schema_pkg_apis_walruscore_v1_TemplateReference(ref), + "github.com/seal-io/walrus/pkg/apis/walruscore/v1.TemplateReferenceWithVersion": schema_pkg_apis_walruscore_v1_TemplateReferenceWithVersion(ref), "github.com/seal-io/walrus/pkg/apis/walruscore/v1.TemplateSpec": schema_pkg_apis_walruscore_v1_TemplateSpec(ref), "github.com/seal-io/walrus/pkg/apis/walruscore/v1.TemplateStatus": schema_pkg_apis_walruscore_v1_TemplateStatus(ref), "github.com/seal-io/walrus/pkg/apis/walruscore/v1.TemplateVersion": schema_pkg_apis_walruscore_v1_TemplateVersion(ref), @@ -625,18 +628,12 @@ func schema_pkg_apis_walrus_v1_ConnectorBinding(ref common.ReferenceCallback) co Ref: ref("github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorBindingSpec"), }, }, - "status": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorBindingStatus"), - }, - }, }, Required: []string{"spec"}, }, }, Dependencies: []string{ - "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorBindingSpec", "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorBindingStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorBindingSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -689,6 +686,125 @@ func schema_pkg_apis_walrus_v1_ConnectorBindingList(ref common.ReferenceCallback } } +func schema_pkg_apis_walrus_v1_ConnectorConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ConnectorConfig is the subresource of the Connector resource for extract configuration.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/seal-io/walrus/pkg/apis/walrus/v1.ConnectorConfigStatus"), + }, + }, + }, + Required: []string{"status"}, + }, + }, + Dependencies: []string{ + "github.com/seal-io/walrus/pkg/apis/walrus/v1.ConnectorConfigStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_walrus_v1_ConnectorConfigStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ConnectorConfigStatus defines the observed state of ConnectorConfig.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "applicableEnvironmentType": { + SchemaProps: spec.SchemaProps{ + Description: "ApplicableEnvironmentType is the environment type that the connector is applicable to.\n\nPossible enum values:\n - `\"Development\"` means the environment is for development.\n - `\"Production\"` means the environment is for production.\n - `\"Staging\"` means the environment is for staging.", + Default: "", + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"Development", "Production", "Staging"}, + }, + }, + "category": { + SchemaProps: spec.SchemaProps{ + Description: "Category is the category of the connector.\n\nPossible enum values:\n - `\"CloudProvider\"`\n - `\"Custom\"`\n - `\"Docker\"`\n - `\"Kubernetes\"`", + Default: "", + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"CloudProvider", "Custom", "Docker", "Kubernetes"}, + }, + }, + "type": { + SchemaProps: spec.SchemaProps{ + Description: "Type is the type of the connector.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Version is the version of the configuration.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "data": { + SchemaProps: spec.SchemaProps{ + Description: "Data is the configuration of the connector.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "byte", + }, + }, + }, + }, + }, + "phase": { + SchemaProps: spec.SchemaProps{ + Description: "Phase is the summary of conditions.", + Type: []string{"string"}, + Format: "", + }, + }, + "phaseMessage": { + SchemaProps: spec.SchemaProps{ + Description: "PhaseMessage is the message of the phase.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"applicableEnvironmentType", "category", "type", "version", "data"}, + }, + }, + } +} + func schema_pkg_apis_walrus_v1_ConnectorList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -3538,6 +3654,13 @@ func schema_pkg_apis_walruscore_v1_CatalogSpec(ref common.ReferenceCallback) com Description: "CatalogSpec defines the desired state of Catalog.", Type: []string{"object"}, Properties: map[string]spec.Schema{ + "description": { + SchemaProps: spec.SchemaProps{ + Description: "Description of the catalog.", + Type: []string{"string"}, + Format: "", + }, + }, "builtin": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ @@ -3563,13 +3686,6 @@ func schema_pkg_apis_walruscore_v1_CatalogSpec(ref common.ReferenceCallback) com Format: "", }, }, - "description": { - SchemaProps: spec.SchemaProps{ - Description: "Description of the catalog.", - Type: []string{"string"}, - Format: "", - }, - }, "filters": { SchemaProps: spec.SchemaProps{ Description: "Filters specifies the filtering rules for the catalog.", @@ -3626,17 +3742,11 @@ func schema_pkg_apis_walruscore_v1_CatalogStatus(ref common.ReferenceCallback) c }, }, }, - "lastSyncTime": { - SchemaProps: spec.SchemaProps{ - Description: "LastSyncTime record the last sync catalog time.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "templateCount": { + "project": { SchemaProps: spec.SchemaProps{ - Description: "TemplateCount is the count of templates.", - Type: []string{"integer"}, - Format: "int64", + Description: "Project is the project to which the catalog belongs.", + Type: []string{"string"}, + Format: "", }, }, "url": { @@ -3646,11 +3756,17 @@ func schema_pkg_apis_walruscore_v1_CatalogStatus(ref common.ReferenceCallback) c Format: "", }, }, - "project": { + "templateCount": { SchemaProps: spec.SchemaProps{ - Description: "Project is the project to which the catalog belongs.", - Type: []string{"string"}, - Format: "", + Description: "TemplateCount records the count of the related templates.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "lastSuccessfulSyncTime": { + SchemaProps: spec.SchemaProps{ + Description: "LastSuccessfulSyncTime records the last time the catalog was synchronized successfully.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, }, @@ -3824,18 +3940,12 @@ func schema_pkg_apis_walruscore_v1_ConnectorBinding(ref common.ReferenceCallback Ref: ref("github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorBindingSpec"), }, }, - "status": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorBindingStatus"), - }, - }, }, Required: []string{"spec"}, }, }, Dependencies: []string{ - "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorBindingSpec", "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorBindingStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorBindingSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -3899,7 +4009,7 @@ func schema_pkg_apis_walruscore_v1_ConnectorBindingSpec(ref common.ReferenceCall SchemaProps: spec.SchemaProps{ Description: "Connector is the reference to the connector.", Default: map[string]interface{}{}, - Ref: ref("github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorReference"), + Ref: ref("github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorReferenceWithType"), }, }, }, @@ -3907,57 +4017,34 @@ func schema_pkg_apis_walruscore_v1_ConnectorBindingSpec(ref common.ReferenceCall }, }, Dependencies: []string{ - "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorReference"}, + "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorReferenceWithType"}, } } -func schema_pkg_apis_walruscore_v1_ConnectorBindingStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_walruscore_v1_ConnectorConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ConnectorBindingStatus defines the observed state of ConnectorBinding.", + Description: "ConnectorConfig defines the configuration of the Connector.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "Type": { - SchemaProps: spec.SchemaProps{ - Description: "Type is the type of the connector.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "Category": { + "version": { SchemaProps: spec.SchemaProps{ - Description: "Category is the category of the connector.\n\nPossible enum values:\n - `\"CloudProvider\"`\n - `\"Custom\"`\n - `\"Docker\"`\n - `\"Kubernetes\"`", + Description: "Version is the version of the configuration.", Default: "", Type: []string{"string"}, Format: "", - Enum: []interface{}{"CloudProvider", "Custom", "Docker", "Kubernetes"}, - }, - }, - }, - Required: []string{"Type", "Category"}, - }, - }, - } -} - -func schema_pkg_apis_walruscore_v1_ConnectorConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "version": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", }, }, "data": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-map-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, + Description: "Data holds the configuration entries.", + Type: []string{"object"}, AdditionalProperties: &spec.SchemaOrBool{ Allows: true, Schema: &spec.Schema{ @@ -3982,24 +4069,27 @@ func schema_pkg_apis_walruscore_v1_ConnectorConfigEntry(ref common.ReferenceCall return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, + Description: "ConnectorConfigEntry defines the configuration entry of the Connector.", + Type: []string{"object"}, Properties: map[string]spec.Schema{ - "value": { + "sensitive": { SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Description: "Sensitive indicates whether the entry is sensitive.", + Default: false, + Type: []string{"boolean"}, + Format: "", }, }, - "visible": { + "value": { SchemaProps: spec.SchemaProps{ - Default: false, - Type: []string{"boolean"}, - Format: "", + Description: "Value is the value of the configuration entry.\n\nWhen Sensitive is true, it is provided as a write-only input field, and returns \"(sensitive)\".", + Default: "", + Type: []string{"string"}, + Format: "", }, }, }, - Required: []string{"value", "visible"}, + Required: []string{"sensitive", "value"}, }, }, } @@ -4084,6 +4174,61 @@ func schema_pkg_apis_walruscore_v1_ConnectorReference(ref common.ReferenceCallba } } +func schema_pkg_apis_walruscore_v1_ConnectorReferenceWithType(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ConnectorReferenceWithType is a reference to a connector with its category and type.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name is the name of the connector.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "namespace": { + SchemaProps: spec.SchemaProps{ + Description: "Namespace is the namespace of the connector.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "category": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-validations": []interface{}{map[string]interface{}{"message": "immutable field", "rule": "oldSelf == self"}}, + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Category is the category of the connector.\n\nIf the Category is empty, the Category will be set to the category of the connector.\n\n\nPossible enum values:\n - `\"CloudProvider\"`\n - `\"Custom\"`\n - `\"Docker\"`\n - `\"Kubernetes\"`", + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"CloudProvider", "Custom", "Docker", "Kubernetes"}, + }, + }, + "type": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-validations": []interface{}{map[string]interface{}{"message": "immutable field", "rule": "oldSelf == self"}}, + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Type is the type of the connector.\n\nIf the Type is empty, the Type will be set to the type of the connector.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name", "namespace"}, + }, + }, + } +} + func schema_pkg_apis_walruscore_v1_ConnectorSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -4092,6 +4237,11 @@ func schema_pkg_apis_walruscore_v1_ConnectorSpec(ref common.ReferenceCallback) c Type: []string{"object"}, Properties: map[string]spec.Schema{ "applicableEnvironmentType": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-validations": []interface{}{map[string]interface{}{"message": "immutable field", "rule": "oldSelf == self"}}, + }, + }, SchemaProps: spec.SchemaProps{ Description: "ApplicableEnvironmentType is the environment type that the connector is applicable to.\n\n\nPossible enum values:\n - `\"Development\"` means the environment is for development.\n - `\"Production\"` means the environment is for production.\n - `\"Staging\"` means the environment is for staging.", Type: []string{"string"}, @@ -4100,6 +4250,11 @@ func schema_pkg_apis_walruscore_v1_ConnectorSpec(ref common.ReferenceCallback) c }, }, "category": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-validations": []interface{}{map[string]interface{}{"message": "immutable field", "rule": "oldSelf == self"}}, + }, + }, SchemaProps: spec.SchemaProps{ Description: "Category is the category of the connector.\n\n\nPossible enum values:\n - `\"CloudProvider\"`\n - `\"Custom\"`\n - `\"Docker\"`\n - `\"Kubernetes\"`", Default: "", @@ -4109,6 +4264,11 @@ func schema_pkg_apis_walruscore_v1_ConnectorSpec(ref common.ReferenceCallback) c }, }, "type": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-validations": []interface{}{map[string]interface{}{"message": "immutable field", "rule": "oldSelf == self"}}, + }, + }, SchemaProps: spec.SchemaProps{ Description: "Type is the type of the connector.", Default: "", @@ -4118,21 +4278,26 @@ func schema_pkg_apis_walruscore_v1_ConnectorSpec(ref common.ReferenceCallback) c }, "config": { SchemaProps: spec.SchemaProps{ - Description: "Config is the configuration of the connector.", + Description: "Config is the configuration of the connector.\n\nAny sensitive configuration entry will be erased before storing.", Default: map[string]interface{}{}, Ref: ref("github.com/seal-io/walrus/pkg/apis/walruscore/v1.ConnectorConfig"), }, }, - "description": { + "secretName": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-validations": []interface{}{map[string]interface{}{"message": "immutable field", "rule": "oldSelf == self"}}, + }, + }, SchemaProps: spec.SchemaProps{ - Description: "Description is the description of the connector.", + Description: "SecretName is the name of the secret that stores the Config.\n\nIf the secret name is not provided, a secret will be created to store the Config, otherwise, the Config will be stored in the secret with the provided name.", Type: []string{"string"}, Format: "", }, }, - "secretName": { + "description": { SchemaProps: spec.SchemaProps{ - Description: "SecretName is the auto-generated secret name for the connector configuration. Will be overridden if set.", + Description: "Description is the description of the connector.", Type: []string{"string"}, Format: "", }, @@ -4662,10 +4827,11 @@ func schema_pkg_apis_walruscore_v1_ResourceComponentsStatus(ref common.Reference Format: "", }, }, - "templateVersionReference": { + "template": { SchemaProps: spec.SchemaProps{ - Description: "TemplateVersion template version to which is used to create the resource components.", - Ref: ref("github.com/seal-io/walrus/pkg/apis/walruscore/v1.TempalteVersionReference"), + Description: "Template is the reference to the Template which to create the resource components, it must point to a specific version of the Template.", + Default: map[string]interface{}{}, + Ref: ref("github.com/seal-io/walrus/pkg/apis/walruscore/v1.TemplateReferenceWithVersion"), }, }, "computedAttributes": { @@ -4703,11 +4869,11 @@ func schema_pkg_apis_walruscore_v1_ResourceComponentsStatus(ref common.Reference }, }, }, - Required: []string{"project", "resource", "templateVersionReference", "computedAttributes", "components", "dependencies"}, + Required: []string{"project", "resource", "template", "computedAttributes", "components", "dependencies"}, }, }, Dependencies: []string{ - "github.com/seal-io/walrus/pkg/apis/walruscore/v1.Condition", "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ResourceComponent", "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ResourceComponentDependency", "github.com/seal-io/walrus/pkg/apis/walruscore/v1.TempalteVersionReference", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, + "github.com/seal-io/walrus/pkg/apis/walruscore/v1.Condition", "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ResourceComponent", "github.com/seal-io/walrus/pkg/apis/walruscore/v1.ResourceComponentDependency", "github.com/seal-io/walrus/pkg/apis/walruscore/v1.TemplateReferenceWithVersion", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, } } @@ -5446,23 +5612,19 @@ func schema_pkg_apis_walruscore_v1_ResourceRunSpec(ref common.ReferenceCallback) Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), }, }, - "templateVersionReference": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-validations": []interface{}{map[string]interface{}{"message": "immutable field", "rule": "oldSelf == self"}}, - }, - }, + "template": { SchemaProps: spec.SchemaProps{ - Description: "TemplateVersion template version to which the resource belongs.", - Ref: ref("github.com/seal-io/walrus/pkg/apis/walruscore/v1.TempalteVersionReference"), + Description: "Template is the reference to the Template which to create the resource components, it must point to a specific version of the Template.", + Default: map[string]interface{}{}, + Ref: ref("github.com/seal-io/walrus/pkg/apis/walruscore/v1.TemplateReferenceWithVersion"), }, }, }, - Required: []string{"project", "resource", "type", "attributes", "templateVersionReference"}, + Required: []string{"project", "resource", "type", "attributes", "template"}, }, }, Dependencies: []string{ - "github.com/seal-io/walrus/pkg/apis/walruscore/v1.TempalteVersionReference", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, + "github.com/seal-io/walrus/pkg/apis/walruscore/v1.TemplateReferenceWithVersion", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, } } @@ -6195,15 +6357,15 @@ func schema_pkg_apis_walruscore_v1_ResourceSpec(ref common.ReferenceCallback) co Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), }, }, - "templateVersionReference": { + "template": { SchemaProps: spec.SchemaProps{ - Description: "TemplateVersion template version to which the resource belongs.", - Ref: ref("github.com/seal-io/walrus/pkg/apis/walruscore/v1.TempalteVersionReference"), + Description: "Template is the reference to the Template which the resource used, it is able to pointed to a specific version of the Template.\n\nIf the version is not specified, the default version of the Template will be used.", + Ref: ref("github.com/seal-io/walrus/pkg/apis/walruscore/v1.TemplateReferenceWithVersion"), }, }, "type": { SchemaProps: spec.SchemaProps{ - Description: "Type is a resource definition type.", + Description: "Type is the type of the ResourceDefinition which the resource be.", Type: []string{"string"}, Format: "", }, @@ -6226,7 +6388,7 @@ func schema_pkg_apis_walruscore_v1_ResourceSpec(ref common.ReferenceCallback) co }, }, Dependencies: []string{ - "github.com/seal-io/walrus/pkg/apis/walruscore/v1.TempalteVersionReference", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, + "github.com/seal-io/walrus/pkg/apis/walruscore/v1.TemplateReferenceWithVersion", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, } } @@ -6512,40 +6674,6 @@ func schema_pkg_apis_walruscore_v1_StatusDescriptor(ref common.ReferenceCallback } } -func schema_pkg_apis_walruscore_v1_TempalteVersionReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "namespace": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"namespace", "name", "version"}, - }, - }, - } -} - func schema_pkg_apis_walruscore_v1_Template(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -6643,6 +6771,73 @@ func schema_pkg_apis_walruscore_v1_TemplateList(ref common.ReferenceCallback) co } } +func schema_pkg_apis_walruscore_v1_TemplateReference(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TemplateReference is a reference to a template.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "namespace": { + SchemaProps: spec.SchemaProps{ + Description: "Namespace is the namespace of the template.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name is the name of the template.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"namespace", "name"}, + }, + }, + } +} + +func schema_pkg_apis_walruscore_v1_TemplateReferenceWithVersion(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TemplateReferenceWithVersion is a reference to a template with a specific version.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "namespace": { + SchemaProps: spec.SchemaProps{ + Description: "Namespace is the namespace of the template.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name is the name of the template.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Version is a specific version of the template.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"namespace", "name"}, + }, + }, + } +} + func schema_pkg_apis_walruscore_v1_TemplateSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -6720,15 +6915,9 @@ func schema_pkg_apis_walruscore_v1_TemplateStatus(ref common.ReferenceCallback) }, }, }, - "lastSyncTime": { - SchemaProps: spec.SchemaProps{ - Description: "LastSyncTime record the last sync catalog time.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "originalName": { + "project": { SchemaProps: spec.SchemaProps{ - Description: "The original name of the template.", + Description: "Project is the project that the template belongs to.", Type: []string{"string"}, Format: "", }, @@ -6740,13 +6929,6 @@ func schema_pkg_apis_walruscore_v1_TemplateStatus(ref common.ReferenceCallback) Format: "", }, }, - "project": { - SchemaProps: spec.SchemaProps{ - Description: "Project is the project that the catalog belongs to.", - Type: []string{"string"}, - Format: "", - }, - }, "icon": { SchemaProps: spec.SchemaProps{ Description: "A URL to an SVG or PNG image to be used as an icon.", @@ -6768,6 +6950,12 @@ func schema_pkg_apis_walruscore_v1_TemplateStatus(ref common.ReferenceCallback) }, }, }, + "lastSuccessfulSyncTime": { + SchemaProps: spec.SchemaProps{ + Description: "LastSuccessfulSyncTime record the last sync time the template was synchronized successfully.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, }, }, }, diff --git a/pkg/apis/zz_generated.openapi.violation_exceptions b/pkg/apis/zz_generated.openapi.violation_exceptions index c1021bfa1..b428843b0 100644 --- a/pkg/apis/zz_generated.openapi.violation_exceptions +++ b/pkg/apis/zz_generated.openapi.violation_exceptions @@ -139,13 +139,8 @@ API rule violation: list_type_missing,k8s.io/apimachinery/pkg/apis/meta/v1,Updat API rule violation: names_match,github.com/seal-io/walrus/pkg/apis/walrus/v1,SubjectProviderExternalConfig,GitHub API rule violation: names_match,github.com/seal-io/walrus/pkg/apis/walrus/v1,SubjectProviderExternalConfig,GitLab API rule violation: names_match,github.com/seal-io/walrus/pkg/apis/walrus/v1,SubjectProviderExternalConfig,OAuth -API rule violation: names_match,github.com/seal-io/walrus/pkg/apis/walruscore/v1,ConnectorBindingStatus,Category -API rule violation: names_match,github.com/seal-io/walrus/pkg/apis/walruscore/v1,ConnectorBindingStatus,Type API rule violation: names_match,github.com/seal-io/walrus/pkg/apis/walruscore/v1,ResourceComponentsStatus,ResourceName -API rule violation: names_match,github.com/seal-io/walrus/pkg/apis/walruscore/v1,ResourceComponentsStatus,TemplateVersion API rule violation: names_match,github.com/seal-io/walrus/pkg/apis/walruscore/v1,ResourceRunSpec,ResourceName -API rule violation: names_match,github.com/seal-io/walrus/pkg/apis/walruscore/v1,ResourceRunSpec,TemplateVersion -API rule violation: names_match,github.com/seal-io/walrus/pkg/apis/walruscore/v1,ResourceSpec,TemplateVersion API rule violation: names_match,k8s.io/api/core/v1,AzureDiskVolumeSource,DataDiskURI API rule violation: names_match,k8s.io/api/core/v1,ContainerStatus,LastTerminationState API rule violation: names_match,k8s.io/api/core/v1,DaemonEndpoint,Port diff --git a/pkg/apistatus/catalog_status.go b/pkg/apistatus/catalog_status.go index d298293a6..e9e4612d5 100644 --- a/pkg/apistatus/catalog_status.go +++ b/pkg/apistatus/catalog_status.go @@ -3,42 +3,75 @@ package apistatus import "github.com/seal-io/walrus/pkg/apis/walruscore/v1" const ( - CatalogConditionReady v1.ConditionType = "Ready" - CatalogConditionRefresh v1.ConditionType = "Refresh" + CatalogConditionFetched v1.ConditionType = "Fetched" + CatalogConditionSyncedTemplates v1.ConditionType = "SyncedTemplates" + + CatalogConditionDeleting v1.ConditionType = "Deleting" ) const ( - CatalogConditionReasonPreparing = "Preparing" - CatalogConditionReasonError = "Error" + CatalogConditionFetchedReasonPartialFailed = "PartialFetchFailed" + CatalogConditionFetchedReasonAllFailed = "AllFetchFailed" + + CatalogConditionSyncedTemplatesReasonSyncing = "SyncingTemplates" + CatalogConditionSyncedTemplatesReasonFailed = "SyncTemplatesFailed" ) // catalogStatusPaths makes the following decision. // // | Condition Type | Condition Status | Human Readable Status | Human Sensible Status | // | ---------------- | ----------------------- | --------------------- | --------------------- | -// | Refresh | Unknown | Refreshing | Transitioning | -// | Refresh | False | / | / | -// | Refresh | True | / | / | -// | Ready | Unknown | Preparing | Transitioning | -// | Ready | False | NotReady | Interrupted | -// | Ready | True | Ready | | +// | Fetched | Unknown | Fetching | Transitioning | +// | Fetched | False | PartialFetchFailed | Interrupted | +// | Fetched | False | AllFetchFailed | Interrupted | +// | Fetched | True | Fetched | / | +// | SyncedTemplates | Unknown | SyncingTemplates | Transitioning | +// | SyncedTemplates | False | SyncTemplatesFailed | Interrupted | +// | SyncedTemplates | True | Ready | / | +// | Deleting | True | Deleting | Transitioning | var catalogStatusPaths = NewWalker( [][]v1.ConditionType{ { - CatalogConditionRefresh, - CatalogConditionReady, + CatalogConditionFetched, + CatalogConditionSyncedTemplates, + }, + { + CatalogConditionDeleting, }, }, func(d Decision[v1.ConditionType]) { - d.Make(CatalogConditionRefresh, + d.Make(CatalogConditionFetched, func(st v1.ConditionStatus, reason string) (string, string, Score) { switch st { default: - return "Refresh", "", SummaryScoreDone - case v1.ConditionUnknown: - return "Refreshing", "", SummaryScoreTransitioning + if reason == "" { + reason = "Fetching" + } + return reason, "", SummaryScoreTransitioning + case v1.ConditionFalse: + return reason, "", SummaryScoreInterrupted + case v1.ConditionTrue: + return "Fetched", "", SummaryScoreDone } }) + d.Make(CatalogConditionSyncedTemplates, + func(st v1.ConditionStatus, reason string) (string, string, Score) { + switch st { + default: + if reason == "" { + reason = "SyncingTemplates" + } + return reason, "", SummaryScoreTransitioning + case v1.ConditionFalse: + return reason, "", SummaryScoreInterrupted + case v1.ConditionTrue: + return "Ready", "", SummaryScoreDone + } + }) + d.Make(CatalogConditionDeleting, + func(st v1.ConditionStatus, reason string) (string, string, Score) { + return "Deleting", "", SummaryScoreTransitioning + }) }, ) diff --git a/pkg/apistatus/connector_status.go b/pkg/apistatus/connector_status.go index e884776b3..d8cba7acc 100644 --- a/pkg/apistatus/connector_status.go +++ b/pkg/apistatus/connector_status.go @@ -4,25 +4,36 @@ import v1 "github.com/seal-io/walrus/pkg/apis/walruscore/v1" const ( ConnectorConditionConnected v1.ConditionType = "Connected" + + ConnectorConditionDeleting v1.ConditionType = "Deleting" ) const ( - ConnectorConditionReasonConnecting = "Connecting" - ConnectorConditionReasonDisconnected = "Disconnected" + ConnectorConditionConnectedReasonFailed = "Disconnected" ) // connectorStatusPaths makes the following decision. // // | Condition Type | Condition Status | Human Readable Status | Human Sensible Status | -// | ---------------- | ----------------------- | --------------------- | --------------------- |\ +// | ---------------- | ----------------------- | --------------------- | --------------------- | // | Connected | Unknown | Connecting | Transitioning | -// | Connected | False | Disconnected | Error | -// | Connected | True | Connected | | +// | Connected | False | Disconnected | Interrupted | +// | Connected | True | Connected | / | +// | Deleting | True | Deleting | Transitioning | var connectorStatusPaths = NewWalker( [][]v1.ConditionType{ { ConnectorConditionConnected, }, + { + ConnectorConditionDeleting, + }, + }, + func(d Decision[v1.ConditionType]) { + d.Make(TemplateConditionDeleting, + func(st v1.ConditionStatus, reason string) (string, string, Score) { + return "Deleting", "", SummaryScoreTransitioning + }) }, ) diff --git a/pkg/apistatus/template_status.go b/pkg/apistatus/template_status.go index 06eaf4d26..dbf92bf1e 100644 --- a/pkg/apistatus/template_status.go +++ b/pkg/apistatus/template_status.go @@ -3,42 +3,51 @@ package apistatus import "github.com/seal-io/walrus/pkg/apis/walruscore/v1" const ( - TemplateConditionReady v1.ConditionType = "Ready" - TemplateConditionRefresh v1.ConditionType = "Refresh" + TemplateConditionSynced v1.ConditionType = "Synced" + + TemplateConditionDeleting v1.ConditionType = "Deleting" ) const ( - TemplateConditionReasonPreparing = "Preparing" - TemplateConditionReasonError = "Error" + TemplateConditionSyncedReasonFailed = "SyncFailed" ) // templateStatusPaths makes the following decision. // // | Condition Type | Condition Status | Human Readable Status | Human Sensible Status | // | ---------------- | ----------------------- | --------------------- | --------------------- | -// | Refresh | Unknown | Refreshing | Transitioning | -// | Refresh | False | / | / | -// | Refresh | True | / | / | -// | Ready | Unknown | Preparing | Transitioning | -// | Ready | False | NotReady | Interrupted | -// | Ready | True | Ready | | +// | Synced | Unknown | Syncing | Transitioning | +// | Synced | False | SyncFailed | Interrupted | +// | Synced | True | Ready | / | +// | Deleting | True | Deleting | Transitioning | var templateStatusPaths = NewWalker( [][]v1.ConditionType{ { - TemplateConditionRefresh, - TemplateConditionReady, + TemplateConditionSynced, + }, + { + TemplateConditionDeleting, }, }, func(d Decision[v1.ConditionType]) { - d.Make(TemplateConditionRefresh, + d.Make(TemplateConditionSynced, func(st v1.ConditionStatus, reason string) (string, string, Score) { switch st { default: - return "Refresh", "", SummaryScoreDone - case v1.ConditionUnknown: - return "Refreshing", "", SummaryScoreTransitioning + if reason == "" { + reason = "Syncing" + } + return reason, "", SummaryScoreTransitioning + case v1.ConditionFalse: + return reason, "", SummaryScoreInterrupted + case v1.ConditionTrue: + return "Ready", "", SummaryScoreDone } }) + d.Make(TemplateConditionDeleting, + func(st v1.ConditionStatus, reason string) (string, string, Score) { + return "Deleting", "", SummaryScoreTransitioning + }) }, ) diff --git a/pkg/apistatus/walker.go b/pkg/apistatus/walker.go index 01c37b167..a0f1029ae 100644 --- a/pkg/apistatus/walker.go +++ b/pkg/apistatus/walker.go @@ -60,7 +60,7 @@ func (ps paths[T]) Walk(st *walruscore.StatusDescriptor) *walruscore.ConditionSu r, rs = l, ls // Quit soon if found one highest result. - if rs == HighestSummaryScore { + if rs >= _HighestSummaryScore { break } } @@ -71,10 +71,11 @@ func (ps paths[T]) Walk(st *walruscore.StatusDescriptor) *walruscore.ConditionSu type Score int const ( - SummaryScoreDone Score = iota + _LowestSummaryScore Score = iota + SummaryScoreDone = iota SummaryScoreTransitioning SummaryScoreInterrupted - HighestSummaryScore = SummaryScoreInterrupted + _HighestSummaryScore = SummaryScoreInterrupted ) // ConditionSummary is the summary of conditions with score. @@ -136,6 +137,10 @@ func (f path[T]) Walk(st *walruscore.StatusDescriptor) *ConditionSummary { // Walk the path to configure the summary. for i := range f.steps { if stepsConditionIndex[i] == 0 { + if i == 0 { + // Give up the walk if the first step is not found. + return s + } // Not found step in the given status's condition list. continue } diff --git a/pkg/apistatus/walker_test.go b/pkg/apistatus/walker_test.go index 38ae8e35f..431f0396d 100644 --- a/pkg/apistatus/walker_test.go +++ b/pkg/apistatus/walker_test.go @@ -331,7 +331,7 @@ func TestWalker_multiple(t *testing.T) { }, Before: func(i *input) { // Remove deleted status and mark deployed status. - ExampleResourceStatusDeployed.Reset(i, "") + ExampleResourceStatusDeployed.Reset(i, "", "") }, }, expected: &walruscore.ConditionSummary{ diff --git a/pkg/clients/applyconfiguration/utils.go b/pkg/clients/applyconfiguration/utils.go index ab0208c9b..7ca811805 100644 --- a/pkg/clients/applyconfiguration/utils.go +++ b/pkg/clients/applyconfiguration/utils.go @@ -1294,14 +1294,14 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationwalruscorev1.ConnectorBindingApplyConfiguration{} case walruscorev1.SchemeGroupVersion.WithKind("ConnectorBindingSpec"): return &applyconfigurationwalruscorev1.ConnectorBindingSpecApplyConfiguration{} - case walruscorev1.SchemeGroupVersion.WithKind("ConnectorBindingStatus"): - return &applyconfigurationwalruscorev1.ConnectorBindingStatusApplyConfiguration{} case walruscorev1.SchemeGroupVersion.WithKind("ConnectorConfig"): return &applyconfigurationwalruscorev1.ConnectorConfigApplyConfiguration{} case walruscorev1.SchemeGroupVersion.WithKind("ConnectorConfigEntry"): return &applyconfigurationwalruscorev1.ConnectorConfigEntryApplyConfiguration{} case walruscorev1.SchemeGroupVersion.WithKind("ConnectorReference"): return &applyconfigurationwalruscorev1.ConnectorReferenceApplyConfiguration{} + case walruscorev1.SchemeGroupVersion.WithKind("ConnectorReferenceWithType"): + return &applyconfigurationwalruscorev1.ConnectorReferenceWithTypeApplyConfiguration{} case walruscorev1.SchemeGroupVersion.WithKind("ConnectorSpec"): return &applyconfigurationwalruscorev1.ConnectorSpecApplyConfiguration{} case walruscorev1.SchemeGroupVersion.WithKind("ConnectorStatus"): @@ -1374,10 +1374,12 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationwalruscorev1.SchemaStatusApplyConfiguration{} case walruscorev1.SchemeGroupVersion.WithKind("StatusDescriptor"): return &applyconfigurationwalruscorev1.StatusDescriptorApplyConfiguration{} - case walruscorev1.SchemeGroupVersion.WithKind("TempalteVersionReference"): - return &applyconfigurationwalruscorev1.TempalteVersionReferenceApplyConfiguration{} case walruscorev1.SchemeGroupVersion.WithKind("Template"): return &applyconfigurationwalruscorev1.TemplateApplyConfiguration{} + case walruscorev1.SchemeGroupVersion.WithKind("TemplateReference"): + return &applyconfigurationwalruscorev1.TemplateReferenceApplyConfiguration{} + case walruscorev1.SchemeGroupVersion.WithKind("TemplateReferenceWithVersion"): + return &applyconfigurationwalruscorev1.TemplateReferenceWithVersionApplyConfiguration{} case walruscorev1.SchemeGroupVersion.WithKind("TemplateSpec"): return &applyconfigurationwalruscorev1.TemplateSpecApplyConfiguration{} case walruscorev1.SchemeGroupVersion.WithKind("TemplateStatus"): diff --git a/pkg/clients/applyconfiguration/walrus/v1/connectorbinding.go b/pkg/clients/applyconfiguration/walrus/v1/connectorbinding.go index f906b6e08..f70bfa818 100644 --- a/pkg/clients/applyconfiguration/walrus/v1/connectorbinding.go +++ b/pkg/clients/applyconfiguration/walrus/v1/connectorbinding.go @@ -17,8 +17,7 @@ import ( type ConnectorBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *walruscorev1.ConnectorBindingSpecApplyConfiguration `json:"spec,omitempty"` - Status *walruscorev1.ConnectorBindingStatusApplyConfiguration `json:"status,omitempty"` + Spec *walruscorev1.ConnectorBindingSpecApplyConfiguration `json:"spec,omitempty"` } // ConnectorBinding constructs an declarative configuration of the ConnectorBinding type for use with @@ -197,11 +196,3 @@ func (b *ConnectorBindingApplyConfiguration) WithSpec(value *walruscorev1.Connec b.Spec = value return b } - -// WithStatus sets the Status field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Status field is set to the value of the last call. -func (b *ConnectorBindingApplyConfiguration) WithStatus(value *walruscorev1.ConnectorBindingStatusApplyConfiguration) *ConnectorBindingApplyConfiguration { - b.Status = value - return b -} diff --git a/pkg/clients/applyconfiguration/walruscore/v1/catalogspec.go b/pkg/clients/applyconfiguration/walruscore/v1/catalogspec.go index 7648de1d1..004b0fe5b 100644 --- a/pkg/clients/applyconfiguration/walruscore/v1/catalogspec.go +++ b/pkg/clients/applyconfiguration/walruscore/v1/catalogspec.go @@ -8,9 +8,9 @@ package v1 // CatalogSpecApplyConfiguration represents an declarative configuration of the CatalogSpec type for use // with apply. type CatalogSpecApplyConfiguration struct { + Description *string `json:"description,omitempty"` Builtin *bool `json:"builtin,omitempty"` TemplateFormat *string `json:"templateFormat,omitempty"` - Description *string `json:"description,omitempty"` Filters *FiltersApplyConfiguration `json:"filters,omitempty"` VCSSource *VCSSourceApplyConfiguration `json:"vcsSource,omitempty"` } @@ -21,6 +21,14 @@ func CatalogSpec() *CatalogSpecApplyConfiguration { return &CatalogSpecApplyConfiguration{} } +// WithDescription sets the Description field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Description field is set to the value of the last call. +func (b *CatalogSpecApplyConfiguration) WithDescription(value string) *CatalogSpecApplyConfiguration { + b.Description = &value + return b +} + // WithBuiltin sets the Builtin field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Builtin field is set to the value of the last call. @@ -37,14 +45,6 @@ func (b *CatalogSpecApplyConfiguration) WithTemplateFormat(value string) *Catalo return b } -// WithDescription sets the Description field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Description field is set to the value of the last call. -func (b *CatalogSpecApplyConfiguration) WithDescription(value string) *CatalogSpecApplyConfiguration { - b.Description = &value - return b -} - // WithFilters sets the Filters field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Filters field is set to the value of the last call. diff --git a/pkg/clients/applyconfiguration/walruscore/v1/catalogstatus.go b/pkg/clients/applyconfiguration/walruscore/v1/catalogstatus.go index f1b5177cb..0ead3c591 100644 --- a/pkg/clients/applyconfiguration/walruscore/v1/catalogstatus.go +++ b/pkg/clients/applyconfiguration/walruscore/v1/catalogstatus.go @@ -13,10 +13,10 @@ import ( // with apply. type CatalogStatusApplyConfiguration struct { StatusDescriptorApplyConfiguration `json:",inline"` - LastSyncTime *metav1.Time `json:"lastSyncTime,omitempty"` - TemplateCount *int64 `json:"templateCount,omitempty"` - URL *string `json:"url,omitempty"` Project *string `json:"project,omitempty"` + URL *string `json:"url,omitempty"` + TemplateCount *int64 `json:"templateCount,omitempty"` + LastSuccessfulSyncTime *metav1.Time `json:"lastSuccessfulSyncTime,omitempty"` } // CatalogStatusApplyConfiguration constructs an declarative configuration of the CatalogStatus type for use with @@ -54,19 +54,11 @@ func (b *CatalogStatusApplyConfiguration) WithConditions(values ...*ConditionApp return b } -// WithLastSyncTime sets the LastSyncTime field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the LastSyncTime field is set to the value of the last call. -func (b *CatalogStatusApplyConfiguration) WithLastSyncTime(value metav1.Time) *CatalogStatusApplyConfiguration { - b.LastSyncTime = &value - return b -} - -// WithTemplateCount sets the TemplateCount field in the declarative configuration to the given value +// WithProject sets the Project field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the TemplateCount field is set to the value of the last call. -func (b *CatalogStatusApplyConfiguration) WithTemplateCount(value int64) *CatalogStatusApplyConfiguration { - b.TemplateCount = &value +// If called multiple times, the Project field is set to the value of the last call. +func (b *CatalogStatusApplyConfiguration) WithProject(value string) *CatalogStatusApplyConfiguration { + b.Project = &value return b } @@ -78,10 +70,18 @@ func (b *CatalogStatusApplyConfiguration) WithURL(value string) *CatalogStatusAp return b } -// WithProject sets the Project field in the declarative configuration to the given value +// WithTemplateCount sets the TemplateCount field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Project field is set to the value of the last call. -func (b *CatalogStatusApplyConfiguration) WithProject(value string) *CatalogStatusApplyConfiguration { - b.Project = &value +// If called multiple times, the TemplateCount field is set to the value of the last call. +func (b *CatalogStatusApplyConfiguration) WithTemplateCount(value int64) *CatalogStatusApplyConfiguration { + b.TemplateCount = &value + return b +} + +// WithLastSuccessfulSyncTime sets the LastSuccessfulSyncTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastSuccessfulSyncTime field is set to the value of the last call. +func (b *CatalogStatusApplyConfiguration) WithLastSuccessfulSyncTime(value metav1.Time) *CatalogStatusApplyConfiguration { + b.LastSuccessfulSyncTime = &value return b } diff --git a/pkg/clients/applyconfiguration/walruscore/v1/connectorbinding.go b/pkg/clients/applyconfiguration/walruscore/v1/connectorbinding.go index 6e42c828c..8f4aa79b4 100644 --- a/pkg/clients/applyconfiguration/walruscore/v1/connectorbinding.go +++ b/pkg/clients/applyconfiguration/walruscore/v1/connectorbinding.go @@ -16,8 +16,7 @@ import ( type ConnectorBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *ConnectorBindingSpecApplyConfiguration `json:"spec,omitempty"` - Status *ConnectorBindingStatusApplyConfiguration `json:"status,omitempty"` + Spec *ConnectorBindingSpecApplyConfiguration `json:"spec,omitempty"` } // ConnectorBinding constructs an declarative configuration of the ConnectorBinding type for use with @@ -196,11 +195,3 @@ func (b *ConnectorBindingApplyConfiguration) WithSpec(value *ConnectorBindingSpe b.Spec = value return b } - -// WithStatus sets the Status field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Status field is set to the value of the last call. -func (b *ConnectorBindingApplyConfiguration) WithStatus(value *ConnectorBindingStatusApplyConfiguration) *ConnectorBindingApplyConfiguration { - b.Status = value - return b -} diff --git a/pkg/clients/applyconfiguration/walruscore/v1/connectorbindingspec.go b/pkg/clients/applyconfiguration/walruscore/v1/connectorbindingspec.go index 50af0b261..ff717b1c0 100644 --- a/pkg/clients/applyconfiguration/walruscore/v1/connectorbindingspec.go +++ b/pkg/clients/applyconfiguration/walruscore/v1/connectorbindingspec.go @@ -8,7 +8,7 @@ package v1 // ConnectorBindingSpecApplyConfiguration represents an declarative configuration of the ConnectorBindingSpec type for use // with apply. type ConnectorBindingSpecApplyConfiguration struct { - Connector *ConnectorReferenceApplyConfiguration `json:"connector,omitempty"` + Connector *ConnectorReferenceWithTypeApplyConfiguration `json:"connector,omitempty"` } // ConnectorBindingSpecApplyConfiguration constructs an declarative configuration of the ConnectorBindingSpec type for use with @@ -20,7 +20,7 @@ func ConnectorBindingSpec() *ConnectorBindingSpecApplyConfiguration { // WithConnector sets the Connector field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Connector field is set to the value of the last call. -func (b *ConnectorBindingSpecApplyConfiguration) WithConnector(value *ConnectorReferenceApplyConfiguration) *ConnectorBindingSpecApplyConfiguration { +func (b *ConnectorBindingSpecApplyConfiguration) WithConnector(value *ConnectorReferenceWithTypeApplyConfiguration) *ConnectorBindingSpecApplyConfiguration { b.Connector = value return b } diff --git a/pkg/clients/applyconfiguration/walruscore/v1/connectorbindingstatus.go b/pkg/clients/applyconfiguration/walruscore/v1/connectorbindingstatus.go deleted file mode 100644 index 5afb0eb9e..000000000 --- a/pkg/clients/applyconfiguration/walruscore/v1/connectorbindingstatus.go +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-FileCopyrightText: 2024 Seal, Inc -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by "walrus", DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/seal-io/walrus/pkg/apis/walruscore/v1" -) - -// ConnectorBindingStatusApplyConfiguration represents an declarative configuration of the ConnectorBindingStatus type for use -// with apply. -type ConnectorBindingStatusApplyConfiguration struct { - Type *string `json:"Type,omitempty"` - Category *v1.ConnectorCategory `json:"Category,omitempty"` -} - -// ConnectorBindingStatusApplyConfiguration constructs an declarative configuration of the ConnectorBindingStatus type for use with -// apply. -func ConnectorBindingStatus() *ConnectorBindingStatusApplyConfiguration { - return &ConnectorBindingStatusApplyConfiguration{} -} - -// WithType sets the Type field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Type field is set to the value of the last call. -func (b *ConnectorBindingStatusApplyConfiguration) WithType(value string) *ConnectorBindingStatusApplyConfiguration { - b.Type = &value - return b -} - -// WithCategory sets the Category field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Category field is set to the value of the last call. -func (b *ConnectorBindingStatusApplyConfiguration) WithCategory(value v1.ConnectorCategory) *ConnectorBindingStatusApplyConfiguration { - b.Category = &value - return b -} diff --git a/pkg/clients/applyconfiguration/walruscore/v1/connectorconfigentry.go b/pkg/clients/applyconfiguration/walruscore/v1/connectorconfigentry.go index 171f175f4..e7a2327fb 100644 --- a/pkg/clients/applyconfiguration/walruscore/v1/connectorconfigentry.go +++ b/pkg/clients/applyconfiguration/walruscore/v1/connectorconfigentry.go @@ -8,8 +8,8 @@ package v1 // ConnectorConfigEntryApplyConfiguration represents an declarative configuration of the ConnectorConfigEntry type for use // with apply. type ConnectorConfigEntryApplyConfiguration struct { - Value *string `json:"value,omitempty"` - Visible *bool `json:"visible,omitempty"` + Sensitive *bool `json:"sensitive,omitempty"` + Value *string `json:"value,omitempty"` } // ConnectorConfigEntryApplyConfiguration constructs an declarative configuration of the ConnectorConfigEntry type for use with @@ -18,18 +18,18 @@ func ConnectorConfigEntry() *ConnectorConfigEntryApplyConfiguration { return &ConnectorConfigEntryApplyConfiguration{} } -// WithValue sets the Value field in the declarative configuration to the given value +// WithSensitive sets the Sensitive field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Value field is set to the value of the last call. -func (b *ConnectorConfigEntryApplyConfiguration) WithValue(value string) *ConnectorConfigEntryApplyConfiguration { - b.Value = &value +// If called multiple times, the Sensitive field is set to the value of the last call. +func (b *ConnectorConfigEntryApplyConfiguration) WithSensitive(value bool) *ConnectorConfigEntryApplyConfiguration { + b.Sensitive = &value return b } -// WithVisible sets the Visible field in the declarative configuration to the given value +// WithValue sets the Value field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Visible field is set to the value of the last call. -func (b *ConnectorConfigEntryApplyConfiguration) WithVisible(value bool) *ConnectorConfigEntryApplyConfiguration { - b.Visible = &value +// If called multiple times, the Value field is set to the value of the last call. +func (b *ConnectorConfigEntryApplyConfiguration) WithValue(value string) *ConnectorConfigEntryApplyConfiguration { + b.Value = &value return b } diff --git a/pkg/clients/applyconfiguration/walruscore/v1/connectorreferencewithtype.go b/pkg/clients/applyconfiguration/walruscore/v1/connectorreferencewithtype.go new file mode 100644 index 000000000..d830fa24b --- /dev/null +++ b/pkg/clients/applyconfiguration/walruscore/v1/connectorreferencewithtype.go @@ -0,0 +1,56 @@ +// SPDX-FileCopyrightText: 2024 Seal, Inc +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by "walrus", DO NOT EDIT. + +package v1 + +import ( + walruscorev1 "github.com/seal-io/walrus/pkg/apis/walruscore/v1" +) + +// ConnectorReferenceWithTypeApplyConfiguration represents an declarative configuration of the ConnectorReferenceWithType type for use +// with apply. +type ConnectorReferenceWithTypeApplyConfiguration struct { + ConnectorReferenceApplyConfiguration `json:",inline"` + Category *walruscorev1.ConnectorCategory `json:"category,omitempty"` + Type *string `json:"type,omitempty"` +} + +// ConnectorReferenceWithTypeApplyConfiguration constructs an declarative configuration of the ConnectorReferenceWithType type for use with +// apply. +func ConnectorReferenceWithType() *ConnectorReferenceWithTypeApplyConfiguration { + return &ConnectorReferenceWithTypeApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ConnectorReferenceWithTypeApplyConfiguration) WithName(value string) *ConnectorReferenceWithTypeApplyConfiguration { + b.Name = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ConnectorReferenceWithTypeApplyConfiguration) WithNamespace(value string) *ConnectorReferenceWithTypeApplyConfiguration { + b.Namespace = &value + return b +} + +// WithCategory sets the Category field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Category field is set to the value of the last call. +func (b *ConnectorReferenceWithTypeApplyConfiguration) WithCategory(value walruscorev1.ConnectorCategory) *ConnectorReferenceWithTypeApplyConfiguration { + b.Category = &value + return b +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *ConnectorReferenceWithTypeApplyConfiguration) WithType(value string) *ConnectorReferenceWithTypeApplyConfiguration { + b.Type = &value + return b +} diff --git a/pkg/clients/applyconfiguration/walruscore/v1/connectorspec.go b/pkg/clients/applyconfiguration/walruscore/v1/connectorspec.go index 5e9ca5159..9b70bd58d 100644 --- a/pkg/clients/applyconfiguration/walruscore/v1/connectorspec.go +++ b/pkg/clients/applyconfiguration/walruscore/v1/connectorspec.go @@ -16,8 +16,8 @@ type ConnectorSpecApplyConfiguration struct { Category *v1.ConnectorCategory `json:"category,omitempty"` Type *string `json:"type,omitempty"` Config *ConnectorConfigApplyConfiguration `json:"config,omitempty"` - Description *string `json:"description,omitempty"` SecretName *string `json:"secretName,omitempty"` + Description *string `json:"description,omitempty"` } // ConnectorSpecApplyConfiguration constructs an declarative configuration of the ConnectorSpec type for use with @@ -58,14 +58,6 @@ func (b *ConnectorSpecApplyConfiguration) WithConfig(value *ConnectorConfigApply return b } -// WithDescription sets the Description field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Description field is set to the value of the last call. -func (b *ConnectorSpecApplyConfiguration) WithDescription(value string) *ConnectorSpecApplyConfiguration { - b.Description = &value - return b -} - // WithSecretName sets the SecretName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the SecretName field is set to the value of the last call. @@ -73,3 +65,11 @@ func (b *ConnectorSpecApplyConfiguration) WithSecretName(value string) *Connecto b.SecretName = &value return b } + +// WithDescription sets the Description field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Description field is set to the value of the last call. +func (b *ConnectorSpecApplyConfiguration) WithDescription(value string) *ConnectorSpecApplyConfiguration { + b.Description = &value + return b +} diff --git a/pkg/clients/applyconfiguration/walruscore/v1/resourcecomponentsstatus.go b/pkg/clients/applyconfiguration/walruscore/v1/resourcecomponentsstatus.go index 2d61576c8..bc62341be 100644 --- a/pkg/clients/applyconfiguration/walruscore/v1/resourcecomponentsstatus.go +++ b/pkg/clients/applyconfiguration/walruscore/v1/resourcecomponentsstatus.go @@ -15,7 +15,7 @@ type ResourceComponentsStatusApplyConfiguration struct { StatusDescriptorApplyConfiguration `json:",inline"` Project *string `json:"project,omitempty"` ResourceName *string `json:"resource,omitempty"` - TemplateVersion *TempalteVersionReferenceApplyConfiguration `json:"templateVersionReference,omitempty"` + Template *TemplateReferenceWithVersionApplyConfiguration `json:"template,omitempty"` ComputedAttributes *runtime.RawExtension `json:"computedAttributes,omitempty"` Components []ResourceComponentApplyConfiguration `json:"components,omitempty"` Dependencies []ResourceComponentDependencyApplyConfiguration `json:"dependencies,omitempty"` @@ -72,11 +72,11 @@ func (b *ResourceComponentsStatusApplyConfiguration) WithResourceName(value stri return b } -// WithTemplateVersion sets the TemplateVersion field in the declarative configuration to the given value +// WithTemplate sets the Template field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the TemplateVersion field is set to the value of the last call. -func (b *ResourceComponentsStatusApplyConfiguration) WithTemplateVersion(value *TempalteVersionReferenceApplyConfiguration) *ResourceComponentsStatusApplyConfiguration { - b.TemplateVersion = value +// If called multiple times, the Template field is set to the value of the last call. +func (b *ResourceComponentsStatusApplyConfiguration) WithTemplate(value *TemplateReferenceWithVersionApplyConfiguration) *ResourceComponentsStatusApplyConfiguration { + b.Template = value return b } diff --git a/pkg/clients/applyconfiguration/walruscore/v1/resourcerunspec.go b/pkg/clients/applyconfiguration/walruscore/v1/resourcerunspec.go index 3e32f0156..9d54ec8ba 100644 --- a/pkg/clients/applyconfiguration/walruscore/v1/resourcerunspec.go +++ b/pkg/clients/applyconfiguration/walruscore/v1/resourcerunspec.go @@ -13,11 +13,11 @@ import ( // ResourceRunSpecApplyConfiguration represents an declarative configuration of the ResourceRunSpec type for use // with apply. type ResourceRunSpecApplyConfiguration struct { - Project *string `json:"project,omitempty"` - ResourceName *string `json:"resource,omitempty"` - Type *v1.ResourceRunType `json:"type,omitempty"` - Attributes *runtime.RawExtension `json:"attributes,omitempty"` - TemplateVersion *TempalteVersionReferenceApplyConfiguration `json:"templateVersionReference,omitempty"` + Project *string `json:"project,omitempty"` + ResourceName *string `json:"resource,omitempty"` + Type *v1.ResourceRunType `json:"type,omitempty"` + Attributes *runtime.RawExtension `json:"attributes,omitempty"` + Template *TemplateReferenceWithVersionApplyConfiguration `json:"template,omitempty"` } // ResourceRunSpecApplyConfiguration constructs an declarative configuration of the ResourceRunSpec type for use with @@ -58,10 +58,10 @@ func (b *ResourceRunSpecApplyConfiguration) WithAttributes(value runtime.RawExte return b } -// WithTemplateVersion sets the TemplateVersion field in the declarative configuration to the given value +// WithTemplate sets the Template field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the TemplateVersion field is set to the value of the last call. -func (b *ResourceRunSpecApplyConfiguration) WithTemplateVersion(value *TempalteVersionReferenceApplyConfiguration) *ResourceRunSpecApplyConfiguration { - b.TemplateVersion = value +// If called multiple times, the Template field is set to the value of the last call. +func (b *ResourceRunSpecApplyConfiguration) WithTemplate(value *TemplateReferenceWithVersionApplyConfiguration) *ResourceRunSpecApplyConfiguration { + b.Template = value return b } diff --git a/pkg/clients/applyconfiguration/walruscore/v1/resourcespec.go b/pkg/clients/applyconfiguration/walruscore/v1/resourcespec.go index 3bd2e6a19..3df6e4aab 100644 --- a/pkg/clients/applyconfiguration/walruscore/v1/resourcespec.go +++ b/pkg/clients/applyconfiguration/walruscore/v1/resourcespec.go @@ -12,11 +12,11 @@ import ( // ResourceSpecApplyConfiguration represents an declarative configuration of the ResourceSpec type for use // with apply. type ResourceSpecApplyConfiguration struct { - Attributes *runtime.RawExtension `json:"attributes,omitempty"` - TemplateVersion *TempalteVersionReferenceApplyConfiguration `json:"templateVersionReference,omitempty"` - Type *string `json:"type,omitempty"` - Draft *bool `json:"draft,omitempty"` - Stop *bool `json:"stop,omitempty"` + Attributes *runtime.RawExtension `json:"attributes,omitempty"` + Template *TemplateReferenceWithVersionApplyConfiguration `json:"template,omitempty"` + Type *string `json:"type,omitempty"` + Draft *bool `json:"draft,omitempty"` + Stop *bool `json:"stop,omitempty"` } // ResourceSpecApplyConfiguration constructs an declarative configuration of the ResourceSpec type for use with @@ -33,11 +33,11 @@ func (b *ResourceSpecApplyConfiguration) WithAttributes(value runtime.RawExtensi return b } -// WithTemplateVersion sets the TemplateVersion field in the declarative configuration to the given value +// WithTemplate sets the Template field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the TemplateVersion field is set to the value of the last call. -func (b *ResourceSpecApplyConfiguration) WithTemplateVersion(value *TempalteVersionReferenceApplyConfiguration) *ResourceSpecApplyConfiguration { - b.TemplateVersion = value +// If called multiple times, the Template field is set to the value of the last call. +func (b *ResourceSpecApplyConfiguration) WithTemplate(value *TemplateReferenceWithVersionApplyConfiguration) *ResourceSpecApplyConfiguration { + b.Template = value return b } diff --git a/pkg/clients/applyconfiguration/walruscore/v1/templatereference.go b/pkg/clients/applyconfiguration/walruscore/v1/templatereference.go new file mode 100644 index 000000000..f1d26f2c5 --- /dev/null +++ b/pkg/clients/applyconfiguration/walruscore/v1/templatereference.go @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: 2024 Seal, Inc +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by "walrus", DO NOT EDIT. + +package v1 + +// TemplateReferenceApplyConfiguration represents an declarative configuration of the TemplateReference type for use +// with apply. +type TemplateReferenceApplyConfiguration struct { + Namespace *string `json:"namespace,omitempty"` + Name *string `json:"name,omitempty"` +} + +// TemplateReferenceApplyConfiguration constructs an declarative configuration of the TemplateReference type for use with +// apply. +func TemplateReference() *TemplateReferenceApplyConfiguration { + return &TemplateReferenceApplyConfiguration{} +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *TemplateReferenceApplyConfiguration) WithNamespace(value string) *TemplateReferenceApplyConfiguration { + b.Namespace = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *TemplateReferenceApplyConfiguration) WithName(value string) *TemplateReferenceApplyConfiguration { + b.Name = &value + return b +} diff --git a/pkg/clients/applyconfiguration/walruscore/v1/tempalteversionreference.go b/pkg/clients/applyconfiguration/walruscore/v1/templatereferencewithversion.go similarity index 51% rename from pkg/clients/applyconfiguration/walruscore/v1/tempalteversionreference.go rename to pkg/clients/applyconfiguration/walruscore/v1/templatereferencewithversion.go index 1bc5dcfda..509908032 100644 --- a/pkg/clients/applyconfiguration/walruscore/v1/tempalteversionreference.go +++ b/pkg/clients/applyconfiguration/walruscore/v1/templatereferencewithversion.go @@ -5,24 +5,23 @@ package v1 -// TempalteVersionReferenceApplyConfiguration represents an declarative configuration of the TempalteVersionReference type for use +// TemplateReferenceWithVersionApplyConfiguration represents an declarative configuration of the TemplateReferenceWithVersion type for use // with apply. -type TempalteVersionReferenceApplyConfiguration struct { - Namespace *string `json:"namespace,omitempty"` - Name *string `json:"name,omitempty"` - Version *string `json:"version,omitempty"` +type TemplateReferenceWithVersionApplyConfiguration struct { + TemplateReferenceApplyConfiguration `json:",inline"` + Version *string `json:"version,omitempty"` } -// TempalteVersionReferenceApplyConfiguration constructs an declarative configuration of the TempalteVersionReference type for use with +// TemplateReferenceWithVersionApplyConfiguration constructs an declarative configuration of the TemplateReferenceWithVersion type for use with // apply. -func TempalteVersionReference() *TempalteVersionReferenceApplyConfiguration { - return &TempalteVersionReferenceApplyConfiguration{} +func TemplateReferenceWithVersion() *TemplateReferenceWithVersionApplyConfiguration { + return &TemplateReferenceWithVersionApplyConfiguration{} } // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. -func (b *TempalteVersionReferenceApplyConfiguration) WithNamespace(value string) *TempalteVersionReferenceApplyConfiguration { +func (b *TemplateReferenceWithVersionApplyConfiguration) WithNamespace(value string) *TemplateReferenceWithVersionApplyConfiguration { b.Namespace = &value return b } @@ -30,7 +29,7 @@ func (b *TempalteVersionReferenceApplyConfiguration) WithNamespace(value string) // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. -func (b *TempalteVersionReferenceApplyConfiguration) WithName(value string) *TempalteVersionReferenceApplyConfiguration { +func (b *TemplateReferenceWithVersionApplyConfiguration) WithName(value string) *TemplateReferenceWithVersionApplyConfiguration { b.Name = &value return b } @@ -38,7 +37,7 @@ func (b *TempalteVersionReferenceApplyConfiguration) WithName(value string) *Tem // WithVersion sets the Version field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Version field is set to the value of the last call. -func (b *TempalteVersionReferenceApplyConfiguration) WithVersion(value string) *TempalteVersionReferenceApplyConfiguration { +func (b *TemplateReferenceWithVersionApplyConfiguration) WithVersion(value string) *TemplateReferenceWithVersionApplyConfiguration { b.Version = &value return b } diff --git a/pkg/clients/applyconfiguration/walruscore/v1/templatestatus.go b/pkg/clients/applyconfiguration/walruscore/v1/templatestatus.go index 17c51abef..2e62523f6 100644 --- a/pkg/clients/applyconfiguration/walruscore/v1/templatestatus.go +++ b/pkg/clients/applyconfiguration/walruscore/v1/templatestatus.go @@ -13,12 +13,11 @@ import ( // with apply. type TemplateStatusApplyConfiguration struct { StatusDescriptorApplyConfiguration `json:",inline"` - LastSyncTime *metav1.Time `json:"lastSyncTime,omitempty"` - OriginalName *string `json:"originalName,omitempty"` - URL *string `json:"url,omitempty"` Project *string `json:"project,omitempty"` + URL *string `json:"url,omitempty"` Icon *string `json:"icon,omitempty"` Versions []TemplateVersionApplyConfiguration `json:"versions,omitempty"` + LastSuccessfulSyncTime *metav1.Time `json:"lastSuccessfulSyncTime,omitempty"` } // TemplateStatusApplyConfiguration constructs an declarative configuration of the TemplateStatus type for use with @@ -56,19 +55,11 @@ func (b *TemplateStatusApplyConfiguration) WithConditions(values ...*ConditionAp return b } -// WithLastSyncTime sets the LastSyncTime field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the LastSyncTime field is set to the value of the last call. -func (b *TemplateStatusApplyConfiguration) WithLastSyncTime(value metav1.Time) *TemplateStatusApplyConfiguration { - b.LastSyncTime = &value - return b -} - -// WithOriginalName sets the OriginalName field in the declarative configuration to the given value +// WithProject sets the Project field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the OriginalName field is set to the value of the last call. -func (b *TemplateStatusApplyConfiguration) WithOriginalName(value string) *TemplateStatusApplyConfiguration { - b.OriginalName = &value +// If called multiple times, the Project field is set to the value of the last call. +func (b *TemplateStatusApplyConfiguration) WithProject(value string) *TemplateStatusApplyConfiguration { + b.Project = &value return b } @@ -80,14 +71,6 @@ func (b *TemplateStatusApplyConfiguration) WithURL(value string) *TemplateStatus return b } -// WithProject sets the Project field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Project field is set to the value of the last call. -func (b *TemplateStatusApplyConfiguration) WithProject(value string) *TemplateStatusApplyConfiguration { - b.Project = &value - return b -} - // WithIcon sets the Icon field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Icon field is set to the value of the last call. @@ -108,3 +91,11 @@ func (b *TemplateStatusApplyConfiguration) WithVersions(values ...*TemplateVersi } return b } + +// WithLastSuccessfulSyncTime sets the LastSuccessfulSyncTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastSuccessfulSyncTime field is set to the value of the last call. +func (b *TemplateStatusApplyConfiguration) WithLastSuccessfulSyncTime(value metav1.Time) *TemplateStatusApplyConfiguration { + b.LastSuccessfulSyncTime = &value + return b +} diff --git a/pkg/clients/clientset/typed/walrus/v1/connector.go b/pkg/clients/clientset/typed/walrus/v1/connector.go index 9bd4c1be5..5a4c25235 100644 --- a/pkg/clients/clientset/typed/walrus/v1/connector.go +++ b/pkg/clients/clientset/typed/walrus/v1/connector.go @@ -39,6 +39,8 @@ type ConnectorInterface interface { Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Connector, err error) Apply(ctx context.Context, connector *walrusv1.ConnectorApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Connector, err error) ApplyStatus(ctx context.Context, connector *walrusv1.ConnectorApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Connector, err error) + GetConfig(ctx context.Context, connectorName string, options metav1.GetOptions) (*v1.ConnectorConfig, error) + ConnectorExpansion } @@ -241,3 +243,17 @@ func (c *connectors) ApplyStatus(ctx context.Context, connector *walrusv1.Connec Into(result) return } + +// GetConfig takes name of the connector, and returns the corresponding v1.ConnectorConfig object, and an error if there is any. +func (c *connectors) GetConfig(ctx context.Context, connectorName string, options metav1.GetOptions) (result *v1.ConnectorConfig, err error) { + result = &v1.ConnectorConfig{} + err = c.client.Get(). + Namespace(c.ns). + Resource("connectors"). + Name(connectorName). + SubResource("config"). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} diff --git a/pkg/clients/clientset/typed/walrus/v1/connectorbinding.go b/pkg/clients/clientset/typed/walrus/v1/connectorbinding.go index 8c57b67af..501fbb5d1 100644 --- a/pkg/clients/clientset/typed/walrus/v1/connectorbinding.go +++ b/pkg/clients/clientset/typed/walrus/v1/connectorbinding.go @@ -30,7 +30,6 @@ type ConnectorBindingsGetter interface { type ConnectorBindingInterface interface { Create(ctx context.Context, connectorBinding *v1.ConnectorBinding, opts metav1.CreateOptions) (*v1.ConnectorBinding, error) Update(ctx context.Context, connectorBinding *v1.ConnectorBinding, opts metav1.UpdateOptions) (*v1.ConnectorBinding, error) - UpdateStatus(ctx context.Context, connectorBinding *v1.ConnectorBinding, opts metav1.UpdateOptions) (*v1.ConnectorBinding, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ConnectorBinding, error) @@ -38,7 +37,6 @@ type ConnectorBindingInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ConnectorBinding, err error) Apply(ctx context.Context, connectorBinding *walrusv1.ConnectorBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ConnectorBinding, err error) - ApplyStatus(ctx context.Context, connectorBinding *walrusv1.ConnectorBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ConnectorBinding, err error) ConnectorBindingExpansion } @@ -128,22 +126,6 @@ func (c *connectorBindings) Update(ctx context.Context, connectorBinding *v1.Con return } -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *connectorBindings) UpdateStatus(ctx context.Context, connectorBinding *v1.ConnectorBinding, opts metav1.UpdateOptions) (result *v1.ConnectorBinding, err error) { - result = &v1.ConnectorBinding{} - err = c.client.Put(). - Namespace(c.ns). - Resource("connectorbindings"). - Name(connectorBinding.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(connectorBinding). - Do(ctx). - Into(result) - return -} - // Delete takes name of the connectorBinding and deletes it. Returns an error if one occurs. func (c *connectorBindings) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). @@ -211,33 +193,3 @@ func (c *connectorBindings) Apply(ctx context.Context, connectorBinding *walrusv Into(result) return } - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *connectorBindings) ApplyStatus(ctx context.Context, connectorBinding *walrusv1.ConnectorBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ConnectorBinding, err error) { - if connectorBinding == nil { - return nil, fmt.Errorf("connectorBinding provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(connectorBinding) - if err != nil { - return nil, err - } - - name := connectorBinding.Name - if name == nil { - return nil, fmt.Errorf("connectorBinding.Name must be provided to Apply") - } - - result = &v1.ConnectorBinding{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("connectorbindings"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clients/clientset/typed/walrus/v1/fake/fake_connector.go b/pkg/clients/clientset/typed/walrus/v1/fake/fake_connector.go index d4d24036c..3f8167b19 100644 --- a/pkg/clients/clientset/typed/walrus/v1/fake/fake_connector.go +++ b/pkg/clients/clientset/typed/walrus/v1/fake/fake_connector.go @@ -174,3 +174,14 @@ func (c *FakeConnectors) ApplyStatus(ctx context.Context, connector *walrusv1.Co } return obj.(*v1.Connector), err } + +// GetConfig takes name of the connector, and returns the corresponding connectorConfig object, and an error if there is any. +func (c *FakeConnectors) GetConfig(ctx context.Context, connectorName string, options metav1.GetOptions) (result *v1.ConnectorConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetSubresourceAction(connectorsResource, c.ns, "config", connectorName), &v1.ConnectorConfig{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.ConnectorConfig), err +} diff --git a/pkg/clients/clientset/typed/walrus/v1/fake/fake_connectorbinding.go b/pkg/clients/clientset/typed/walrus/v1/fake/fake_connectorbinding.go index 3d5eb9b8a..9ced0ffd4 100644 --- a/pkg/clients/clientset/typed/walrus/v1/fake/fake_connectorbinding.go +++ b/pkg/clients/clientset/typed/walrus/v1/fake/fake_connectorbinding.go @@ -91,18 +91,6 @@ func (c *FakeConnectorBindings) Update(ctx context.Context, connectorBinding *v1 return obj.(*v1.ConnectorBinding), err } -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeConnectorBindings) UpdateStatus(ctx context.Context, connectorBinding *v1.ConnectorBinding, opts metav1.UpdateOptions) (*v1.ConnectorBinding, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(connectorbindingsResource, "status", c.ns, connectorBinding), &v1.ConnectorBinding{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.ConnectorBinding), err -} - // Delete takes name of the connectorBinding and deletes it. Returns an error if one occurs. func (c *FakeConnectorBindings) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. @@ -151,26 +139,3 @@ func (c *FakeConnectorBindings) Apply(ctx context.Context, connectorBinding *wal } return obj.(*v1.ConnectorBinding), err } - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeConnectorBindings) ApplyStatus(ctx context.Context, connectorBinding *walrusv1.ConnectorBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ConnectorBinding, err error) { - if connectorBinding == nil { - return nil, fmt.Errorf("connectorBinding provided to Apply must not be nil") - } - data, err := json.Marshal(connectorBinding) - if err != nil { - return nil, err - } - name := connectorBinding.Name - if name == nil { - return nil, fmt.Errorf("connectorBinding.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(connectorbindingsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.ConnectorBinding{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.ConnectorBinding), err -} diff --git a/pkg/clients/clientset/typed/walruscore/v1/connectorbinding.go b/pkg/clients/clientset/typed/walruscore/v1/connectorbinding.go index cc9533b77..f53d938ed 100644 --- a/pkg/clients/clientset/typed/walruscore/v1/connectorbinding.go +++ b/pkg/clients/clientset/typed/walruscore/v1/connectorbinding.go @@ -30,7 +30,6 @@ type ConnectorBindingsGetter interface { type ConnectorBindingInterface interface { Create(ctx context.Context, connectorBinding *v1.ConnectorBinding, opts metav1.CreateOptions) (*v1.ConnectorBinding, error) Update(ctx context.Context, connectorBinding *v1.ConnectorBinding, opts metav1.UpdateOptions) (*v1.ConnectorBinding, error) - UpdateStatus(ctx context.Context, connectorBinding *v1.ConnectorBinding, opts metav1.UpdateOptions) (*v1.ConnectorBinding, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ConnectorBinding, error) @@ -38,7 +37,6 @@ type ConnectorBindingInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ConnectorBinding, err error) Apply(ctx context.Context, connectorBinding *walruscorev1.ConnectorBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ConnectorBinding, err error) - ApplyStatus(ctx context.Context, connectorBinding *walruscorev1.ConnectorBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ConnectorBinding, err error) ConnectorBindingExpansion } @@ -128,22 +126,6 @@ func (c *connectorBindings) Update(ctx context.Context, connectorBinding *v1.Con return } -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *connectorBindings) UpdateStatus(ctx context.Context, connectorBinding *v1.ConnectorBinding, opts metav1.UpdateOptions) (result *v1.ConnectorBinding, err error) { - result = &v1.ConnectorBinding{} - err = c.client.Put(). - Namespace(c.ns). - Resource("connectorbindings"). - Name(connectorBinding.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(connectorBinding). - Do(ctx). - Into(result) - return -} - // Delete takes name of the connectorBinding and deletes it. Returns an error if one occurs. func (c *connectorBindings) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). @@ -211,33 +193,3 @@ func (c *connectorBindings) Apply(ctx context.Context, connectorBinding *walrusc Into(result) return } - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *connectorBindings) ApplyStatus(ctx context.Context, connectorBinding *walruscorev1.ConnectorBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ConnectorBinding, err error) { - if connectorBinding == nil { - return nil, fmt.Errorf("connectorBinding provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(connectorBinding) - if err != nil { - return nil, err - } - - name := connectorBinding.Name - if name == nil { - return nil, fmt.Errorf("connectorBinding.Name must be provided to Apply") - } - - result = &v1.ConnectorBinding{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("connectorbindings"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/clients/clientset/typed/walruscore/v1/fake/fake_connectorbinding.go b/pkg/clients/clientset/typed/walruscore/v1/fake/fake_connectorbinding.go index d49912ee6..b914f6cd2 100644 --- a/pkg/clients/clientset/typed/walruscore/v1/fake/fake_connectorbinding.go +++ b/pkg/clients/clientset/typed/walruscore/v1/fake/fake_connectorbinding.go @@ -91,18 +91,6 @@ func (c *FakeConnectorBindings) Update(ctx context.Context, connectorBinding *v1 return obj.(*v1.ConnectorBinding), err } -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeConnectorBindings) UpdateStatus(ctx context.Context, connectorBinding *v1.ConnectorBinding, opts metav1.UpdateOptions) (*v1.ConnectorBinding, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(connectorbindingsResource, "status", c.ns, connectorBinding), &v1.ConnectorBinding{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.ConnectorBinding), err -} - // Delete takes name of the connectorBinding and deletes it. Returns an error if one occurs. func (c *FakeConnectorBindings) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { _, err := c.Fake. @@ -151,26 +139,3 @@ func (c *FakeConnectorBindings) Apply(ctx context.Context, connectorBinding *wal } return obj.(*v1.ConnectorBinding), err } - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeConnectorBindings) ApplyStatus(ctx context.Context, connectorBinding *walruscorev1.ConnectorBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ConnectorBinding, err error) { - if connectorBinding == nil { - return nil, fmt.Errorf("connectorBinding provided to Apply must not be nil") - } - data, err := json.Marshal(connectorBinding) - if err != nil { - return nil, err - } - name := connectorBinding.Name - if name == nil { - return nil, fmt.Errorf("connectorBinding.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(connectorbindingsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.ConnectorBinding{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.ConnectorBinding), err -} diff --git a/pkg/controllers/walrus/project_subject.authz.go b/pkg/controllers/walrus/project_subject.authz.go index 96bcce03d..a211b997c 100644 --- a/pkg/controllers/walrus/project_subject.authz.go +++ b/pkg/controllers/walrus/project_subject.authz.go @@ -225,12 +225,7 @@ func (r *ProjectSubjectAuthzReconciler) SetupController(ctx context.Context, opt ). Watches( // Requeue when creating an Environment. - &meta.PartialObjectMetadata{ - TypeMeta: meta.TypeMeta{ - APIVersion: walrus.SchemeGroupVersion.String(), - Kind: "Environment", - }, - }, + &walrus.Environment{}, ctrlhandler.EnqueueRequestsFromMapFunc(r.findObjectsWhenEnvironmentCreating), ctrlbuilder.WithPredicates(envFilter), ). @@ -263,7 +258,7 @@ func (r *ProjectSubjectAuthzReconciler) findObjectsWhenEnvironmentCreating(ctx c reqs := make([]ctrlreconcile.Request, len(projSubjs.Items)) for i, item := range projSubjs.Items { reqs[i] = ctrlreconcile.Request{ - NamespacedName: types.NamespacedName{ + NamespacedName: ctrlcli.ObjectKey{ Namespace: env.GetNamespace(), Name: systemauthz.GetProjectSubjectRoleBindingName(ptr.To(item.SubjectReference)), }, diff --git a/pkg/controllers/walrus/subject.authz.go b/pkg/controllers/walrus/subject.authz.go index 1d08cfa10..75358164e 100644 --- a/pkg/controllers/walrus/subject.authz.go +++ b/pkg/controllers/walrus/subject.authz.go @@ -22,8 +22,7 @@ import ( "github.com/seal-io/walrus/pkg/systemmeta" ) -// SubjectAuthzReconciler reconciles a Subject object below the system namespace. -// +// SubjectAuthzReconciler reconciles a Subject object below the system namespace, // and ensures its permissions are granted. type SubjectAuthzReconciler struct { Client ctrlcli.Client diff --git a/pkg/controllers/walruscore/catalog.go b/pkg/controllers/walruscore/catalog.go index 1988e116e..6a7727a04 100644 --- a/pkg/controllers/walruscore/catalog.go +++ b/pkg/controllers/walruscore/catalog.go @@ -3,166 +3,377 @@ package walruscore import ( "context" "fmt" - "sync/atomic" + "reflect" + "strings" + "time" - "github.com/seal-io/utils/pools/gopool" + "go.uber.org/multierr" + kerrors "k8s.io/apimachinery/pkg/api/errors" meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" + ctrlbuilder "sigs.k8s.io/controller-runtime/pkg/builder" ctrlcli "sigs.k8s.io/controller-runtime/pkg/client" + ctrlevent "sigs.k8s.io/controller-runtime/pkg/event" ctrllog "sigs.k8s.io/controller-runtime/pkg/log" + ctrlpredicate "sigs.k8s.io/controller-runtime/pkg/predicate" ctrlreconcile "sigs.k8s.io/controller-runtime/pkg/reconcile" walruscore "github.com/seal-io/walrus/pkg/apis/walruscore/v1" "github.com/seal-io/walrus/pkg/apistatus" "github.com/seal-io/walrus/pkg/controller" + "github.com/seal-io/walrus/pkg/kubeclientset" + "github.com/seal-io/walrus/pkg/kubemeta" "github.com/seal-io/walrus/pkg/systemmeta" - "github.com/seal-io/walrus/pkg/templates/fetcher" tmpllister "github.com/seal-io/walrus/pkg/templates/lister" ) // CatalogReconciler reconciles a v1.Catalog object. type CatalogReconciler struct { - client ctrlcli.Client + Client ctrlcli.Client } var _ ctrlreconcile.Reconciler = (*CatalogReconciler)(nil) // Reconcile reconciles the catalog. -func (r *CatalogReconciler) Reconcile(ctx context.Context, req ctrl.Request) (res ctrl.Result, err error) { +func (r *CatalogReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { logger := ctrllog.FromContext(ctx) // Fetch. - obj := new(walruscore.Catalog) - err = r.client.Get(ctx, req.NamespacedName, obj) + cat := new(walruscore.Catalog) + err := r.Client.Get(ctx, req.NamespacedName, cat) if err != nil { + logger.Error(err, "fetch catalog") return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) } - // Skip. - { - // Skip deletion. - if obj.DeletionTimestamp != nil { + // Clean up if deleted. + if cat.DeletionTimestamp != nil { + // Return if already unlocked. + if systemmeta.Unlock(cat) { return ctrl.Result{}, nil } - // Skip catalog already reconciling. - if apistatus.CatalogConditionReady.IsUnknown(obj) && !apistatus.CatalogConditionRefresh.IsUnknown(obj) { - return ctrl.Result{}, nil + // List related templates. + tmplList := new(walruscore.TemplateList) + err = r.Client.List(ctx, tmplList, + ctrlcli.InNamespace(cat.Namespace), + ctrlcli.MatchingFields{ + "metadata.ownerReferences[controller=true].name": cat.Name, + }) + if err != nil { + logger.Error(err, "list related templates") + return ctrl.Result{}, err } - // Skip catalog finished reconciling. - if (apistatus.CatalogConditionReady.IsTrue(obj) || apistatus.CatalogConditionReady.IsFalse(obj)) && - !apistatus.CatalogConditionRefresh.IsUnknown(obj) { + // Notify the catalog is going to delete, + // and delete related templates. + if len(tmplList.Items) > 0 { + // Notify. + var msgSb strings.Builder + msgSb.WriteString("Deleting templates: ") + for i := range tmplList.Items { + if i > 0 { + msgSb.WriteString(", ") + } + if i >= 5 { + msgSb.WriteString("...") + msgSb.WriteString(fmt.Sprintf(" (total %d)", len(tmplList.Items))) + break + } + msgSb.WriteString(kubemeta.GetNamespacedNameKey(&tmplList.Items[i])) + } + if !apistatus.CatalogConditionDeleting.IsTrue(cat) { + apistatus.CatalogConditionDeleting.ResetTrue(cat, "", msgSb.String()) + } else { + apistatus.CatalogConditionDeleting.Message(cat, msgSb.String()) + } + cat.Status.ConditionSummary = *apistatus.WalkCatalog(&cat.Status.StatusDescriptor) + cat.Status.TemplateCount = int64(len(tmplList.Items)) + + err = r.Client.Status().Update(ctx, cat) + if err != nil { + return ctrl.Result{}, err + } + + // Delete. + rerrs := make([]error, 0, len(tmplList.Items)) + ierrs := make([]error, 0, len(tmplList.Items)) + for i := range tmplList.Items { + eTmpl := &tmplList.Items[i] + err = r.Client.Delete(ctx, eTmpl) + if err != nil && !kerrors.IsNotFound(err) { + logger.Error(err, "deleted related template", "template", kubemeta.GetNamespacedNameKey(eTmpl)) + if !kerrors.IsInvalid(err) { + rerrs = append(rerrs, err) + continue + } + ierrs = append(ierrs, err) + } + } + + switch { + case len(rerrs) != 0: + return ctrl.Result{}, multierr.Combine(rerrs...) + case len(ierrs) != 0: + msgSb = strings.Builder{} + msgSb.WriteString("Blocked by templates: ") + for i := range ierrs { + if i > 0 { + msgSb.WriteString(", ") + } + if i >= 5 { + msgSb.WriteString("...") + msgSb.WriteString(fmt.Sprintf(" (total %d)", len(ierrs))) + break + } + msgSb.WriteString(ierrs[i].Error()) + } + apistatus.CatalogConditionDeleting.Message(cat, msgSb.String()) + cat.Status.ConditionSummary = *apistatus.WalkCatalog(&cat.Status.StatusDescriptor) + err = r.Client.Status().Update(ctx, cat) + if err != nil { + return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) + } + + // Requeue to check if the blocking templates are be able to delete or not. + return ctrl.Result{RequeueAfter: 30 * time.Second}, nil + } + return ctrl.Result{}, nil } - } - // Initialize status. - { - apistatus.CatalogConditionReady.Unknown(obj, apistatus.CatalogConditionReasonPreparing, "Preparing") - if apistatus.CatalogConditionRefresh.IsUnknown(obj) { - apistatus.CatalogConditionRefresh.False(obj, "", "") + // Unlock. + _, err = kubeclientset.UpdateWithCtrlClient(ctx, r.Client, cat) + if err != nil { + logger.Error(err, "unlock catalog") + return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) } - err = r.client.Status().Update(ctx, obj) + return ctrl.Result{}, nil + } + + // Lock if not. + if !systemmeta.Lock(cat) { + cat, err = kubeclientset.UpdateWithCtrlClient(ctx, r.Client, cat) if err != nil { + logger.Error(err, "lock catalog") return ctrl.Result{}, err } } - defer func() { + // Skip if fetch failed. + if apistatus.CatalogConditionFetched.IsFalse(cat) { + return ctrl.Result{}, nil + } + + // Notify the catalog is going to fetch. + if !apistatus.CatalogConditionFetched.Exists(cat) { + apistatus.CatalogConditionFetched.Reset(cat, "", "Fetching templates from VCS.") + cat.Status.ConditionSummary = *apistatus.WalkCatalog(&cat.Status.StatusDescriptor) + cat.Status.Project = systemmeta.GetProjectName(cat.Namespace) + cat.Status.URL = cat.Spec.VCSSource.URL + + err = r.Client.Status().Update(ctx, cat) if err != nil { - apistatus.CatalogConditionReady.False(obj, apistatus.CatalogConditionReasonError, err.Error()) - _ = r.updateStatus(ctx, obj) + return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) } - }() - - // Ensure templates. - var ( - succeed = int32(0) - failed = int32(0) - invalid = int32(0) - ) - - { - var ( - wg = gopool.GroupWithContextIn(ctx) - batchSize = 10 - ) - - tmpls, err := tmpllister.List(ctx, obj) + } + + // Fetch templates if needed. + if apistatus.CatalogConditionFetched.IsUnknown(cat) { + // Fetch templates. + tmpls, err := tmpllister.List(ctx, cat) if err != nil { - return ctrl.Result{}, err - } + logger.Error(err, "fetch templates' metadata") - for i := 0; i < batchSize; i++ { - s := i + // Notify the catalog is fetch failed. + apistatus.CatalogConditionFetched.False(cat, apistatus.CatalogConditionFetchedReasonAllFailed, err.Error()) + cat.Status.ConditionSummary = *apistatus.WalkCatalog(&cat.Status.StatusDescriptor) + cat.Status.Project = systemmeta.GetProjectName(cat.Namespace) + cat.Status.URL = cat.Spec.VCSSource.URL - wg.Go(func(ctx context.Context) error { - for j := s; j < len(tmpls); j += batchSize { - tmpl, err := fetcher.Fetch(ctx, &tmpls[j]) - if err != nil { - atomic.AddInt32(&failed, 1) - return fmt.Errorf("failed to fetch template %s/%s: %w", tmpls[j].Namespace, tmpls[j].Name, err) - } + err = r.Client.Status().Update(ctx, cat) + return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) + } - if tmpl == nil { - atomic.AddInt32(&invalid, 1) - continue - } + // Update or create templates. + errs := make([]error, 0, len(tmpls)) + for i := range tmpls { + eTmpl := &tmpls[i] + kubemeta.ControlOn(eTmpl, cat, walruscore.SchemeGroupVersion.WithKind("Catalog")) - atomic.AddInt32(&succeed, 1) - } + _, err = kubeclientset.CreateWithCtrlClient(ctx, r.Client, eTmpl) + if err != nil { + logger.Error(err, "update or create template", "template", kubemeta.GetNamespacedNameKey(eTmpl)) + errs = append(errs, err) + } + } + if len(errs) != 0 { + err = multierr.Combine(errs...) - return nil - }) + // Notify the catalog is fetch failed. + rea := apistatus.CatalogConditionFetchedReasonPartialFailed + if len(tmpls) == len(errs) { + rea = apistatus.CatalogConditionFetchedReasonAllFailed + } + apistatus.CatalogConditionFetched.False(cat, rea, err.Error()) + cat.Status.ConditionSummary = *apistatus.WalkCatalog(&cat.Status.StatusDescriptor) + cat.Status.Project = systemmeta.GetProjectName(cat.Namespace) + cat.Status.URL = cat.Spec.VCSSource.URL + + err = r.Client.Status().Update(ctx, cat) + return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) } - err = wg.Wait() + // Notify the catalog is fetched. + apistatus.CatalogConditionFetched.True(cat, "", fmt.Sprintf("Fetched %d templates from VCS.", len(tmpls))) + cat.Status.ConditionSummary = *apistatus.WalkCatalog(&cat.Status.StatusDescriptor) + cat.Status.Project = systemmeta.GetProjectName(cat.Namespace) + cat.Status.URL = cat.Spec.VCSSource.URL + + err = r.Client.Status().Update(ctx, cat) if err != nil { - return ctrl.Result{}, err + return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) } - logger.Infof("synced catalog \"%s/%s\", total: %d, succeed: %d, failed: %d, invalid: %d", - obj.Namespace, obj.Name, len(tmpls), succeed, failed, invalid) + // NB(thxCode): Go ahead to watch if templates are synced. } - // Update status. - { - apistatus.CatalogConditionReady.True(obj, "", "") - obj.Status.Project = systemmeta.GetProjectName(obj.Namespace) - obj.Status.URL = obj.Spec.VCSSource.URL - obj.Status.TemplateCount = int64(succeed) - obj.Status.LastSyncTime = meta.Now() + // List related templates. + tmplList := new(walruscore.TemplateList) + err = r.Client.List(ctx, tmplList, + ctrlcli.InNamespace(cat.Namespace), + ctrlcli.MatchingFields{ + "metadata.ownerReferences[controller=true].name": cat.Name, + }) + if err != nil { + logger.Error(err, "list related templates") + return ctrl.Result{}, err + } - err = r.updateStatus(ctx, obj) - if err != nil { - return ctrl.Result{}, err + // Count related templates' status. + var done, failed, remain int + for i := range tmplList.Items { + eTmpl := &tmplList.Items[i] + switch walruscore.ConditionStatus(apistatus.TemplateConditionSynced.GetStatus(eTmpl)) { + case walruscore.ConditionTrue: + done++ + case walruscore.ConditionFalse: + failed++ } } + remain = len(tmplList.Items) - done - failed + + // Notify the catalog's syncing result. + switch { + case remain != 0: + apistatus.CatalogConditionSyncedTemplates.Unknown(cat, + apistatus.CatalogConditionSyncedTemplatesReasonSyncing, + fmt.Sprintf("Synced %d templates, remaining %d templates.", done+failed, remain)) + case failed != 0: + apistatus.CatalogConditionSyncedTemplates.False(cat, + apistatus.CatalogConditionSyncedTemplatesReasonFailed, + fmt.Sprintf("Synced all templates, but failed %d templates.", failed)) + default: + apistatus.CatalogConditionSyncedTemplates.True(cat, "", + fmt.Sprintf("Synced %d templates successfully.", done)) + cat.Status.LastSuccessfulSyncTime = ptr.To(meta.Now()) + } + cat.Status.ConditionSummary = *apistatus.WalkCatalog(&cat.Status.StatusDescriptor) + cat.Status.Project = systemmeta.GetProjectName(cat.Namespace) + cat.Status.TemplateCount = int64(len(tmplList.Items)) - return ctrl.Result{}, nil + err = r.Client.Status().Update(ctx, cat) + return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) } -// updateStatus updates the status of the catalog. -func (r *CatalogReconciler) updateStatus(ctx context.Context, obj *walruscore.Catalog) error { - existed := new(walruscore.Catalog) - err := r.client.Get(ctx, ctrlcli.ObjectKeyFromObject(obj), existed) +// SetupController sets up the controller. +func (r *CatalogReconciler) SetupController(ctx context.Context, opts controller.SetupOptions) error { + // Configure field indexer. + fi := opts.Manager.GetFieldIndexer() + err := fi.IndexField(ctx, &walruscore.Template{}, "metadata.ownerReferences[controller=true].name", + func(obj ctrlcli.Object) []string { + if obj == nil { + return nil + } + ctrler := kubemeta.GetControllerOfNoCopy(obj) + if ctrler == nil { + return nil + } + if ctrler.APIVersion != walruscore.SchemeGroupVersion.String() || + ctrler.Kind != "Catalog" { + return nil + } + return []string{ctrler.Name} + }) if err != nil { - return err + return fmt.Errorf("index template 'metadata.ownerReferences[controller=true].name': %w", err) } - existed.Status = obj.Status - existed.Status.ConditionSummary = *apistatus.WalkCatalog(&existed.Status.StatusDescriptor) - err = r.client.Status().Update(ctx, existed) - return err -} + r.Client = opts.Manager.GetClient() -// SetupController sets up the controller. -func (r *CatalogReconciler) SetupController(_ context.Context, opts controller.SetupOptions) error { - r.client = opts.Manager.GetClient() + // Filter out specific update events of catalogs. + catFilter := ctrlpredicate.Funcs{ + UpdateFunc: func(e ctrlevent.UpdateEvent) bool { + oldCat, newCat := e.ObjectOld.(*walruscore.Catalog), e.ObjectNew.(*walruscore.Catalog) + switch { + default: + return false + case newCat.DeletionTimestamp != nil: + if !systemmeta.IsLocked(newCat) { + return false + } + // Deleting during locking. + case newCat.Generation != oldCat.Generation && !reflect.DeepEqual(newCat.Spec.Filters, oldCat.Spec.Filters): + // Interested mutable fields is changed. + case !apistatus.CatalogConditionFetched.Exists(newCat): + // Status is not initialized. + case !apistatus.CatalogConditionSyncedTemplates.Exists(newCat): + // Status is not completed. + } + return true + }, + } + + // Filter out deleting or syncing update events of templates. + tmplFilter := ctrlpredicate.Funcs{ + CreateFunc: func(_ ctrlevent.CreateEvent) bool { + // Ignore creation. + return false + }, + GenericFunc: func(_ ctrlevent.GenericEvent) bool { + // Ignore generation. + return false + }, + UpdateFunc: func(e ctrlevent.UpdateEvent) bool { + oldTmpl, newTmpl := e.ObjectOld.(*walruscore.Template), e.ObjectNew.(*walruscore.Template) + switch { + default: + return false + case newTmpl.DeletionTimestamp != nil: + if !systemmeta.IsLocked(newTmpl) { + return false + } + // Deleting during locking. + case apistatus.TemplateConditionSynced.IsUnknown(oldTmpl) && + apistatus.TemplateConditionSynced.IsTrueOrFalse(newTmpl): + // Synced. + } + return true + }, + } return ctrl.NewControllerManagedBy(opts.Manager). - For(&walruscore.Catalog{}). + For( + // Focus on the catalog. + &walruscore.Catalog{}, + ctrlbuilder.WithPredicates(catFilter), + ). + Owns( + // Own the templates. + &walruscore.Template{}, + ctrlbuilder.WithPredicates(tmplFilter), + ). Complete(r) } diff --git a/pkg/controllers/walruscore/connector.go b/pkg/controllers/walruscore/connector.go index 981347508..050cc69f8 100644 --- a/pkg/controllers/walruscore/connector.go +++ b/pkg/controllers/walruscore/connector.go @@ -2,12 +2,17 @@ package walruscore import ( "context" + "fmt" + "reflect" + "strings" + "time" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" ctrl "sigs.k8s.io/controller-runtime" ctrlbuilder "sigs.k8s.io/controller-runtime/pkg/builder" ctrlcli "sigs.k8s.io/controller-runtime/pkg/client" + ctrlevent "sigs.k8s.io/controller-runtime/pkg/event" ctrllog "sigs.k8s.io/controller-runtime/pkg/log" ctrlpredicate "sigs.k8s.io/controller-runtime/pkg/predicate" ctrlreconcile "sigs.k8s.io/controller-runtime/pkg/reconcile" @@ -16,6 +21,7 @@ import ( "github.com/seal-io/walrus/pkg/apistatus" "github.com/seal-io/walrus/pkg/controller" "github.com/seal-io/walrus/pkg/kubeclientset" + "github.com/seal-io/walrus/pkg/kubemeta" "github.com/seal-io/walrus/pkg/resourcehandler" "github.com/seal-io/walrus/pkg/resourcehandlers" "github.com/seal-io/walrus/pkg/systemmeta" @@ -23,7 +29,7 @@ import ( // ConnectorReconciler reconciles a v1.Connector object. type ConnectorReconciler struct { - client ctrlcli.Client + Client ctrlcli.Client } var _ ctrlreconcile.Reconciler = (*ConnectorReconciler)(nil) @@ -31,106 +37,188 @@ var _ ctrlreconcile.Reconciler = (*ConnectorReconciler)(nil) func (r *ConnectorReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { logger := ctrllog.FromContext(ctx) - obj := new(walruscore.Connector) - err := r.client.Get(ctx, req.NamespacedName, obj) + // Fetch. + conn := new(walruscore.Connector) + err := r.Client.Get(ctx, req.NamespacedName, conn) if err != nil { + logger.Error(err, "fetch connector") return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) } - if obj.DeletionTimestamp != nil { + // Clean up if deleted. + if conn.DeletionTimestamp != nil { // Return if already unlocked. - if systemmeta.Unlock(obj) { + if systemmeta.Unlock(conn) { return ctrl.Result{}, nil } - sec := &core.Secret{ - ObjectMeta: meta.ObjectMeta{ - Namespace: obj.Namespace, - Name: obj.Spec.SecretName, - }, - } - - err = r.client.Get(ctx, ctrlcli.ObjectKeyFromObject(sec), sec) + // List related connector bindings. + cbList := new(walruscore.ConnectorBindingList) + err = r.Client.List(ctx, cbList, + ctrlcli.MatchingFields{ + "spec.connector": kubemeta.GetNamespacedNameKey(conn), + }) if err != nil { + logger.Error(err, "list related connector binding") return ctrl.Result{}, err } - if sec.DeletionTimestamp == nil { - err = r.client.Delete(ctx, sec) + // Notify the connector deletion blocking by which connector binding. + if len(cbList.Items) > 0 { + // Notify. + var msgSb strings.Builder + msgSb.WriteString("Blocked by connector binding: ") + for i := range cbList.Items { + if i > 0 { + msgSb.WriteString(", ") + } + if i >= 5 { + msgSb.WriteString("...") + msgSb.WriteString(fmt.Sprintf(" (total %d)", len(cbList.Items))) + break + } + msgSb.WriteString(kubemeta.GetNamespacedNameKey(&cbList.Items[i])) + } + if !apistatus.ConnectorConditionDeleting.IsTrue(conn) { + apistatus.ConnectorConditionDeleting.ResetTrue(conn, "", msgSb.String()) + } else { + apistatus.ConnectorConditionDeleting.Message(conn, msgSb.String()) + } + conn.Status.ConditionSummary = *apistatus.WalkConnector(&conn.Status.StatusDescriptor) + + err = r.Client.Status().Update(ctx, conn) if err != nil { - return ctrl.Result{}, err + return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) } + + // Requeue to check if the blocking connector bindings are deleted or not. + return ctrl.Result{RequeueAfter: 30 * time.Second}, nil } - // Unlock. - _, err = kubeclientset.UpdateWithCtrlClient(ctx, r.client, obj) + // Delete related secret. + sec := &core.Secret{ + ObjectMeta: meta.ObjectMeta{ + Namespace: conn.Namespace, + Name: conn.Spec.SecretName, + }, + } + err = kubeclientset.DeleteWithCtrlClient(ctx, r.Client, sec) if err != nil { - logger.Error(err, "failed to unlock connector", "connector", obj) + logger.Error(err, "delete related secret") return ctrl.Result{}, err } - return ctrl.Result{}, nil - } + // Unlock. + _, err = kubeclientset.UpdateWithCtrlClient(ctx, r.Client, conn) + if err != nil { + logger.Error(err, "unlock connector") + return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) + } - if apistatus.ConnectorConditionConnected.IsTrue(obj) || apistatus.ConnectorConditionConnected.IsFalse(obj) { return ctrl.Result{}, nil } // Lock if not. - if !systemmeta.Lock(obj) { - obj, err = kubeclientset.UpdateWithCtrlClient(ctx, r.client, obj) + if !systemmeta.Lock(conn) { + conn, err = kubeclientset.UpdateWithCtrlClient(ctx, r.Client, conn) if err != nil { - logger.Error(err, "failed to lock connector", "connector", obj) + logger.Error(err, "lock connector") return ctrl.Result{}, err } } - rh, err := resourcehandlers.Get(ctx, resourcehandler.CreateOptions{ - Connector: *obj, - }) - if err != nil { - logger.Error(err, "fetch resource handler") - return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) + // Skip if already synced. + if apistatus.ConnectorConditionConnected.IsTrueOrFalse(conn) { + return ctrl.Result{}, nil } - err = rh.IsConnected(ctx) - if err != nil { - apistatus.ConnectorConditionConnected.False(obj, apistatus.ConnectorConditionReasonDisconnected, err.Error()) - } else { - apistatus.ConnectorConditionConnected.True(obj, "", "") - obj.Status.Project = systemmeta.GetProjectName(obj.Namespace) - } + // Notify the connector is going to dail. + if !apistatus.ConnectorConditionConnected.Exists(conn) { + apistatus.ConnectorConditionConnected.Reset(conn, "", "Dialing.") + conn.Status.ConditionSummary = *apistatus.WalkConnector(&conn.Status.StatusDescriptor) + conn.Status.Project = systemmeta.GetProjectName(conn.Namespace) - // Update status. - { - err = r.updateStatus(ctx, obj) + err = r.Client.Status().Update(ctx, conn) if err != nil { - return ctrl.Result{}, err + return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) } } - return ctrl.Result{}, nil -} -// updateStatus updates the status of the given connector. -func (r *ConnectorReconciler) updateStatus(ctx context.Context, obj *walruscore.Connector) error { - existed := new(walruscore.Connector) - err := r.client.Get(ctx, ctrlcli.ObjectKeyFromObject(obj), existed) + // Get resource handler. + rh, err := resourcehandlers.Get(ctx, resourcehandler.GetOptions{ + Connector: walruscore.ConnectorReference{ + Namespace: conn.Namespace, + Name: conn.Name, + }, + Type: conn.Spec.Type, + }) if err != nil { - return err + logger.Error(err, "get resource handler") + return ctrl.Result{}, err } - existed.Status = obj.Status - existed.Status.ConditionSummary = *apistatus.WalkConnector(&existed.Status.StatusDescriptor) + // Dial with resource handler and update status. + if err = rh.IsConnected(ctx); err != nil { + // Notify the connector is disconnected. + logger.Error(err, "disconnected") + apistatus.ConnectorConditionConnected.False(conn, apistatus.ConnectorConditionConnectedReasonFailed, err.Error()) + } else { + // Notify the connector is connected. + apistatus.ConnectorConditionConnected.True(conn, "", "Dialed successfully.") + } + conn.Status.ConditionSummary = *apistatus.WalkConnector(&conn.Status.StatusDescriptor) + conn.Status.Project = systemmeta.GetProjectName(conn.Namespace) - return r.client.Status().Update(ctx, existed) + err = r.Client.Status().Update(ctx, conn) + return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) } -func (r *ConnectorReconciler) SetupController(_ context.Context, opts controller.SetupOptions) error { - r.client = opts.Manager.GetClient() +func (r *ConnectorReconciler) SetupController(ctx context.Context, opts controller.SetupOptions) error { + // Configure field indexer. + fi := opts.Manager.GetFieldIndexer() + err := fi.IndexField(ctx, &walruscore.ConnectorBinding{}, "spec.connector", + func(obj ctrlcli.Object) []string { + if obj == nil { + return nil + } + cb := obj.(*walruscore.ConnectorBinding) + return []string{cb.Spec.Connector.ToNamespacedName().String()} + }) + if err != nil { + return fmt.Errorf("index connector binding 'spec.connector': %w", err) + } + + r.Client = opts.Manager.GetClient() + + // Filter out specific update events of connectors. + connFilter := ctrlpredicate.Funcs{ + UpdateFunc: func(e ctrlevent.UpdateEvent) bool { + oldConn, newConn := e.ObjectOld.(*walruscore.Connector), e.ObjectNew.(*walruscore.Connector) + switch { + default: + return false + case newConn.DeletionTimestamp != nil: + if !systemmeta.IsLocked(newConn) { + return false + } + // Deleting during locking. + case newConn.Generation != oldConn.Generation && !reflect.DeepEqual(newConn.Spec.Config, oldConn.Spec.Config): + // Interested mutable fields is changed. + case !apistatus.ConnectorConditionConnected.Exists(newConn): + // Status is not initialized. + case apistatus.ConnectorConditionConnected.IsTrueOrFalse(oldConn) && + apistatus.ConnectorConditionConnected.IsUnknown(newConn): + // Reconnect. + } + return true + }, + } return ctrl.NewControllerManagedBy(opts.Manager). - For(&walruscore.Connector{}, - ctrlbuilder.WithPredicates(ctrlpredicate.GenerationChangedPredicate{}), + For( + // Focus on the connector. + &walruscore.Connector{}, + ctrlbuilder.WithPredicates(connFilter), ). Complete(r) } diff --git a/pkg/controllers/walruscore/connector_binding.go b/pkg/controllers/walruscore/connector_binding.go index 3caf93e8f..628008217 100644 --- a/pkg/controllers/walruscore/connector_binding.go +++ b/pkg/controllers/walruscore/connector_binding.go @@ -3,13 +3,18 @@ package walruscore import ( "context" "fmt" + "maps" + "reflect" "strings" "time" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" + kerrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/util/sets" ctrl "sigs.k8s.io/controller-runtime" ctrlbuilder "sigs.k8s.io/controller-runtime/pkg/builder" ctrlcli "sigs.k8s.io/controller-runtime/pkg/client" + ctrlevent "sigs.k8s.io/controller-runtime/pkg/event" + ctrlhandler "sigs.k8s.io/controller-runtime/pkg/handler" ctrllog "sigs.k8s.io/controller-runtime/pkg/log" ctrlpredicate "sigs.k8s.io/controller-runtime/pkg/predicate" ctrlreconcile "sigs.k8s.io/controller-runtime/pkg/reconcile" @@ -18,12 +23,13 @@ import ( walruscore "github.com/seal-io/walrus/pkg/apis/walruscore/v1" "github.com/seal-io/walrus/pkg/controller" "github.com/seal-io/walrus/pkg/kubeclientset" + "github.com/seal-io/walrus/pkg/kubemeta" "github.com/seal-io/walrus/pkg/systemmeta" ) // ConnectorBindingReconciler reconciles a v1.ConnectorBinding object. type ConnectorBindingReconciler struct { - client ctrlcli.Client + Client ctrlcli.Client } var _ ctrlreconcile.Reconciler = (*ConnectorBindingReconciler)(nil) @@ -32,42 +38,51 @@ func (r *ConnectorBindingReconciler) Reconcile(ctx context.Context, req ctrl.Req logger := ctrllog.FromContext(ctx) cb := new(walruscore.ConnectorBinding) - err := r.client.Get(ctx, req.NamespacedName, cb) + err := r.Client.Get(ctx, req.NamespacedName, cb) if err != nil { - logger.Error(err, "failed to get ConnectorBinding", "namespace", req.Namespace, "name", req.Name) + logger.Error(err, "fetch connector binding") return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) } + // Clean up if deleted. if cb.DeletionTimestamp != nil { + // Return if already unlocked. if systemmeta.Unlock(cb) { return ctrl.Result{}, nil } - // Unlabel environment. + // Get related environment. envList := &walrus.EnvironmentList{} - if err := r.client.List(ctx, envList, ctrlcli.MatchingFields{"metadata.name": cb.Namespace}); err != nil { - logger.Error(err, "failed to list Environments for ConnectorBinding", "namespace", cb.Namespace) + err = r.Client.List(ctx, envList, + // Since the environment name is unique, + // we can use it as the field selector without the namespace(project) of environment. + ctrlcli.MatchingFields{ + "metadata.name": cb.Namespace, + }) + if err != nil { + logger.Error(err, "get related environment") return ctrl.Result{}, err } - if len(envList.Items) == 1 { - env := envList.Items[0] - - labels := env.GetLabels() - delete(labels, walruscore.ProviderLabelPrefix+strings.ToLower(cb.Status.Type)) - env.SetLabels(labels) - - err = r.client.Update(ctx, &env) - if err != nil { - logger.Error(err, "failed to update Environment", "name", env.Name) - return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) + // Unlabel environment if needed. + if len(envList.Items) == 1 && envList.Items[0].DeletionTimestamp == nil { + env := &envList.Items[0] + lbs := maps.Clone(env.Labels) + delete(lbs, getConnectorBoundTypeLabel(cb)) + if len(lbs) != len(env.Labels) { + env.Labels = lbs + err = r.Client.Update(ctx, env) + if err != nil && !kerrors.IsNotFound(err) { + logger.Error(err, "unlabel environment", "environment", kubemeta.GetNamespacedNameKey(env)) + return ctrl.Result{}, err + } } } // Unlock. - _, err = kubeclientset.UpdateWithCtrlClient(ctx, r.client, cb) + _, err = kubeclientset.UpdateWithCtrlClient(ctx, r.Client, cb) if err != nil { - logger.Error(err, "failed to unlock ConnectorBinding", "namespace", cb.Namespace, "name", cb.Name) + logger.Error(err, "unlock connector binding") return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) } @@ -76,69 +91,52 @@ func (r *ConnectorBindingReconciler) Reconcile(ctx context.Context, req ctrl.Req // Lock if not. if !systemmeta.Lock(cb) { - cb, err = kubeclientset.UpdateWithCtrlClient(ctx, r.client, cb) - if err != nil { - logger.Error(err, "failed to lock ConnectorBinding", "namespace", cb.Namespace, "name", cb.Name) - return ctrl.Result{}, err - } - } - - conn := &walruscore.Connector{ - ObjectMeta: meta.ObjectMeta{ - Name: cb.Spec.Connector.Name, - Namespace: cb.Spec.Connector.Namespace, - }, - } - - err = r.client.Get(ctx, ctrlcli.ObjectKeyFromObject(conn), conn) - if err != nil { - return ctrl.Result{}, err - } - - if cb.Status.Type != conn.Spec.Type || cb.Status.Category != conn.Spec.Category { - cb.Status.Type = conn.Spec.Type - cb.Status.Category = conn.Spec.Category - - err = r.client.Status().Update(ctx, cb) + cb, err = kubeclientset.UpdateWithCtrlClient(ctx, r.Client, cb) if err != nil { + logger.Error(err, "lock connector binding") return ctrl.Result{}, err } } - // Label environment. + // Get related environment. envList := &walrus.EnvironmentList{} - if err := r.client.List(ctx, envList, ctrlcli.MatchingFields{"metadata.name": cb.Namespace}); err != nil { - logger.Error(err, "failed to list Environments for ConnectorBinding", "namespace", cb.Namespace) + err = r.Client.List(ctx, envList, + // Since the environment name is unique, + // we can use it as the field selector without the namespace(project) of environment. + ctrlcli.MatchingFields{ + "metadata.name": cb.Namespace, + }) + if err != nil { + logger.Error(err, "get related environment") return ctrl.Result{}, err } if len(envList.Items) != 1 { - // NB: we should never reach here. - logger.Error(nil, "cannot fetch corresponding environment") + // NB(thxCode): we should never reach here. + logger.Error(nil, "cannot fetch related environment") return ctrl.Result{RequeueAfter: time.Second}, nil } - env := envList.Items[0] - - labels := env.Labels - if labels == nil { - labels = make(map[string]string) + // Label environment if needed. + env := &envList.Items[0] + lbs := maps.Clone(env.Labels) + if lbs == nil { + lbs = make(map[string]string) } - - labels[walruscore.ProviderLabelPrefix+strings.ToLower(cb.Status.Type)] = "true" - env.SetLabels(labels) - - err = r.client.Update(ctx, &env) - if err != nil { - return ctrl.Result{}, err + lbs[getConnectorBoundTypeLabel(cb)] = "" + if len(lbs) != len(env.Labels) { + env.Labels = lbs + err = r.Client.Update(ctx, env) + if err != nil { + logger.Error(err, "label environment", "environment", kubemeta.GetNamespacedNameKey(env)) + return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) + } } return ctrl.Result{}, nil } func (r *ConnectorBindingReconciler) SetupController(ctx context.Context, opts controller.SetupOptions) error { - r.client = opts.Manager.GetClient() - // Configure field indexer. fi := opts.Manager.GetFieldIndexer() err := fi.IndexField(ctx, &walrus.Environment{}, "metadata.name", @@ -152,9 +150,68 @@ func (r *ConnectorBindingReconciler) SetupController(ctx context.Context, opts c return fmt.Errorf("index environment 'metadata.name': %w", err) } + // Filter out specific update events of connector bindings. + cbFilter := ctrlpredicate.Funcs{ + UpdateFunc: func(e ctrlevent.UpdateEvent) bool { + oldCb, newCb := e.ObjectOld.(*walruscore.ConnectorBinding), e.ObjectNew.(*walruscore.ConnectorBinding) + return !reflect.DeepEqual(oldCb.Spec, newCb.Spec) + }, + } + + // Filter out updating environment. + envFilter := ctrlpredicate.Not(ctrlpredicate.Funcs{ + UpdateFunc: func(e ctrlevent.UpdateEvent) bool { + return false + }, + }) + + r.Client = opts.Manager.GetClient() + return ctrl.NewControllerManagedBy(opts.Manager). - For(&walruscore.ConnectorBinding{}, - ctrlbuilder.WithPredicates(ctrlpredicate.GenerationChangedPredicate{}), + For( + // Focus on the connector binding. + &walruscore.ConnectorBinding{}, + ctrlbuilder.WithPredicates(cbFilter), + ). + Watches( + // Requeue when updating an Environment. + &walrus.Environment{}, + ctrlhandler.EnqueueRequestsFromMapFunc(r.findObjectsWhenEnvironmentUpdating), + ctrlbuilder.WithPredicates(envFilter), ). Complete(r) } + +func (r *ConnectorBindingReconciler) findObjectsWhenEnvironmentUpdating(ctx context.Context, env ctrlcli.Object) []ctrlreconcile.Request { + logger := ctrllog.FromContext(ctx) + + cbList := new(walruscore.ConnectorBindingList) + err := r.Client.List(ctx, cbList, + ctrlcli.InNamespace(env.GetName())) + if err != nil { + logger.Error(err, "list connector bindings") + return nil + } + + lbs := sets.KeySet(env.GetLabels()) + + reqs := make([]ctrlreconcile.Request, 0, len(cbList.Items)) + for i := range cbList.Items { + if lbs.Has(getConnectorBoundTypeLabel(&cbList.Items[i])) { + continue + } + reqs = append(reqs, ctrlreconcile.Request{ + NamespacedName: ctrlcli.ObjectKey{ + Namespace: cbList.Items[i].Namespace, + Name: cbList.Items[i].Name, + }, + }) + } + return reqs +} + +const ConnectorBoundTypeLabelPrefix = "bound.connector.walrus.seal.io/type-" + +func getConnectorBoundTypeLabel(cb *walruscore.ConnectorBinding) string { + return ConnectorBoundTypeLabelPrefix + strings.ToLower(cb.Spec.Connector.Type) +} diff --git a/pkg/controllers/walruscore/template.go b/pkg/controllers/walruscore/template.go index 477718343..314ec68e2 100644 --- a/pkg/controllers/walruscore/template.go +++ b/pkg/controllers/walruscore/template.go @@ -2,104 +2,212 @@ package walruscore import ( "context" + "fmt" + "runtime" + "strings" + "time" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" + ctrlbuilder "sigs.k8s.io/controller-runtime/pkg/builder" ctrlcli "sigs.k8s.io/controller-runtime/pkg/client" + ctrlctrl "sigs.k8s.io/controller-runtime/pkg/controller" + ctrlevent "sigs.k8s.io/controller-runtime/pkg/event" + ctrllog "sigs.k8s.io/controller-runtime/pkg/log" + ctrlpredicate "sigs.k8s.io/controller-runtime/pkg/predicate" ctrlreconcile "sigs.k8s.io/controller-runtime/pkg/reconcile" walruscore "github.com/seal-io/walrus/pkg/apis/walruscore/v1" "github.com/seal-io/walrus/pkg/apistatus" "github.com/seal-io/walrus/pkg/controller" + "github.com/seal-io/walrus/pkg/kubeclientset" "github.com/seal-io/walrus/pkg/kubemeta" + "github.com/seal-io/walrus/pkg/systemmeta" tmplfetcher "github.com/seal-io/walrus/pkg/templates/fetcher" ) // TemplateReconciler reconciles a v1.Template object. type TemplateReconciler struct { - client ctrlcli.Client + Client ctrlcli.Client } var _ ctrlreconcile.Reconciler = (*TemplateReconciler)(nil) // Reconcile reconciles the template. -func (r *TemplateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (res ctrl.Result, err error) { +func (r *TemplateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { + logger := ctrllog.FromContext(ctx) + // Fetch. - obj := new(walruscore.Template) - err = r.client.Get(ctx, req.NamespacedName, obj) + tmpl := new(walruscore.Template) + err := r.Client.Get(ctx, req.NamespacedName, tmpl) if err != nil { + logger.Error(err, "fetch template") return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) } - // Skip. - { - // Skip deletion. - if obj.DeletionTimestamp != nil { + // Clean up if deleted. + if tmpl.DeletionTimestamp != nil { + // Return if already unlocked. + if systemmeta.Unlock(tmpl) { return ctrl.Result{}, nil } - // Skip template already reconciling. - if apistatus.TemplateConditionReady.IsUnknown(obj) && !apistatus.TemplateConditionRefresh.IsUnknown(obj) { - return ctrl.Result{}, nil + // List related resource components. + resCompsList := new(walruscore.ResourceComponentsList) + err = r.Client.List(ctx, resCompsList, + ctrlcli.MatchingFields{ + "status.template": kubemeta.GetNamespacedNameKey(tmpl), + }) + if err != nil { + logger.Error(err, "list related resource components") + return ctrl.Result{}, err } - // Skip template finished reconciling. - if (apistatus.TemplateConditionReady.IsTrue(obj) || apistatus.TemplateConditionReady.IsFalse(obj)) && - !apistatus.TemplateConditionRefresh.IsUnknown(obj) { - return ctrl.Result{}, nil + // Notify the template deletion blocking by which resource components. + if len(resCompsList.Items) > 0 { + // Notify. + var msgSb strings.Builder + msgSb.WriteString("Blocked by resource components: ") + for i := range resCompsList.Items { + if i > 0 { + msgSb.WriteString(", ") + } + if i >= 5 { + msgSb.WriteString("...") + msgSb.WriteString(fmt.Sprintf(" (total %d)", len(resCompsList.Items))) + break + } + msgSb.WriteString(kubemeta.GetNamespacedNameKey(&resCompsList.Items[i])) + } + if !apistatus.TemplateConditionDeleting.IsTrue(tmpl) { + apistatus.TemplateConditionDeleting.ResetTrue(tmpl, "", msgSb.String()) + } else { + apistatus.TemplateConditionDeleting.Message(tmpl, msgSb.String()) + } + tmpl.Status.ConditionSummary = *apistatus.WalkTemplate(&tmpl.Status.StatusDescriptor) + + err = r.Client.Status().Update(ctx, tmpl) + if err != nil { + return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) + } + + // Requeue to check if the blocking resource components are deleted or not. + return ctrl.Result{RequeueAfter: 30 * time.Second}, nil } - // Skip template own by catalog and without manually refresh. - if kubemeta.IsControlledByGVK(obj, walruscore.SchemeGroupVersionKind("Catalog")) && - !apistatus.TemplateConditionRefresh.IsUnknown(obj) { - return ctrl.Result{}, nil + // Unlock. + _, err = kubeclientset.UpdateWithCtrlClient(ctx, r.Client, tmpl) + if err != nil { + logger.Error(err, "unlock template") + return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) } + + return ctrl.Result{}, nil } - // Initialize status. - { - apistatus.TemplateConditionReady.Unknown(obj, apistatus.TemplateConditionReasonPreparing, "Preparing") - if apistatus.TemplateConditionRefresh.IsUnknown(obj) { - apistatus.TemplateConditionRefresh.False(obj, "", "") - } - err = r.updateStatus(ctx, obj) + // Lock if not. + if !systemmeta.Lock(tmpl) { + _, err = kubeclientset.UpdateWithCtrlClient(ctx, r.Client, tmpl) if err != nil { - return ctrl.Result{}, err + logger.Error(err, "lock template") } + // NB(thxCode): during concurrent reconciles, + // release the going handle to avoid a conflict error. + return ctrl.Result{}, err } - defer func() { + // Skip if already synced. + if apistatus.TemplateConditionSynced.IsTrueOrFalse(tmpl) { + return ctrl.Result{}, nil + } + + // Notify the template is going to sync. + if !apistatus.TemplateConditionSynced.Exists(tmpl) { + apistatus.TemplateConditionSynced.Reset(tmpl, "", "Syncing from VCS.") + tmpl.Status.ConditionSummary = *apistatus.WalkTemplate(&tmpl.Status.StatusDescriptor) + tmpl.Status.Project = systemmeta.GetProjectName(tmpl.Namespace) + + err = r.Client.Status().Update(ctx, tmpl) if err != nil { - apistatus.TemplateConditionReady.False(obj, apistatus.TemplateConditionReasonError, err.Error()) - _ = r.updateStatus(ctx, obj) + return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) } - }() - - // Reconcile and update status. - { - _, err = tmplfetcher.Fetch(ctx, obj) - return ctrl.Result{}, err } -} -// updateStatus updates the status of the template. -func (r *TemplateReconciler) updateStatus(ctx context.Context, obj *walruscore.Template) error { - existed := new(walruscore.Template) - err := r.client.Get(ctx, ctrlcli.ObjectKeyFromObject(obj), existed) + // Fetch template and update status. + tmpl, err = tmplfetcher.Fetch(ctx, tmpl) if err != nil { - return err + // Notify the template is sync failed. + logger.Error(err, "fetch template's metadata") + apistatus.TemplateConditionSynced.False(tmpl, apistatus.TemplateConditionSyncedReasonFailed, err.Error()) + } else { + // Notify the template is synced. + apistatus.TemplateConditionSynced.True(tmpl, "", "Synced successfully.") + tmpl.Status.LastSuccessfulSyncTime = ptr.To(meta.Now()) } + tmpl.Status.ConditionSummary = *apistatus.WalkTemplate(&tmpl.Status.StatusDescriptor) + tmpl.Status.Project = systemmeta.GetProjectName(tmpl.Namespace) - existed.Status = obj.Status - existed.Status.ConditionSummary = *apistatus.WalkTemplate(&existed.Status.StatusDescriptor) - err = r.client.Status().Update(ctx, existed) - return err + err = r.Client.Status().Update(ctx, tmpl) + return ctrl.Result{}, ctrlcli.IgnoreNotFound(err) } // SetupController sets up the controller. -func (r *TemplateReconciler) SetupController(_ context.Context, opts controller.SetupOptions) error { - r.client = opts.Manager.GetClient() +func (r *TemplateReconciler) SetupController(ctx context.Context, opts controller.SetupOptions) error { + // Configure field indexer. + fi := opts.Manager.GetFieldIndexer() + err := fi.IndexField(ctx, &walruscore.ResourceComponents{}, "status.template", + func(obj ctrlcli.Object) []string { + if obj == nil { + return nil + } + resComps := obj.(*walruscore.ResourceComponents) + return []string{resComps.Status.Template.ToNamespacedName().String()} + }) + if err != nil { + return fmt.Errorf("index resource components 'status.template': %w", err) + } + + r.Client = opts.Manager.GetClient() + + // Filter out specific update events of templates. + tmplFilter := ctrlpredicate.Funcs{ + UpdateFunc: func(e ctrlevent.UpdateEvent) bool { + oldTmpl, newTmpl := e.ObjectOld.(*walruscore.Template), e.ObjectNew.(*walruscore.Template) + switch { + default: + return false + case newTmpl.DeletionTimestamp != nil: + if !systemmeta.IsLocked(newTmpl) { + return false + } + // Deleting during locking. + case !apistatus.TemplateConditionSynced.Exists(newTmpl): + // Status is not initialized. + case apistatus.TemplateConditionSynced.IsTrueOrFalse(oldTmpl) && + apistatus.TemplateConditionSynced.IsUnknown(newTmpl): + // Resync. + } + return true + }, + DeleteFunc: func(e ctrlevent.DeleteEvent) bool { + // NB(thxCode): during concurrent reconciles, + // ignore final deletion to avoid a not found error. + return false + }, + } return ctrl.NewControllerManagedBy(opts.Manager). - For(&walruscore.Template{}). + For( + // Focus on the template. + &walruscore.Template{}, + ctrlbuilder.WithPredicates(tmplFilter), + ). + WithOptions(ctrlctrl.Options{ + // Start the same number of reconciles as the number of CPUs, + // which is able to handle the templates sync from one catalog in parallel. + // TODO(thxCode): pool this? + MaxConcurrentReconciles: runtime.GOMAXPROCS(0), + }). Complete(r) } diff --git a/pkg/extensionapi/storage.go b/pkg/extensionapi/storage.go index 79391a1b2..eb0d99f56 100644 --- a/pkg/extensionapi/storage.go +++ b/pkg/extensionapi/storage.go @@ -801,38 +801,66 @@ type ( // NewListForProxy returns an empty object that can be used with the List call for proxy. NewListForProxy() runtime.Object // CastObjectTo casts the object from downstream to upstream. - CastObjectTo(DO) UO + // + // It is usually recommended to perform type conversion in this method, + // for example, `return UO(do)`. + CastObjectTo(do DO) UO // CastObjectFrom casts the object from upstream to downstream. - CastObjectFrom(UO) DO + // + // It is usually recommended to perform type conversion in this method, + // for example, `return DO(uo)`. + CastObjectFrom(uo UO) DO } - // CurdProxyOnCreateAdvice is an interface for intercepting OnCreate. - CurdProxyOnCreateAdvice[DO MetaObject] interface { - // BeforeOnCreate is called before create. + // CurdProxyOnCreateBeforeAdvice is an interface for intercepting before OnCreate. + CurdProxyOnCreateBeforeAdvice[DO MetaObject] interface { + // BeforeOnCreate is called before create, + // to modify the creating object and options. BeforeOnCreate(ctx context.Context, obj DO, opts *ctrlcli.CreateOptions) error } - // CurdProxyOnListWatchAdvice is an interface for interception OnList/OnWatch. - CurdProxyOnListWatchAdvice interface { - // BeforeOnListWatch is called before list/watch. - BeforeOnListWatch(ctx context.Context, options *ctrlcli.ListOptions) error + // CurdProxyOnListWatchBeforeAdvice is an interface for interception before OnList/OnWatch. + CurdProxyOnListWatchBeforeAdvice interface { + // BeforeOnListWatch is called before list/watch, + // to modify the list/watch options. + BeforeOnListWatch(ctx context.Context, opts *ctrlcli.ListOptions) error } - // CurdProxyOnGetAdvice is an interface for intercepting OnGet. - CurdProxyOnGetAdvice[DO MetaObject] interface { - // BeforeOnGet is called before get. + // CurdProxyOnListAfterAdvice is an interface for intercepting after OnList. + CurdProxyOnListAfterAdvice[DOL MetaObjectList] interface { + // AfterOnList is called after list, + // to modify the list result. + AfterOnList(dol DOL, opts *ctrlcli.ListOptions) (mdol DOL) + } + + // CurdProxyOnWatchDuringAdvice is an interface for intercepting during OnWatch. + CurdProxyOnWatchDuringAdvice[DO MetaObject] interface { + // DuringWatching is called during watch, + // to modify the receiving result. + // + // If the return value of `send` is true, + // the result will be sent to the client. + DuringWatching(do DO, opts *ctrlcli.ListOptions) (mdo DO, send bool) + } + + // CurdProxyOnGetBeforeAdvice is an interface for intercepting before OnGet. + CurdProxyOnGetBeforeAdvice[DO MetaObject] interface { + // BeforeOnGet is called before get, + // to modify the getting options. BeforeOnGet(ctx context.Context, key types.NamespacedName, opts *ctrlcli.GetOptions) error } - // CurdProxyOnUpdateAdvice is an interface for intercepting OnUpdate. - CurdProxyOnUpdateAdvice[DO MetaObject] interface { - // BeforeOnUpdate is called before update. + // CurdProxyOnUpdateBeforeAdvice is an interface for intercepting before OnUpdate. + CurdProxyOnUpdateBeforeAdvice[DO MetaObject] interface { + // BeforeOnUpdate is called before update, + // to modify the updating object and options. BeforeOnUpdate(ctx context.Context, obj, oldObj DO, opts *ctrlcli.UpdateOptions) error } - // CurdProxyOnDeleteAdvice is an interface for intercepting OnDelete. - CurdProxyOnDeleteAdvice[DO MetaObject] interface { - // BeforeOnDelete is called before delete. + // CurdProxyOnDeleteBeforeAdvice is an interface for intercepting before OnDelete. + CurdProxyOnDeleteBeforeAdvice[DO MetaObject] interface { + // BeforeOnDelete is called before delete, + // to modify the deleting object and options. BeforeOnDelete(ctx context.Context, obj DO, opts *ctrlcli.DeleteOptions) error } @@ -903,11 +931,13 @@ func (h _CurdProxyHandler[DO, DOL, UO, UOL]) OnCreate( obj runtime.Object, opts ctrlcli.CreateOptions, ) (runtime.Object, error) { + // Bypass if the handler implements CreateHandler. if gh, ok := h.CurdProxyHandler.(_CreateHandlerWithoutNew); ok { return gh.OnCreate(ctx, obj, opts) } - if bf, ok := h.CurdProxyHandler.(CurdProxyOnCreateAdvice[DO]); ok { + // Before advice. + if bf, ok := h.CurdProxyHandler.(CurdProxyOnCreateBeforeAdvice[DO]); ok { err := bf.BeforeOnCreate(ctx, obj.(DO), &opts) if err != nil { return nil, err @@ -926,19 +956,22 @@ func (h _CurdProxyHandler[DO, DOL, UO, UOL]) OnList( ctx context.Context, opts ctrlcli.ListOptions, ) (runtime.Object, error) { + // Bypass if the handler implements ListHandler. if gh, ok := h.CurdProxyHandler.(ListHandler); ok { return gh.OnList(ctx, opts) } - if bf, ok := h.CurdProxyHandler.(CurdProxyOnListWatchAdvice); ok { - err := bf.BeforeOnListWatch(ctx, &opts) + // Before advice. + uopts := copyListOptions(opts) + if bf, ok := h.CurdProxyHandler.(CurdProxyOnListWatchBeforeAdvice); ok { + err := bf.BeforeOnListWatch(ctx, uopts) if err != nil { return nil, err } } uol := h.NewListForProxy().(UOL) - err := h.CtrlReader.List(ctx, uol, &opts) + err := h.CtrlReader.List(ctx, uol, uopts) if err != nil { return nil, err } @@ -974,6 +1007,11 @@ func (h _CurdProxyHandler[DO, DOL, UO, UOL]) OnList( dolm.SetSelfLink(uolm.GetSelfLink()) } + // After advice. + if af, ok := h.CurdProxyHandler.(CurdProxyOnListAfterAdvice[DOL]); ok { + dol = af.AfterOnList(dol.(DOL), &opts) + } + return dol, nil } @@ -981,19 +1019,22 @@ func (h _CurdProxyHandler[DO, DOL, UO, UOL]) OnWatch( ctx context.Context, opts ctrlcli.ListOptions, ) (watch.Interface, error) { + // Bypass if the handler implements WatchHandler. if gh, ok := h.CurdProxyHandler.(WatchHandler); ok { return gh.OnWatch(ctx, opts) } - if bf, ok := h.CurdProxyHandler.(CurdProxyOnListWatchAdvice); ok { - err := bf.BeforeOnListWatch(ctx, &opts) + // Before advice. + uopts := copyListOptions(opts) + if bf, ok := h.CurdProxyHandler.(CurdProxyOnListWatchBeforeAdvice); ok { + err := bf.BeforeOnListWatch(ctx, uopts) if err != nil { return nil, err } } uol := h.NewListForProxy().(UOL) - uw, err := h.CtrlClient.Watch(ctx, uol, &opts) + uw, err := h.CtrlClient.Watch(ctx, uol, uopts) if err != nil { return nil, err } @@ -1031,7 +1072,17 @@ func (h _CurdProxyHandler[DO, DOL, UO, UOL]) OnWatch( } // Cast. - e.Object = h.CastObjectFrom(uo) + do := h.CastObjectFrom(uo) + + // During advice. + if da, ok := h.CurdProxyHandler.(CurdProxyOnWatchDuringAdvice[DO]); ok { + do, ok = da.DuringWatching(do, &opts) + if !ok { + continue + } + } + + e.Object = do c <- e } } @@ -1040,16 +1091,34 @@ func (h _CurdProxyHandler[DO, DOL, UO, UOL]) OnWatch( return dw, nil } +func copyListOptions(opts ctrlcli.ListOptions) *ctrlcli.ListOptions { + if opts.LabelSelector != nil { + opts.LabelSelector = opts.LabelSelector.DeepCopySelector() + } + if opts.FieldSelector != nil { + opts.FieldSelector = opts.FieldSelector.DeepCopySelector() + } + if opts.UnsafeDisableDeepCopy != nil { + opts.UnsafeDisableDeepCopy = ptr.To(ptr.Deref(opts.UnsafeDisableDeepCopy, false)) + } + if opts.Raw != nil { + opts.Raw = opts.Raw.DeepCopy() + } + return &opts +} + func (h _CurdProxyHandler[DO, DOL, UO, UOL]) OnGet( ctx context.Context, key types.NamespacedName, opts ctrlcli.GetOptions, ) (runtime.Object, error) { + // Bypass if the handler implements GetHandler. if gh, ok := h.CurdProxyHandler.(GetHandler); ok { return gh.OnGet(ctx, key, opts) } - if bf, ok := h.CurdProxyHandler.(CurdProxyOnGetAdvice[DO]); ok { + // Before advice. + if bf, ok := h.CurdProxyHandler.(CurdProxyOnGetBeforeAdvice[DO]); ok { err := bf.BeforeOnGet(ctx, key, &opts) if err != nil { return nil, err @@ -1075,18 +1144,26 @@ func (h _CurdProxyHandler[DO, DOL, UO, UOL]) OnUpdate( obj, oldObj runtime.Object, opts ctrlcli.UpdateOptions, ) (runtime.Object, error) { + // Bypass if the handler implements UpdateHandler. if gh, ok := h.CurdProxyHandler.(_UpdateHandlerWithoutNew); ok { return gh.OnUpdate(ctx, obj, oldObj, opts) } - if bf, ok := h.CurdProxyHandler.(CurdProxyOnUpdateAdvice[DO]); ok { + // Before advice. + if bf, ok := h.CurdProxyHandler.(CurdProxyOnUpdateBeforeAdvice[DO]); ok { err := bf.BeforeOnUpdate(ctx, obj.(DO), oldObj.(DO), &opts) if err != nil { return nil, err } } uo := h.CastObjectTo(obj.(DO)) - err := h.CtrlClient.Update(ctx, uo, &opts) + var err error + ri, ok := genericapirequest.RequestInfoFrom(ctx) + if ok && ri.Subresource != "" { + err = h.CtrlClient.SubResource(ri.Subresource).Update(ctx, uo, &ctrlcli.SubResourceUpdateOptions{UpdateOptions: opts}) + } else { + err = h.CtrlClient.Update(ctx, uo, &opts) + } if err != nil { return nil, err } @@ -1098,11 +1175,13 @@ func (h _CurdProxyHandler[DO, DOL, UO, UOL]) OnDelete( obj runtime.Object, opts ctrlcli.DeleteOptions, ) error { + // Bypass if the handler implements DeleteHandler. if gh, ok := h.CurdProxyHandler.(DeleteHandler); ok { return gh.OnDelete(ctx, obj, opts) } - if bf, ok := h.CurdProxyHandler.(CurdProxyOnDeleteAdvice[DO]); ok { + // Before advice. + if bf, ok := h.CurdProxyHandler.(CurdProxyOnDeleteBeforeAdvice[DO]); ok { err := bf.BeforeOnDelete(ctx, obj.(DO), &opts) if err != nil { return err diff --git a/pkg/extensionapis/walrus/catalog.go b/pkg/extensionapis/walrus/catalog.go index cd8e14156..ae2512e7f 100644 --- a/pkg/extensionapis/walrus/catalog.go +++ b/pkg/extensionapis/walrus/catalog.go @@ -47,6 +47,13 @@ func (h *CatalogHandler) SetupHandler( }, JSONPath: ".status.url", }, + extensionapi.JSONPathTableColumnDefinition{ + TableColumnDefinition: meta.TableColumnDefinition{ + Name: "Template Count", + Type: "integer", + }, + JSONPath: ".status.templateCount", + }, extensionapi.JSONPathTableColumnDefinition{ TableColumnDefinition: meta.TableColumnDefinition{ Name: "Project", @@ -73,7 +80,7 @@ func (h *CatalogHandler) SetupHandler( *walrus.Catalog, *walrus.CatalogList, *walruscore.Catalog, *walruscore.CatalogList, ](tc, h, opts.Manager.GetClient().(ctrlcli.WithWatch), opts.Manager.GetAPIReader()) - return gvr, srs, nil + return gvr, srs, err } var ( diff --git a/pkg/extensionapis/walrus/connector.config.go b/pkg/extensionapis/walrus/connector.config.go new file mode 100644 index 000000000..364a6e2d3 --- /dev/null +++ b/pkg/extensionapis/walrus/connector.config.go @@ -0,0 +1,88 @@ +package walrus + +import ( + "context" + + core "k8s.io/api/core/v1" + kerrors "k8s.io/apimachinery/pkg/api/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apiserver/pkg/registry/rest" + ctrlcli "sigs.k8s.io/controller-runtime/pkg/client" + + walrus "github.com/seal-io/walrus/pkg/apis/walrus/v1" + walruscore "github.com/seal-io/walrus/pkg/apis/walruscore/v1" + "github.com/seal-io/walrus/pkg/extensionapi" +) + +// ConnectorConfigHandler handles v1.ConnectorConfig objects, +// which is a subresource of v1.Connector objects. +type ConnectorConfigHandler struct { + extensionapi.ObjectInfo + extensionapi.GetOperation + + Client ctrlcli.Client +} + +func newConnectorConfigHandler(opts extensionapi.SetupOptions) *ConnectorConfigHandler { + h := &ConnectorConfigHandler{} + + // As storage. + h.ObjectInfo = &walrus.ConnectorConfig{} + h.GetOperation = extensionapi.WithGet(h) + + // Set client. + h.Client = opts.Manager.GetClient() + + return h +} + +var ( + _ rest.Storage = (*ConnectorConfigHandler)(nil) + _ rest.Getter = (*ConnectorConfigHandler)(nil) +) + +func (h *ConnectorConfigHandler) New() runtime.Object { + return &walrus.ConnectorConfig{} +} + +func (h *ConnectorConfigHandler) Destroy() {} + +func (h *ConnectorConfigHandler) OnGet(ctx context.Context, key types.NamespacedName, opts ctrlcli.GetOptions) (runtime.Object, error) { + // Get connector. + conn := new(walruscore.Connector) + err := h.Client.Get(ctx, key, conn, &opts) + if err != nil { + return nil, kerrors.NewInternalError(err) + } + + // Get secret. + sec := &core.Secret{ + ObjectMeta: meta.ObjectMeta{ + Namespace: key.Namespace, + Name: conn.Spec.SecretName, + }, + } + err = h.Client.Get(ctx, ctrlcli.ObjectKeyFromObject(sec), sec) + if err != nil { + return nil, kerrors.NewInternalError(err) + } + + // Construct connector config. + connCfg := &walrus.ConnectorConfig{ + ObjectMeta: meta.ObjectMeta{ + Namespace: key.Namespace, + Name: key.Name, + }, + Status: walrus.ConnectorConfigStatus{ + ApplicableEnvironmentType: conn.Spec.ApplicableEnvironmentType, + Category: conn.Spec.Category, + Type: conn.Spec.Type, + Version: conn.Spec.Config.Version, + Data: sec.Data, + ConditionSummary: conn.Status.ConditionSummary, + }, + } + return connCfg, nil +} diff --git a/pkg/extensionapis/walrus/connector.go b/pkg/extensionapis/walrus/connector.go index 51b992cb3..1b06895af 100644 --- a/pkg/extensionapis/walrus/connector.go +++ b/pkg/extensionapis/walrus/connector.go @@ -62,17 +62,17 @@ func (h *ConnectorHandler) SetupHandler( }, extensionapi.JSONPathTableColumnDefinition{ TableColumnDefinition: meta.TableColumnDefinition{ - Name: "Applicable Environment Type", + Name: "Project", Type: "string", }, - JSONPath: ".spec.applicableEnvironmentType", + JSONPath: ".status.project", }, extensionapi.JSONPathTableColumnDefinition{ TableColumnDefinition: meta.TableColumnDefinition{ - Name: "Project", + Name: "Status", Type: "string", }, - JSONPath: ".status.project", + JSONPath: ".status.phase", }) if err != nil { return gvr, nil, err @@ -85,7 +85,12 @@ func (h *ConnectorHandler) SetupHandler( *walrus.Connector, *walrus.ConnectorList, *walruscore.Connector, *walruscore.ConnectorList, ](tc, h, opts.Manager.GetClient().(ctrlcli.WithWatch), opts.Manager.GetAPIReader()) - return gvr, nil, nil + // Create subresource handlers. + srs = map[string]rest.Storage{ + "config": newConnectorConfigHandler(opts), + } + + return gvr, srs, err } var ( diff --git a/pkg/extensionapis/walrus/connector_binding.go b/pkg/extensionapis/walrus/connector_binding.go index 34a1d688c..2f5fb099c 100644 --- a/pkg/extensionapis/walrus/connector_binding.go +++ b/pkg/extensionapis/walrus/connector_binding.go @@ -62,19 +62,18 @@ func (h *ConnectorBindingHandler) SetupHandler( }, extensionapi.JSONPathTableColumnDefinition{ TableColumnDefinition: meta.TableColumnDefinition{ - Name: "Connector Type", + Name: "Connector Category", Type: "string", }, - JSONPath: ".status.Type", + JSONPath: ".spec.connector.category", }, extensionapi.JSONPathTableColumnDefinition{ TableColumnDefinition: meta.TableColumnDefinition{ - Name: "Connector Category", + Name: "Connector Type", Type: "string", }, - JSONPath: ".status.Category", - }, - ) + JSONPath: ".spec.connector.type", + }) if err != nil { return gvr, nil, err } diff --git a/pkg/extensionapis/walrus/setting.go b/pkg/extensionapis/walrus/setting.go index 2d5e0017e..5560352e7 100644 --- a/pkg/extensionapis/walrus/setting.go +++ b/pkg/extensionapis/walrus/setting.go @@ -228,7 +228,7 @@ func (h *SettingHandler) OnWatch(ctx context.Context, opts ctrlcli.ListOptions) case !ok: // insert setIndexer[setIndexKey] = *set - case !set.Equal(&prevSet): + case set.Status.Value_ != prevSet.Status.Value_: // update setIndexer[setIndexKey] = *set } diff --git a/pkg/extensionapis/walrus/template.go b/pkg/extensionapis/walrus/template.go index 374db69c3..49a9fc76d 100644 --- a/pkg/extensionapis/walrus/template.go +++ b/pkg/extensionapis/walrus/template.go @@ -73,7 +73,7 @@ func (h *TemplateHandler) SetupHandler( *walrus.Template, *walrus.TemplateList, *walruscore.Template, *walruscore.TemplateList, ](tc, h, opts.Manager.GetClient().(ctrlcli.WithWatch), opts.Manager.GetAPIReader()) - return gvr, srs, nil + return gvr, srs, err } var ( diff --git a/pkg/extensionapis/walrus/variable.go b/pkg/extensionapis/walrus/variable.go index 74af12dfb..5f97dcd26 100644 --- a/pkg/extensionapis/walrus/variable.go +++ b/pkg/extensionapis/walrus/variable.go @@ -423,7 +423,9 @@ func (h *VariableHandler) OnWatch(ctx context.Context, opts ctrlcli.ListOptions) e2.Object = vra e2.Type = watch.Modified c <- *e2 - case !vra.Equal(&prevVra): + case vra.Spec.Sensitive != prevVra.Spec.Sensitive || + vra.Status.Scope != prevVra.Status.Scope || + vra.Status.Value_ != prevVra.Status.Value_: // Update if changed. vraIndexer[vraIndexKey] = *vra if opts.Namespace != "" && vra.Namespace != opts.Namespace { diff --git a/pkg/resourcehandler/types.go b/pkg/resourcehandler/types.go index 7749b8928..b6726dc6f 100644 --- a/pkg/resourcehandler/types.go +++ b/pkg/resourcehandler/types.go @@ -6,7 +6,6 @@ import ( meta "k8s.io/apimachinery/pkg/apis/meta/v1" - walrus "github.com/seal-io/walrus/pkg/apis/walrus/v1" walruscore "github.com/seal-io/walrus/pkg/apis/walruscore/v1" ) @@ -41,18 +40,18 @@ type ResourceHandler interface { // // The given walrus.ResourceComponent item must specify the following fields: // ID, DeployerType, Type and Name. - GetKeys(context.Context, *walrus.ResourceComponents) (*ResourceComponentOperationKeys, error) + GetKeys(context.Context, *walruscore.ResourceComponents) (*walruscore.ResourceComponentOperationKeys, error) // GetStatus gets status of the given resource. // // The given walrus.ResourceComponent item must specify the following fields: // ID, DeployerType, Type and Name. - GetStatus(context.Context, *walrus.ResourceComponents) ([]meta.Condition, error) + GetStatus(context.Context, *walruscore.ResourceComponents) ([]meta.Condition, error) // GetComponents gets components of the given resource, // returns list must not be `nil` unless unexpected input or raising error, // it can be used to clean stale items safety if got an empty list. - GetComponents(context.Context, *walrus.ResourceComponents) ([]*walrus.ResourceComponents, error) + GetComponents(context.Context, *walruscore.ResourceComponents) ([]*walruscore.ResourceComponents, error) // Log gets logs from the given key. Log(context.Context, string, LogOptions) error @@ -96,12 +95,11 @@ type TerminalResizer interface { Next() (width, height uint16, ok bool) } -type CreateOptions struct { - Connector walruscore.Connector -} - -type Creator func(context.Context, CreateOptions) (ResourceHandler, error) - -type ResourceComponentOperationKeys struct { - // TODO: Need to consider how the resource component is used +// GetOptions holds the options to get a resource handler. +type GetOptions struct { + // Connector is reference that pointer to a Walrus Connector. + Connector walruscore.ConnectorReference + // Type is the type of the resource handler, + // it is always the same as the given Walrus Connector's type. + Type string } diff --git a/pkg/resourcehandlers/alibaba/resourcehandler.go b/pkg/resourcehandlers/alibaba/resourcehandler.go index c8c89706f..9bcc1735b 100644 --- a/pkg/resourcehandlers/alibaba/resourcehandler.go +++ b/pkg/resourcehandlers/alibaba/resourcehandler.go @@ -9,6 +9,7 @@ import ( meta "k8s.io/apimachinery/pkg/apis/meta/v1" walrus "github.com/seal-io/walrus/pkg/apis/walrus/v1" + walruscore "github.com/seal-io/walrus/pkg/apis/walruscore/v1" "github.com/seal-io/walrus/pkg/resourcehandler" "github.com/seal-io/walrus/pkg/resourcehandlers/alibaba/resourceexec" "github.com/seal-io/walrus/pkg/resourcehandlers/alibaba/resourcelog" @@ -17,22 +18,14 @@ import ( const OperatorType = resourcehandler.ConnectorTypeAlibabaCloud -// New returns resourcehandlers.ResourceHandler with the given options. -func New(ctx context.Context, opts resourcehandler.CreateOptions) (resourcehandler.ResourceHandler, error) { - name := opts.Connector.Name - - config, err := types.GetConfigData(ctx, opts) - if err != nil { - return nil, err - } - - cred, err := types.GetCredential(config) +func New(_ context.Context, connCfg walrus.ConnectorConfig) (resourcehandler.ResourceHandler, error) { + cred, err := types.GetCredential(connCfg.Status.Data) if err != nil { return nil, err } return Operator{ - name: name, + name: connCfg.Name, cred: cred, identifier: stringx.SumBySHA256("alibaba:", cred.AccessKey, cred.AccessSecret), }, nil @@ -71,42 +64,34 @@ func (op Operator) Type() resourcehandler.Type { return OperatorType } -// Burst implements resourcehandlers.ResourceHandler. func (op Operator) Burst() int { return 200 } -// ID implements resourcehandlers.ResourceHandler. func (op Operator) ID() string { return op.identifier } -// GetComponents implements resourcehandlers.ResourceHandler. -func (op Operator) GetComponents( - ctx context.Context, - resource *walrus.ResourceComponents, -) ([]*walrus.ResourceComponents, error) { +func (op Operator) GetKeys(ctx context.Context, resComps *walruscore.ResourceComponents) (*walruscore.ResourceComponentOperationKeys, error) { + return nil, nil +} + +func (op Operator) GetStatus(ctx context.Context, resComps *walruscore.ResourceComponents) ([]meta.Condition, error) { + // TODO: Implement this method after resource is migrated. + + return nil, nil +} + +func (op Operator) GetComponents(ctx context.Context, resComps *walruscore.ResourceComponents) ([]*walruscore.ResourceComponents, error) { return nil, nil } -// Log implements resourcehandlers.ResourceHandler. func (op Operator) Log(ctx context.Context, key string, opts resourcehandler.LogOptions) error { newCtx := context.WithValue(ctx, types.CredentialKey, op.cred) return resourcelog.Log(newCtx, key, opts) } -// Exec implements resourcehandlers.ResourceHandler. func (op Operator) Exec(ctx context.Context, key string, opts resourcehandler.ExecOptions) error { newCtx := context.WithValue(ctx, types.CredentialKey, op.cred) return resourceexec.Exec(newCtx, key, opts) } - -func (op Operator) GetKeys(ctx context.Context, component *walrus.ResourceComponents) (*resourcehandler.ResourceComponentOperationKeys, error) { - return nil, nil -} - -func (op Operator) GetStatus(ctx context.Context, component *walrus.ResourceComponents) ([]meta.Condition, error) { - // TODO: Implement this method after resource is migrated. - - return nil, nil -} diff --git a/pkg/resourcehandlers/aws/resourcehandler.go b/pkg/resourcehandlers/aws/resourcehandler.go index 56af192e0..942b3bd01 100644 --- a/pkg/resourcehandlers/aws/resourcehandler.go +++ b/pkg/resourcehandlers/aws/resourcehandler.go @@ -9,6 +9,7 @@ import ( meta "k8s.io/apimachinery/pkg/apis/meta/v1" walrus "github.com/seal-io/walrus/pkg/apis/walrus/v1" + walruscore "github.com/seal-io/walrus/pkg/apis/walruscore/v1" "github.com/seal-io/walrus/pkg/resourcehandler" "github.com/seal-io/walrus/pkg/resourcehandlers/aws/resourceexec" "github.com/seal-io/walrus/pkg/resourcehandlers/aws/resourcelog" @@ -18,22 +19,14 @@ import ( const OperatorType = resourcehandler.ConnectorTypeAWS -// New returns resourcehandlers.ResourceHandler with the given options. -func New(ctx context.Context, opts resourcehandler.CreateOptions) (resourcehandler.ResourceHandler, error) { - name := opts.Connector.Name - - config, err := types.GetConfigData(ctx, opts) - if err != nil { - return nil, err - } - - cred, err := types.GetCredential(config) +func New(_ context.Context, connCfg walrus.ConnectorConfig) (resourcehandler.ResourceHandler, error) { + cred, err := types.GetCredential(connCfg.Status.Data) if err != nil { return nil, err } return Operator{ - name: name, + name: connCfg.Name, cred: cred, identifier: stringx.SumBySHA256("aws:", cred.AccessKey, cred.AccessSecret), }, nil @@ -68,42 +61,34 @@ func (op Operator) Type() resourcehandler.Type { return OperatorType } -// Burst implements resourcehandlers.ResourceHandler. func (op Operator) Burst() int { return 200 } -// ID implements resourcehandlers.ResourceHandler. func (op Operator) ID() string { return op.identifier } -// GetComponents implements resourcehandlers.ResourceHandler. -func (op Operator) GetComponents( - ctx context.Context, - resource *walrus.ResourceComponents, -) ([]*walrus.ResourceComponents, error) { +func (op Operator) GetKeys(ctx context.Context, resComps *walruscore.ResourceComponents) (*walruscore.ResourceComponentOperationKeys, error) { + return nil, nil +} + +func (op Operator) GetStatus(ctx context.Context, resComps *walruscore.ResourceComponents) ([]meta.Condition, error) { + // TODO: Implement this method after resource is migrated. + + return nil, nil +} + +func (op Operator) GetComponents(ctx context.Context, resComps *walruscore.ResourceComponents) ([]*walruscore.ResourceComponents, error) { return nil, nil } -// Log implements resourcehandlers.ResourceHandler. func (op Operator) Log(ctx context.Context, key string, opts resourcehandler.LogOptions) error { newCtx := context.WithValue(ctx, types.CredentialKey, op.cred) return resourcelog.Log(newCtx, key, opts) } -// Exec implements resourcehandlers.ResourceHandler. func (op Operator) Exec(ctx context.Context, key string, opts resourcehandler.ExecOptions) error { newCtx := context.WithValue(ctx, types.CredentialKey, op.cred) return resourceexec.Exec(newCtx, key, opts) } - -func (op Operator) GetKeys(ctx context.Context, component *walrus.ResourceComponents) (*resourcehandler.ResourceComponentOperationKeys, error) { - return nil, nil -} - -func (op Operator) GetStatus(ctx context.Context, component *walrus.ResourceComponents) ([]meta.Condition, error) { - // TODO: Implement this method after resource is migrated. - - return nil, nil -} diff --git a/pkg/resourcehandlers/azure/resourcehandler.go b/pkg/resourcehandlers/azure/resourcehandler.go index ae3b524d6..b035d67eb 100644 --- a/pkg/resourcehandlers/azure/resourcehandler.go +++ b/pkg/resourcehandlers/azure/resourcehandler.go @@ -10,28 +10,21 @@ import ( meta "k8s.io/apimachinery/pkg/apis/meta/v1" walrus "github.com/seal-io/walrus/pkg/apis/walrus/v1" + walruscore "github.com/seal-io/walrus/pkg/apis/walruscore/v1" "github.com/seal-io/walrus/pkg/resourcehandler" aztypes "github.com/seal-io/walrus/pkg/resourcehandlers/azure/types" - "github.com/seal-io/walrus/pkg/resourcehandlers/types" ) const OperatorType = resourcehandler.ConnectorTypeAzure -// New returns resourcehandlers.ResourceHandler with the given options. -func New(ctx context.Context, opts resourcehandler.CreateOptions) (resourcehandler.ResourceHandler, error) { - name := opts.Connector.Name - config, err := types.GetConfigData(ctx, opts) - if err != nil { - return nil, err - } - - cred, err := aztypes.GetCredential(config) +func New(_ context.Context, connCfg walrus.ConnectorConfig) (resourcehandler.ResourceHandler, error) { + cred, err := aztypes.GetCredential(connCfg.Status.Data) if err != nil { return nil, err } return Operator{ - name: name, + name: connCfg.Name, cred: cred, identifier: stringx.SumBySHA256("azure:", cred.SubscriptionID, cred.TenantID, cred.ClientID), }, nil @@ -74,35 +67,28 @@ func (o Operator) Burst() int { return 100 } -// ID implements resourcehandlers.ResourceHandler. func (o Operator) ID() string { return o.identifier } -// GetComponents implements resourcehandlers.ResourceHandler. -func (o Operator) GetComponents( - ctx context.Context, - resource *walrus.ResourceComponents, -) ([]*walrus.ResourceComponents, error) { +func (o Operator) GetKeys(ctx context.Context, resComps *walruscore.ResourceComponents) (*walruscore.ResourceComponentOperationKeys, error) { return nil, nil } -// Log implements resourcehandlers.ResourceHandler. -func (o Operator) Log(ctx context.Context, key string, opts resourcehandler.LogOptions) error { - return nil -} +func (o Operator) GetStatus(ctx context.Context, resComps *walruscore.ResourceComponents) ([]meta.Condition, error) { + // TODO: Implement this method after resource is migrated. -// Exec implements resourcehandlers.ResourceHandler. -func (o Operator) Exec(ctx context.Context, key string, opts resourcehandler.ExecOptions) error { - return nil + return nil, nil } -func (o Operator) GetKeys(ctx context.Context, component *walrus.ResourceComponents) (*resourcehandler.ResourceComponentOperationKeys, error) { +func (o Operator) GetComponents(ctx context.Context, resComps *walruscore.ResourceComponents) ([]*walruscore.ResourceComponents, error) { return nil, nil } -func (o Operator) GetStatus(ctx context.Context, component *walrus.ResourceComponents) ([]meta.Condition, error) { - // TODO: Implement this method after resource is migrated. +func (o Operator) Log(ctx context.Context, key string, opts resourcehandler.LogOptions) error { + return nil +} - return nil, nil +func (o Operator) Exec(ctx context.Context, key string, opts resourcehandler.ExecOptions) error { + return nil } diff --git a/pkg/resourcehandlers/docker/resourcehandler.go b/pkg/resourcehandlers/docker/resourcehandler.go index 3482d661f..91d2d655f 100644 --- a/pkg/resourcehandlers/docker/resourcehandler.go +++ b/pkg/resourcehandlers/docker/resourcehandler.go @@ -10,21 +10,14 @@ import ( meta "k8s.io/apimachinery/pkg/apis/meta/v1" walrus "github.com/seal-io/walrus/pkg/apis/walrus/v1" + walruscore "github.com/seal-io/walrus/pkg/apis/walruscore/v1" "github.com/seal-io/walrus/pkg/resourcehandler" - optypes "github.com/seal-io/walrus/pkg/resourcehandlers/types" ) const OperatorType = resourcehandler.ConnectorTypeDocker -// New returns resourcehandlers.ResourceHandler with the given options. -func New(ctx context.Context, opts resourcehandler.CreateOptions) (resourcehandler.ResourceHandler, error) { - name := opts.Connector.Name - config, err := optypes.GetConfigData(ctx, opts) - if err != nil { - return nil, err - } - - host := string(config["host"]) +func New(_ context.Context, connCfg walrus.ConnectorConfig) (resourcehandler.ResourceHandler, error) { + host := string(connCfg.Status.Data["host"]) if host == "" { return nil, errors.New("host is empty") } @@ -35,7 +28,7 @@ func New(ctx context.Context, opts resourcehandler.CreateOptions) (resourcehandl } return Operator{ - name: name, + name: connCfg.Name, identifier: stringx.SumBySHA256("docker:", host), client: cli, }, nil @@ -67,30 +60,24 @@ func (op Operator) ID() string { return op.identifier } -// GetComponents implements resourcehandlers.ResourceHandler. -func (op Operator) GetComponents( - ctx context.Context, - resource *walrus.ResourceComponents, -) ([]*walrus.ResourceComponents, error) { +func (op Operator) GetKeys(ctx context.Context, resComps *walruscore.ResourceComponents) (*walruscore.ResourceComponentOperationKeys, error) { return nil, nil } -// Log implements resourcehandlers.ResourceHandler. -func (op Operator) Log(ctx context.Context, key string, opts resourcehandler.LogOptions) error { - return nil -} +func (op Operator) GetStatus(ctx context.Context, resComps *walruscore.ResourceComponents) ([]meta.Condition, error) { + // TODO: Implement this method after resource is migrated. -// Exec implements resourcehandlers.ResourceHandler. -func (op Operator) Exec(ctx context.Context, key string, opts resourcehandler.ExecOptions) error { - return nil + return nil, nil } -func (op Operator) GetKeys(ctx context.Context, component *walrus.ResourceComponents) (*resourcehandler.ResourceComponentOperationKeys, error) { +func (op Operator) GetComponents(ctx context.Context, resComps *walruscore.ResourceComponents) ([]*walruscore.ResourceComponents, error) { return nil, nil } -func (op Operator) GetStatus(ctx context.Context, component *walrus.ResourceComponents) ([]meta.Condition, error) { - // TODO: Implement this method after resource is migrated. +func (op Operator) Log(ctx context.Context, key string, opts resourcehandler.LogOptions) error { + return nil +} - return nil, nil +func (op Operator) Exec(ctx context.Context, key string, opts resourcehandler.ExecOptions) error { + return nil } diff --git a/pkg/resourcehandlers/google/resourcehandler.go b/pkg/resourcehandlers/google/resourcehandler.go index 917038ffc..8fb13f243 100644 --- a/pkg/resourcehandlers/google/resourcehandler.go +++ b/pkg/resourcehandlers/google/resourcehandler.go @@ -10,28 +10,21 @@ import ( meta "k8s.io/apimachinery/pkg/apis/meta/v1" walrus "github.com/seal-io/walrus/pkg/apis/walrus/v1" + walruscore "github.com/seal-io/walrus/pkg/apis/walruscore/v1" "github.com/seal-io/walrus/pkg/resourcehandler" gtypes "github.com/seal-io/walrus/pkg/resourcehandlers/google/types" - "github.com/seal-io/walrus/pkg/resourcehandlers/types" ) const OperatorType = resourcehandler.ConnectorTypeGoogle -// New returns resourcehandlers.ResourceHandler with the given options. -func New(ctx context.Context, opts resourcehandler.CreateOptions) (resourcehandler.ResourceHandler, error) { - name := opts.Connector.Name - config, err := types.GetConfigData(ctx, opts) - if err != nil { - return nil, err - } - - cred, err := gtypes.GetCredential(config) +func New(_ context.Context, connCfg walrus.ConnectorConfig) (resourcehandler.ResourceHandler, error) { + cred, err := gtypes.GetCredential(connCfg.Status.Data) if err != nil { return nil, err } return Operator{ - name: name, + name: connCfg.Name, cred: cred, identifier: stringx.SumBySHA256("google:", cred.Project, cred.Region, cred.Zone), }, nil @@ -69,30 +62,24 @@ func (op Operator) ID() string { return op.identifier } -// GetComponents implements resourcehandlers.ResourceHandler. -func (op Operator) GetComponents( - ctx context.Context, - resource *walrus.ResourceComponents, -) ([]*walrus.ResourceComponents, error) { +func (op Operator) GetKeys(ctx context.Context, resComps *walruscore.ResourceComponents) (*walruscore.ResourceComponentOperationKeys, error) { return nil, nil } -// Log implements resourcehandlers.ResourceHandler. -func (op Operator) Log(ctx context.Context, key string, opts resourcehandler.LogOptions) error { - return nil -} +func (op Operator) GetStatus(ctx context.Context, resComps *walruscore.ResourceComponents) ([]meta.Condition, error) { + // TODO: Implement this method after resource is migrated. -// Exec implements resourcehandlers.ResourceHandler. -func (op Operator) Exec(ctx context.Context, key string, opts resourcehandler.ExecOptions) error { - return nil + return nil, nil } -func (op Operator) GetKeys(ctx context.Context, component *walrus.ResourceComponents) (*resourcehandler.ResourceComponentOperationKeys, error) { +func (op Operator) GetComponents(ctx context.Context, resComps *walruscore.ResourceComponents) ([]*walruscore.ResourceComponents, error) { return nil, nil } -func (op Operator) GetStatus(ctx context.Context, component *walrus.ResourceComponents) ([]meta.Condition, error) { - // TODO: Implement this method after resource is migrated. +func (op Operator) Log(ctx context.Context, key string, opts resourcehandler.LogOptions) error { + return nil +} - return nil, nil +func (op Operator) Exec(ctx context.Context, key string, opts resourcehandler.ExecOptions) error { + return nil } diff --git a/pkg/resourcehandlers/k8s/driver.go b/pkg/resourcehandlers/k8s/driver.go index 42e4d045c..bda926423 100644 --- a/pkg/resourcehandlers/k8s/driver.go +++ b/pkg/resourcehandlers/k8s/driver.go @@ -1,7 +1,6 @@ package k8s import ( - "context" "fmt" "time" @@ -10,15 +9,14 @@ import ( "k8s.io/client-go/tools/clientcmd" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" - "github.com/seal-io/walrus/pkg/resourcehandler" - optypes "github.com/seal-io/walrus/pkg/resourcehandlers/types" + walrus "github.com/seal-io/walrus/pkg/apis/walrus/v1" ) // GetConfig returns the rest.Config with the given model, // by default, the rest.Config configures with 15s timeout/16 qps/64 burst, // please modify the default configuration with ConfigOption as need. -func GetConfig(ctx context.Context, createOpts resourcehandler.CreateOptions, opts ...func(*rest.Config)) (restConfig *rest.Config, err error) { - apiConfig, _, err := LoadApiConfig(ctx, createOpts) +func GetConfig(connCfg walrus.ConnectorConfig, opts ...func(*rest.Config)) (restConfig *rest.Config, err error) { + apiConfig, _, err := LoadApiConfig(connCfg) if err != nil { return nil, err } @@ -40,28 +38,22 @@ func GetConfig(ctx context.Context, createOpts resourcehandler.CreateOptions, op } // LoadApiConfig returns the api.Config with the given model. -func LoadApiConfig(ctx context.Context, opts resourcehandler.CreateOptions) (apiConfig *clientcmdapi.Config, raw string, err error) { - con := opts.Connector - version := con.Spec.Config.Version +func LoadApiConfig(connCfg walrus.ConnectorConfig) (apiConfig *clientcmdapi.Config, raw string, err error) { + version := connCfg.Status.Version switch version { default: return nil, "", fmt.Errorf("unknown config version: %v", version) case "v1": - config, err := optypes.GetConfigData(ctx, opts) - if err != nil { - return nil, "", fmt.Errorf("error get config data: %w", err) - } - // { // "configVersion": "v1", // "configData": { // "kubeconfig": "..." // } // }. - raw, err = loadRawConfigV1(config) + raw, err = loadRawConfigV1(connCfg.Status.Data) if err != nil { - return nil, "", fmt.Errorf("error load config from connector %s: %w", con.Name, err) + return nil, "", fmt.Errorf("error load config from connector %s: %w", connCfg.Name, err) } apiConfig, err = loadApiConfigV1(raw) diff --git a/pkg/resourcehandlers/k8s/resourcehandler.go b/pkg/resourcehandlers/k8s/resourcehandler.go index 8baa94cde..688c2cd78 100644 --- a/pkg/resourcehandlers/k8s/resourcehandler.go +++ b/pkg/resourcehandlers/k8s/resourcehandler.go @@ -15,14 +15,14 @@ import ( "k8s.io/klog/v2" walrus "github.com/seal-io/walrus/pkg/apis/walrus/v1" + walruscore "github.com/seal-io/walrus/pkg/apis/walruscore/v1" "github.com/seal-io/walrus/pkg/resourcehandler" ) const OperatorType = resourcehandler.ConnectorTypeKubernetes -// New returns resourcehandlers.ResourceHandler with the given options. -func New(ctx context.Context, opts resourcehandler.CreateOptions) (resourcehandler.ResourceHandler, error) { - restConfig, err := GetConfig(ctx, opts, func(c *rest.Config) { +func New(_ context.Context, connCfg walrus.ConnectorConfig) (resourcehandler.ResourceHandler, error) { + restConfig, err := GetConfig(connCfg, func(c *rest.Config) { c.Timeout = 0 }) if err != nil { @@ -77,12 +77,10 @@ type Operator struct { DynamicCli *dynamicclient.DynamicClient } -// Type implements resourcehandlers.ResourceHandler. func (Operator) Type() resourcehandler.Type { return OperatorType } -// IsConnected implements resourcehandlers.ResourceHandler. func (op Operator) IsConnected(ctx context.Context) error { ctx, cancel := context.WithTimeout(ctx, 5*time.Second) defer cancel() @@ -96,7 +94,6 @@ func (op Operator) IsConnected(ctx context.Context) error { return err } -// Burst implements resourcehandlers.ResourceHandler. func (op Operator) Burst() int { if op.RestConfig.Burst == 0 { return rest.DefaultBurst @@ -105,35 +102,28 @@ func (op Operator) Burst() int { return op.RestConfig.Burst } -// ID implements resourcehandlers.ResourceHandler. func (op Operator) ID() string { return op.Identifier } -// GetComponents implements resourcehandlers.ResourceHandler. -func (op Operator) GetComponents( - ctx context.Context, - resource *walrus.ResourceComponents, -) ([]*walrus.ResourceComponents, error) { +func (op Operator) GetKeys(ctx context.Context, resComps *walruscore.ResourceComponents) (*walruscore.ResourceComponentOperationKeys, error) { return nil, nil } -// Log implements resourcehandlers.ResourceHandler. -func (op Operator) Log(ctx context.Context, key string, opts resourcehandler.LogOptions) error { - return nil -} +func (op Operator) GetStatus(ctx context.Context, resComps *walruscore.ResourceComponents) ([]meta.Condition, error) { + // TODO: Implement this method after resource is migrated. -// Exec implements resourcehandlers.ResourceHandler. -func (op Operator) Exec(ctx context.Context, key string, opts resourcehandler.ExecOptions) error { - return nil + return nil, nil } -func (op Operator) GetKeys(ctx context.Context, component *walrus.ResourceComponents) (*resourcehandler.ResourceComponentOperationKeys, error) { +func (op Operator) GetComponents(ctx context.Context, resComps *walruscore.ResourceComponents) ([]*walruscore.ResourceComponents, error) { return nil, nil } -func (op Operator) GetStatus(ctx context.Context, component *walrus.ResourceComponents) ([]meta.Condition, error) { - // TODO: Implement this method after resource is migrated. +func (op Operator) Log(ctx context.Context, key string, opts resourcehandler.LogOptions) error { + return nil +} - return nil, nil +func (op Operator) Exec(ctx context.Context, key string, opts resourcehandler.ExecOptions) error { + return nil } diff --git a/pkg/resourcehandlers/registry.go b/pkg/resourcehandlers/registry.go index 939456fb4..9f60e24a6 100644 --- a/pkg/resourcehandlers/registry.go +++ b/pkg/resourcehandlers/registry.go @@ -4,6 +4,9 @@ import ( "context" "fmt" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + + walrus "github.com/seal-io/walrus/pkg/apis/walrus/v1" "github.com/seal-io/walrus/pkg/resourcehandler" "github.com/seal-io/walrus/pkg/resourcehandlers/alibaba" "github.com/seal-io/walrus/pkg/resourcehandlers/aws" @@ -12,36 +15,38 @@ import ( "github.com/seal-io/walrus/pkg/resourcehandlers/google" "github.com/seal-io/walrus/pkg/resourcehandlers/k8s" "github.com/seal-io/walrus/pkg/resourcehandlers/unknown" + "github.com/seal-io/walrus/pkg/system" ) -var opOperators map[resourcehandler.Type]resourcehandler.Creator - -func init() { - opOperators = map[resourcehandler.Type]resourcehandler.Creator{ - // Register resourcehandlers creators as below. - k8s.OperatorType: k8s.New, - aws.OperatorType: aws.New, - alibaba.OperatorType: alibaba.New, - azure.OperatorType: azure.New, - google.OperatorType: google.New, - docker.OperatorType: docker.New, - } +// NB(thxCode): Register creators below. +var creators = map[resourcehandler.Type]_ResourceHandlerCreator{ + k8s.OperatorType: k8s.New, + aws.OperatorType: aws.New, + alibaba.OperatorType: alibaba.New, + azure.OperatorType: azure.New, + google.OperatorType: google.New, + docker.OperatorType: docker.New, } -// Get returns ResourceHandler with the given CreateOptions. -func Get(ctx context.Context, opts resourcehandler.CreateOptions) (op resourcehandler.ResourceHandler, err error) { - f, exist := opOperators[opts.Connector.Spec.Type] +type _ResourceHandlerCreator func(context.Context, walrus.ConnectorConfig) (resourcehandler.ResourceHandler, error) + +// Get returns resourcehandler.ResourceHandler with the given options. +func Get(ctx context.Context, opts resourcehandler.GetOptions) (resourcehandler.ResourceHandler, error) { + create, exist := creators[opts.Type] if !exist { - // Try to create an any resourcehandlers. - op, err = unknown.New(ctx, opts) - if err != nil { - return nil, fmt.Errorf("unknown resourcehandlers: %s", opts.Connector.Spec.Type) - } - } else { - op, err = f(ctx, opts) - if err != nil { - return nil, fmt.Errorf("error connecting %s resourcehandlers: %w", opts.Connector.Spec.Type, err) - } + return unknown.Operator{}, nil + } + + loopbackKubeCli := system.LoopbackKubeClient.Get() + connConfig, err := loopbackKubeCli.WalrusV1().Connectors(opts.Connector.Namespace). + GetConfig(ctx, opts.Connector.Name, meta.GetOptions{}) + if err != nil { + return nil, fmt.Errorf("get connector config: %w", err) + } + + op, err := create(ctx, *connConfig) + if err != nil { + return nil, fmt.Errorf("create resourcehandlers for type %s: %w", opts.Type, err) } return op, nil diff --git a/pkg/resourcehandlers/types/util.go b/pkg/resourcehandlers/types/util.go deleted file mode 100644 index 5bb8c03e0..000000000 --- a/pkg/resourcehandlers/types/util.go +++ /dev/null @@ -1,31 +0,0 @@ -package types - -import ( - "context" - "fmt" - - core "k8s.io/api/core/v1" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - ctrlcli "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/seal-io/walrus/pkg/resourcehandler" - "github.com/seal-io/walrus/pkg/system" -) - -func GetConfigData(ctx context.Context, opts resourcehandler.CreateOptions) (map[string][]byte, error) { - con := opts.Connector - - sec := &core.Secret{ - ObjectMeta: meta.ObjectMeta{ - Namespace: con.Namespace, - Name: con.Spec.SecretName, - }, - } - - cli := system.LoopbackCtrlClient.Get() - err := cli.Get(ctx, ctrlcli.ObjectKeyFromObject(sec), sec) - if err != nil { - return nil, fmt.Errorf("error get secret %s: %w", sec.Name, err) - } - return sec.Data, nil -} diff --git a/pkg/resourcehandlers/unknown/resourcehandler.go b/pkg/resourcehandlers/unknown/resourcehandler.go index 3decfa925..58675071f 100644 --- a/pkg/resourcehandlers/unknown/resourcehandler.go +++ b/pkg/resourcehandlers/unknown/resourcehandler.go @@ -2,26 +2,15 @@ package unknown import ( "context" - "errors" meta "k8s.io/apimachinery/pkg/apis/meta/v1" - walrus "github.com/seal-io/walrus/pkg/apis/walrus/v1" walruscore "github.com/seal-io/walrus/pkg/apis/walruscore/v1" "github.com/seal-io/walrus/pkg/resourcehandler" ) const OperatorType = "Unknown" -// New returns types.ResourceHandler with the given options. -func New(ctx context.Context, opts resourcehandler.CreateOptions) (resourcehandler.ResourceHandler, error) { - if opts.Connector.Spec.Category != walruscore.ConnectorCategoryCustom { - return nil, errors.New("not custom connector") - } - - return Operator{}, nil -} - type Operator struct{} func (Operator) Type() resourcehandler.Type { @@ -40,27 +29,24 @@ func (op Operator) ID() string { return "" } -func (op Operator) GetComponents( - ctx context.Context, - resource *walrus.ResourceComponents, -) ([]*walrus.ResourceComponents, error) { +func (op Operator) GetKeys(ctx context.Context, resComps *walruscore.ResourceComponents) (*walruscore.ResourceComponentOperationKeys, error) { return nil, nil } -func (Operator) Log(ctx context.Context, key string, opts resourcehandler.LogOptions) error { - return nil -} +func (op Operator) GetStatus(ctx context.Context, resComps *walruscore.ResourceComponents) ([]meta.Condition, error) { + // TODO: Implement this method after resource is migrated. -func (Operator) Exec(ctx context.Context, key string, opts resourcehandler.ExecOptions) error { - return nil + return nil, nil } -func (op Operator) GetKeys(ctx context.Context, component *walrus.ResourceComponents) (*resourcehandler.ResourceComponentOperationKeys, error) { +func (op Operator) GetComponents(ctx context.Context, resComps *walruscore.ResourceComponents) ([]*walruscore.ResourceComponents, error) { return nil, nil } -func (op Operator) GetStatus(ctx context.Context, component *walrus.ResourceComponents) ([]meta.Condition, error) { - // TODO: Implement this method after resource is migrated. +func (Operator) Log(ctx context.Context, key string, opts resourcehandler.LogOptions) error { + return nil +} - return nil, nil +func (Operator) Exec(ctx context.Context, key string, opts resourcehandler.ExecOptions) error { + return nil } diff --git a/pkg/resourcehandlers/validate.go b/pkg/resourcehandlers/validate.go deleted file mode 100644 index 63e5d3264..000000000 --- a/pkg/resourcehandlers/validate.go +++ /dev/null @@ -1,35 +0,0 @@ -package resourcehandlers - -import ( - "context" - "errors" - "fmt" - - ctrlcli "sigs.k8s.io/controller-runtime/pkg/client" - - walruscore "github.com/seal-io/walrus/pkg/apis/walruscore/v1" - "github.com/seal-io/walrus/pkg/resourcehandler" -) - -func IsConnected(ctx context.Context, conn *walruscore.Connector, client ctrlcli.Client) error { - switch conn.Spec.Category { - case walruscore.ConnectorCategoryKubernetes, walruscore.ConnectorCategoryCloudProvider: - op, err := Get(ctx, resourcehandler.CreateOptions{ - Connector: *conn, - }) - if err != nil { - return err - } - - if err = op.IsConnected(ctx); err != nil { - return fmt.Errorf("unreachable connector: %w", err) - } - - case walruscore.ConnectorCategoryCustom: - - default: - return errors.New("invalid connector category") - } - - return nil -} diff --git a/pkg/systemauthz/kuberes.go b/pkg/systemauthz/kuberes.go index 44647a120..fe5289283 100644 --- a/pkg/systemauthz/kuberes.go +++ b/pkg/systemauthz/kuberes.go @@ -104,9 +104,14 @@ func Initialize(ctx context.Context, cli clientset.Interface) error { "projects", "projects/subjects", "resources", - "resources/components", + "resourcescomponents", "resourcedefinitions", + "resourcedefinitionmatchingrules", + "resourcehooks", "resourceruns", + "resourcerunsteptemplates", + "resourceruntemplates", + "schema", "settings", "subjects", // "subjectproviders", // NB(thxCode): Not included. @@ -146,6 +151,7 @@ func Initialize(ctx context.Context, cli clientset.Interface) error { }, Resources: []string{ "resources", + "schema", }, Verbs: []string{ "get", @@ -209,10 +215,17 @@ func Initialize(ctx context.Context, cli clientset.Interface) error { Resources: []string{ "catalogs", "connectors", + "connectors/config", + "connectorbindings", "environments", "resources", - "resources/components", + "resourcescomponents", "resourcedefinitions", + "resourcedefinitionmatchingrules", + "resourcehooks", + "resourceruns", + "resourcerunsteptemplates", + "resourceruntemplates", "templates", "variables", }, @@ -238,14 +251,21 @@ func Initialize(ctx context.Context, cli clientset.Interface) error { Resources: []string{ "catalogs", "connectors", + "connectors/config", + "connectorbindings", "environments", "fileexamples", "projects", "projects/subjects", "resources", - "resources/components", + "resourcescomponents", "resourcedefinitions", + "resourcedefinitionmatchingrules", + "resourcehooks", "resourceruns", + "resourcerunsteptemplates", + "resourceruntemplates", + "schema", "settings", "subjects", "subjectproviders", diff --git a/pkg/systemkuberes/connector.go b/pkg/systemkuberes/connector.go index 16c399027..881815adb 100644 --- a/pkg/systemkuberes/connector.go +++ b/pkg/systemkuberes/connector.go @@ -5,7 +5,7 @@ import ( "fmt" dtypes "github.com/docker/docker/api/types" - "github.com/docker/docker/client" + dclient "github.com/docker/docker/client" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/clientcmd" @@ -26,42 +26,47 @@ func installDefaultKubernetesConnector( ) (*walrus.Connector, error) { connCli := cli.WalrusV1().Connectors(project) - config, err := readKubeConfig() + config, err := readLoopbackKubeConfig() if err != nil { return nil, fmt.Errorf("read kube config: %w", err) } - c := &walrus.Connector{ + eConn := &walrus.Connector{ ObjectMeta: meta.ObjectMeta{ Namespace: project, Name: DefaultConnectorName, }, Spec: walruscore.ConnectorSpec{ + ApplicableEnvironmentType: envType, + Category: walruscore.ConnectorCategoryKubernetes, Type: resourcehandler.ConnectorTypeKubernetes, Description: "Local Kubernetes", - Category: walruscore.ConnectorCategoryKubernetes, - ApplicableEnvironmentType: envType, Config: walruscore.ConnectorConfig{ Version: "v1", Data: map[string]walruscore.ConnectorConfigEntry{ "kubeconfig": { - Value: config, - Visible: false, + Value: config, + Sensitive: true, }, }, }, }, } + alignFn := func(aConn *walrus.Connector) (*walrus.Connector, bool, error) { + aConn.Spec.Config = eConn.Spec.Config + return aConn, false, nil + } - conn, err := kubeclientset.Update(ctx, connCli, c, kubeclientset.WithCreateIfNotExisted[*walrus.Connector]()) + eConn, err = kubeclientset.Create(ctx, connCli, eConn, + kubeclientset.WithUpdateIfExisted(alignFn)) if err != nil { return nil, fmt.Errorf("install default kubernetes connector: %w", err) } - return conn, nil + return eConn, nil } -func readKubeConfig() (string, error) { +func readLoopbackKubeConfig() (string, error) { kubeConfig := system.LoopbackKubeClientConfig.Get() kc, err := kubeconfig.ConvertRestConfigToApiConfig(&kubeConfig) @@ -85,64 +90,67 @@ func installDefaultDockerConnector( ) (*walrus.Connector, error) { connCli := cli.WalrusV1().Connectors(project) - c := &walrus.Connector{ + eConn := &walrus.Connector{ ObjectMeta: meta.ObjectMeta{ Namespace: project, Name: DefaultConnectorName, }, Spec: walruscore.ConnectorSpec{ - Type: resourcehandler.ConnectorTypeDocker, - Category: walruscore.ConnectorCategoryDocker, ApplicableEnvironmentType: envType, + Category: walruscore.ConnectorCategoryDocker, + Type: resourcehandler.ConnectorTypeDocker, + Description: "Local Docker", Config: walruscore.ConnectorConfig{ Version: "v1", Data: map[string]walruscore.ConnectorConfigEntry{}, }, }, } + alignFn := func(aConn *walrus.Connector) (*walrus.Connector, bool, error) { + aConn.Spec.Config = eConn.Spec.Config + return aConn, false, nil + } - conn, err := kubeclientset.Create(ctx, connCli, c) + eConn, err := kubeclientset.Create(ctx, connCli, eConn, + kubeclientset.WithUpdateIfExisted(alignFn)) if err != nil { return nil, fmt.Errorf("install default docker connector: %w", err) } - if err := applyLocalDockerNetwork(ctx); err != nil { - return nil, fmt.Errorf("apply local docker network: %w", err) + if err = applyLoopbackDockerNetwork(ctx); err != nil { + return nil, fmt.Errorf("apply docker network: %w", err) } - return conn, nil + return eConn, nil } -func applyLocalDockerNetwork(ctx context.Context) error { - cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation()) +func applyLoopbackDockerNetwork(ctx context.Context) error { + cli, err := dclient.NewClientWithOpts(dclient.FromEnv, dclient.WithAPIVersionNegotiation()) if err != nil { return err } - networkName := "local-walrus" - - networks, err := cli.NetworkList(ctx, dtypes.NetworkListOptions{}) - if err != nil { - return err - } - - exists := false - - for _, n := range networks { - if n.Name == networkName { - exists = true - break - } + nw := &dtypes.NetworkResource{ + Name: "local-walrus", } - - if !exists { - _, err = cli.NetworkCreate(ctx, networkName, dtypes.NetworkCreate{ - Driver: "bridge", - }) + { + nws, err := cli.NetworkList(ctx, dtypes.NetworkListOptions{}) if err != nil { return err } + for i := range nws { + if nws[i].Name == nw.Name { + nw = &nws[i] + break + } + } + } + if nw.ID != "" { + return nil } - return nil + _, err = cli.NetworkCreate(ctx, nw.Name, dtypes.NetworkCreate{ + Driver: "bridge", + }) + return err } diff --git a/pkg/systemkuberes/environment.go b/pkg/systemkuberes/environment.go index c86f90def..a30557154 100644 --- a/pkg/systemkuberes/environment.go +++ b/pkg/systemkuberes/environment.go @@ -98,9 +98,13 @@ func InstallDefaultEnvironment(ctx context.Context, cli clientset.Interface) err Name: DefaultConnectorName, }, Spec: walruscore.ConnectorBindingSpec{ - Connector: walruscore.ConnectorReference{ - Name: conn.Name, - Namespace: conn.Namespace, + Connector: walruscore.ConnectorReferenceWithType{ + ConnectorReference: walruscore.ConnectorReference{ + Namespace: conn.Namespace, + Name: conn.Name, + }, + Category: conn.Spec.Category, + Type: conn.Spec.Type, }, }, } diff --git a/pkg/systemmeta/lock.go b/pkg/systemmeta/lock.go index f9ee16042..e09ccf4a3 100644 --- a/pkg/systemmeta/lock.go +++ b/pkg/systemmeta/lock.go @@ -55,3 +55,15 @@ func Unlock(obj MetaObject) (unlocked bool) { obj.SetFinalizers(fs2) return false } + +// IsLocked returns true if the resource is locked by system. +func IsLocked(obj MetaObject) (locked bool) { + if obj == nil { + panic("object is nil") + } + + fs := obj.GetFinalizers() + return slices.IndexFunc(fs, func(s string) bool { + return s == LockedResourceFinalizer + }) != -1 +} diff --git a/pkg/templates/fetchers/vcsrepo/fetcher.go b/pkg/templates/fetchers/vcsrepo/fetcher.go index 294658fed..cebebd58d 100644 --- a/pkg/templates/fetchers/vcsrepo/fetcher.go +++ b/pkg/templates/fetchers/vcsrepo/fetcher.go @@ -5,19 +5,15 @@ import ( "net/url" "os" "path/filepath" + "sort" "time" "github.com/go-git/go-git/v5" "github.com/seal-io/utils/stringx" - kerrors "k8s.io/apimachinery/pkg/api/errors" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "golang.org/x/exp/maps" "k8s.io/klog/v2" - "k8s.io/utils/set" walruscore "github.com/seal-io/walrus/pkg/apis/walruscore/v1" - "github.com/seal-io/walrus/pkg/apistatus" - "github.com/seal-io/walrus/pkg/system" - "github.com/seal-io/walrus/pkg/systemmeta" "github.com/seal-io/walrus/pkg/systemsetting" "github.com/seal-io/walrus/pkg/templates/api" "github.com/seal-io/walrus/pkg/templates/kubehelper" @@ -31,12 +27,12 @@ func New() *Fetcher { return &Fetcher{} } -// Fetch the template info and fill in to template status it. -func (l *Fetcher) Fetch(ctx context.Context, obj *walruscore.Template) (*walruscore.Template, error) { +// Fetch fills the template status. +func (l *Fetcher) Fetch(ctx context.Context, tmpl *walruscore.Template) (*walruscore.Template, error) { tempDir := filepath.Join(os.TempDir(), "seal-template-"+stringx.RandomHex(10)) defer os.RemoveAll(tempDir) - source := obj.Spec.VCSRepository + source := tmpl.Spec.VCSRepository // Clone. { @@ -64,104 +60,63 @@ func (l *Fetcher) Fetch(ctx context.Context, obj *walruscore.Template) (*walrusc return nil, err } - // Icon. - iconURL, err := gitRepoIconURL(r, source.URL) - if err != nil { - return nil, err - } - - // Versions. - versions, versionSchema, err := getVersions(obj, r) - if err != nil { - return nil, err - } + // Get URL. + tmpl.Status.URL = source.URL - // Skip template without valid version. - if len(versions) == 0 { - return nil, nil - } - - // Ensure template before create schema. - obj, err = getOrCreateTemplate(ctx, obj) - if err != nil { - return nil, err - } - - templateVersions, err := genTemplateVersions(ctx, obj, versions, versionSchema) - if err != nil { - return nil, err - } - - // Set template status. - apistatus.TemplateConditionReady.True(obj, "", "") - obj.Status.Project = systemmeta.GetProjectName(obj.Namespace) - obj.Status.LastSyncTime = meta.Now() - obj.Status.URL = source.URL - obj.Status.Icon = iconURL - obj.Status.Versions = templateVersions - - err = updateTemplateStatus(ctx, obj) - return obj, err -} - -func updateTemplateStatus(ctx context.Context, obj *walruscore.Template) error { - loopbackKubeClient := system.LoopbackKubeClient.Get() - - existed, err := loopbackKubeClient.WalruscoreV1().Templates(obj.Namespace).Get(ctx, obj.Name, meta.GetOptions{}) - if err != nil { - return err - } - - newSet := set.Set[string]{} - for _, v := range obj.Status.Versions { - newSet.Insert(v.Version) - } - - // Set of versions are removed. - var removed []walruscore.TemplateVersion - for i, v := range existed.Status.Versions { - if !newSet.Has(v.Version) { - existed.Status.Versions[i].Removed = true - removed = append(removed, existed.Status.Versions[i]) + // Get icon. + { + icon, err := gitRepoIconURL(r, source.URL) + if err != nil { + return nil, err } + tmpl.Status.Icon = icon } - // Update template status. - existed.Status = obj.Status - existed.Status.ConditionSummary = *apistatus.WalkTemplate(&existed.Status.StatusDescriptor) - existed.Status.Versions = append(existed.Status.Versions, removed...) - _, err = loopbackKubeClient.WalruscoreV1().Templates(existed.Namespace).UpdateStatus(ctx, existed, meta.UpdateOptions{}) - return err -} - -// getOrCreateTemplate get or create template. -func getOrCreateTemplate(ctx context.Context, obj *walruscore.Template) (*walruscore.Template, error) { - loopbackKubeClient := system.LoopbackKubeClient.Get() - - existed, err := loopbackKubeClient.WalruscoreV1().Templates(obj.Namespace).Get(ctx, obj.Name, meta.GetOptions{}) - if err != nil { - if !kerrors.IsNotFound(err) { + // Get versions. + { + vers, versionSchema, err := getVersions(tmpl, r) + if err != nil { return nil, err } - - // Create template. - existed, err = loopbackKubeClient.WalruscoreV1().Templates(obj.Namespace).Create(ctx, obj, meta.CreateOptions{}) - if err != nil && !kerrors.IsAlreadyExists(err) { + tmplVers, err := genTemplateVersions(ctx, tmpl, vers, versionSchema) + if err != nil { return nil, err } - - return existed, nil + // Index remote versions. + tmplVersReverseIndexer := make(map[string]int) + for i, v := range tmplVers { + tmplVersReverseIndexer[v.Version] = i + } + // Mark removed versions. + for i := range tmpl.Status.Versions { + if _, ok := tmplVersReverseIndexer[tmpl.Status.Versions[i].Version]; ok { + delete(tmplVersReverseIndexer, tmpl.Status.Versions[i].Version) + continue + } + tmpl.Status.Versions[i].Removed = true + } + // Append new versions. + newTmplVersIndexes := maps.Values(tmplVersReverseIndexer) + sort.Ints(newTmplVersIndexes) + for _, i := range newTmplVersIndexes { + tmpl.Status.Versions = append(tmpl.Status.Versions, tmplVers[i]) + } } - return existed, nil + + return tmpl, nil } -// genTemplateVersionsFromGitRepo retrieves template versions from a git repository. +// genTemplateVersions retrieves template versions from a git repository. func genTemplateVersions( ctx context.Context, obj *walruscore.Template, versions []string, versionSchema map[string]*api.SchemaGroup, ) ([]walruscore.TemplateVersion, error) { + if len(versions) == 0 { + return nil, nil + } + var ( logger = klog.NewStandardLogger("WARNING") tvs = make([]walruscore.TemplateVersion, 0, len(versionSchema)) diff --git a/pkg/templates/listers/vcssource/lister.go b/pkg/templates/listers/vcssource/lister.go index 7107775f1..3b4a24527 100644 --- a/pkg/templates/listers/vcssource/lister.go +++ b/pkg/templates/listers/vcssource/lister.go @@ -7,12 +7,10 @@ import ( "github.com/drone/go-scm/scm" "github.com/seal-io/utils/version" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/validation" "k8s.io/klog/v2" - walrus "github.com/seal-io/walrus/pkg/apis/walrus/v1" walruscore "github.com/seal-io/walrus/pkg/apis/walruscore/v1" - "github.com/seal-io/walrus/pkg/kubemeta" - "github.com/seal-io/walrus/pkg/systemmeta" "github.com/seal-io/walrus/pkg/systemsetting" "github.com/seal-io/walrus/pkg/templates/kubehelper" "github.com/seal-io/walrus/pkg/vcs" @@ -27,11 +25,11 @@ func New() *Lister { type Lister struct{} // List returns a list of templates from the given catalog. -func (l *Lister) List(ctx context.Context, c *walruscore.Catalog) ([]walruscore.Template, error) { +func (l *Lister) List(ctx context.Context, cat *walruscore.Catalog) ([]walruscore.Template, error) { logger := klog.Background().WithName("vcs").WithName("lister") var ( - source = c.Spec.VCSSource + source = cat.Spec.VCSSource repos []*scm.Repository filteredRepos []*scm.Repository tmpls []walruscore.Template @@ -48,7 +46,7 @@ func (l *Lister) List(ctx context.Context, c *walruscore.Catalog) ([]walruscore. if err != nil { return nil, err } - logger.Infof("found %d repositories in %s/%s before filtered", len(repos), c.Namespace, c.Name) + logger.Infof("found %d repositories in %s/%s before filtered", len(repos), cat.Namespace, cat.Name) } // Filtering. @@ -59,14 +57,13 @@ func (l *Lister) List(ctx context.Context, c *walruscore.Catalog) ([]walruscore. err error ) - if filters := c.Spec.Filters; filters != nil { + if filters := cat.Spec.Filters; filters != nil { if filters.IncludeExpression != "" { includeReg, err = regexp.Compile(filters.IncludeExpression) if err != nil { return nil, err } } - if filters.ExcludeExpression != "" { excludeReg, err = regexp.Compile(filters.ExcludeExpression) if err != nil { @@ -78,13 +75,22 @@ func (l *Lister) List(ctx context.Context, c *walruscore.Catalog) ([]walruscore. for i := range repos { repo := repos[i] - if includeReg != nil && !includeReg.MatchString(repo.Name) { + switch { + case repo.Name == "": + logger.Info("repository name is empty, skip") + continue + case len(validation.IsDNS1123Subdomain(repo.Name)) != 0: + logger.Info("repository name is not a lowercase RFC 1123 subdomain name, skip", "repo", repo.Name) continue } + if includeReg != nil && !includeReg.MatchString(repo.Name) { + continue + } if excludeReg != nil && excludeReg.MatchString(repo.Name) { continue } + filteredRepos = append(filteredRepos, repo) } } @@ -95,32 +101,26 @@ func (l *Lister) List(ctx context.Context, c *walruscore.Catalog) ([]walruscore. for i := range filteredRepos { repo := filteredRepos[i] - t := walruscore.Template{ + tmpl := walruscore.Template{ ObjectMeta: metav1.ObjectMeta{ - Namespace: c.Namespace, - Name: kubehelper.NormalizeTemplateName(c.Name, repo.Name), - Labels: GenWalrusBuiltinLabels(repo.Topics, c.Name), + Namespace: cat.Namespace, + Name: kubehelper.NormalizeTemplateName(cat.Name, repo.Name), + Labels: GenWalrusBuiltinLabels(repo.Topics, cat.Name), }, Spec: walruscore.TemplateSpec{ - TemplateFormat: c.Spec.TemplateFormat, + TemplateFormat: cat.Spec.TemplateFormat, Description: repo.Description, VCSRepository: &walruscore.VCSRepository{ - Platform: c.Spec.VCSSource.Platform, + Platform: cat.Spec.VCSSource.Platform, URL: repo.Link, }, }, - Status: walruscore.TemplateStatus{ - OriginalName: repo.Name, - Project: systemmeta.GetProjectName(c.Namespace), - }, } - kubemeta.ControlOn(&t, c, walrus.SchemeGroupVersion.WithKind("Catalog")) - - tmpls[i] = t + tmpls[i] = tmpl } - logger.Infof("found %d repositories in %s/%s after filtered", len(tmpls), c.Namespace, c.Name) + logger.Infof("found %d repositories in %s/%s after filtered", len(tmpls), cat.Namespace, cat.Name) } return tmpls, nil diff --git a/pkg/webhooks/walruscore/catalog.go b/pkg/webhooks/walruscore/catalog.go index 90b062202..4e6d106a1 100644 --- a/pkg/webhooks/walruscore/catalog.go +++ b/pkg/webhooks/walruscore/catalog.go @@ -2,6 +2,7 @@ package walruscore import ( "context" + "reflect" "regexp" "k8s.io/apimachinery/pkg/runtime" @@ -10,6 +11,7 @@ import ( ctrladmission "sigs.k8s.io/controller-runtime/pkg/webhook/admission" walruscore "github.com/seal-io/walrus/pkg/apis/walruscore/v1" + "github.com/seal-io/walrus/pkg/apistatus" "github.com/seal-io/walrus/pkg/webhook" ) @@ -17,7 +19,7 @@ import ( // // nolint: lll // +k8s:webhook-gen:validating:group="walruscore.seal.io",version="v1",resource="catalogs",scope="Namespaced" -// +k8s:webhook-gen:validating:operations=["CREATE","UPDATE","DELETE"],failurePolicy="Fail",sideEffects="None",matchPolicy="Equivalent",timeoutSeconds=10 +// +k8s:webhook-gen:validating:operations=["CREATE","UPDATE"],failurePolicy="Fail",sideEffects="None",matchPolicy="Equivalent",timeoutSeconds=10,subResources=["status"] type CatalogWebhook struct { webhook.DefaultCustomValidator } @@ -29,37 +31,103 @@ func (r *CatalogWebhook) SetupWebhook(_ context.Context, opts webhook.SetupOptio var _ ctrlwebhook.CustomValidator = (*CatalogWebhook)(nil) func (r *CatalogWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (ctrladmission.Warnings, error) { - return r.validateFilter(obj) + cat := obj.(*walruscore.Catalog) + + // Validate filters. + if err := r.validateFilters(cat); err != nil { + return nil, err + } + + return nil, nil } func (r *CatalogWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (ctrladmission.Warnings, error) { - return r.validateFilter(newObj) -} + oldCat, newCat := oldObj.(*walruscore.Catalog), newObj.(*walruscore.Catalog) + + // Validate immutable fields. + if err := r.validateImmutables(oldCat, newCat); err != nil { + return nil, err + } + + // Validate filters. + if err := r.validateFilters(newCat); err != nil { + return nil, err + } + + // Validate conditions. + if err := r.validateConditions(oldCat, newCat); err != nil { + return nil, err + } -func (r *CatalogWebhook) ValidateDelete(ctx context.Context, obj runtime.Object) (ctrladmission.Warnings, error) { - // TODO(michelia): add validate to prevent deletion of catalog depended by resource definition/resource/resource run. return nil, nil } -func (r *CatalogWebhook) validateFilter(obj runtime.Object) (ctrladmission.Warnings, error) { - c := obj.(*walruscore.Catalog) - - filters := c.Spec.Filters +func (r *CatalogWebhook) validateFilters(cat *walruscore.Catalog) error { + filters := cat.Spec.Filters if filters == nil { - return nil, nil + return nil } if filters.IncludeExpression != "" { if _, err := regexp.Compile(filters.IncludeExpression); err != nil { - return nil, field.Invalid( + return field.Invalid( field.NewPath("spec.filters.includeExpression"), filters.IncludeExpression, err.Error()) } } if filters.ExcludeExpression != "" { if _, err := regexp.Compile(filters.ExcludeExpression); err != nil { - return nil, field.Invalid( + return field.Invalid( field.NewPath("spec.filters.excludeExpression"), filters.ExcludeExpression, err.Error()) } } - return nil, nil + return nil +} + +func (r *CatalogWebhook) validateImmutables(oldCat, newCat *walruscore.Catalog) error { + if oldCat.Spec.Builtin != newCat.Spec.Builtin { + return field.Invalid( + field.NewPath("spec.builtin"), oldCat.Spec.Builtin, "field is immutable") + } + if oldCat.Spec.TemplateFormat != newCat.Spec.TemplateFormat { + return field.Invalid( + field.NewPath("spec.templateFormat"), oldCat.Spec.TemplateFormat, "field is immutable") + } + if !reflect.DeepEqual(oldCat.Spec.Filters, newCat.Spec.Filters) { + return field.Invalid( + field.NewPath("spec.filters"), oldCat.Spec.Filters, "field is immutable") + } + if !reflect.DeepEqual(oldCat.Spec.VCSSource, newCat.Spec.VCSSource) { + return field.Invalid( + field.NewPath("spec.vcsSource"), oldCat.Spec.VCSSource, "field is immutable") + } + return nil +} + +func (r *CatalogWebhook) validateConditions(oldCat, newCat *walruscore.Catalog) error { + switch { + case oldCat.Generation != newCat.Generation: + return nil + case apistatus.CatalogConditionFetched.IsUnknown(newCat): + if len(oldCat.Status.Conditions) == 0 || + apistatus.CatalogConditionFetched.IsFalse(oldCat) || + apistatus.CatalogConditionSyncedTemplates.IsTrueOrFalse(oldCat) { + return nil + } + return field.Invalid( + field.NewPath("status.conditions"), newCat.Status.Conditions, "previous fetching/syncing templates has not been completed yet") + case apistatus.CatalogConditionSyncedTemplates.IsUnknown(newCat): + if apistatus.CatalogConditionFetched.IsTrue(oldCat) { + // Resync if previous fetching has been completed yet. + return nil + } + return field.Invalid( + field.NewPath("status.conditions"), newCat.Status.Conditions, "previous fetching has not been completed yet") + case apistatus.CatalogConditionDeleting.Exists(newCat): + if newCat.DeletionTimestamp != nil { + return nil + } + return field.Invalid( + field.NewPath("status.conditions"), newCat.Status.Conditions, "deletion has not been requested yet") + } + return nil } diff --git a/pkg/webhooks/walruscore/connector.go b/pkg/webhooks/walruscore/connector.go index 678a62e0e..731f44325 100644 --- a/pkg/webhooks/walruscore/connector.go +++ b/pkg/webhooks/walruscore/connector.go @@ -6,36 +6,38 @@ import ( "reflect" "github.com/seal-io/utils/stringx" + "golang.org/x/exp/maps" core "k8s.io/api/core/v1" + kerrors "k8s.io/apimachinery/pkg/api/errors" meta "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/validation/field" + "k8s.io/utils/ptr" ctrlcli "sigs.k8s.io/controller-runtime/pkg/client" ctrllog "sigs.k8s.io/controller-runtime/pkg/log" ctrlwebhook "sigs.k8s.io/controller-runtime/pkg/webhook" ctrladmission "sigs.k8s.io/controller-runtime/pkg/webhook/admission" walruscore "github.com/seal-io/walrus/pkg/apis/walruscore/v1" + "github.com/seal-io/walrus/pkg/apistatus" "github.com/seal-io/walrus/pkg/kubeclientset" "github.com/seal-io/walrus/pkg/kubemeta" - "github.com/seal-io/walrus/pkg/resourcehandlers" "github.com/seal-io/walrus/pkg/webhook" ) // ConnectorWebhook hooks a v1.Connector object. // // nolint: lll -// +k8s:webhook-gen:mutating:group="walruscore.seal.io",version="v1",resource="connectors",scope="Namespaced" -// +k8s:webhook-gen:mutating:operations=["CREATE","UPDATE"],failurePolicy="Fail",sideEffects="NoneOnDryRun",matchPolicy="Equivalent",timeoutSeconds=10 // +k8s:webhook-gen:validating:group="walruscore.seal.io",version="v1",resource="connectors",scope="Namespaced",subResources=["status"] // +k8s:webhook-gen:validating:operations=["CREATE","UPDATE","DELETE"],failurePolicy="Fail",sideEffects="None",matchPolicy="Equivalent",timeoutSeconds=10 +// +k8s:webhook-gen:mutating:group="walruscore.seal.io",version="v1",resource="connectors",scope="Namespaced" +// +k8s:webhook-gen:mutating:operations=["CREATE","UPDATE"],failurePolicy="Fail",sideEffects="NoneOnDryRun",matchPolicy="Equivalent",timeoutSeconds=10 type ConnectorWebhook struct { - client ctrlcli.Client + Client ctrlcli.Client } func (r *ConnectorWebhook) SetupWebhook(_ context.Context, opts webhook.SetupOptions) (runtime.Object, error) { - r.client = opts.Manager.GetClient() + r.Client = opts.Manager.GetClient() return &walruscore.Connector{}, nil } @@ -43,38 +45,39 @@ func (r *ConnectorWebhook) SetupWebhook(_ context.Context, opts webhook.SetupOpt var _ ctrlwebhook.CustomValidator = (*ConnectorWebhook)(nil) func (r *ConnectorWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (ctrladmission.Warnings, error) { - logger := ctrllog.FromContext(ctx) - conn := obj.(*walruscore.Connector) - if stringx.StringWidth(conn.Name) > 30 { - err := r.deleteSecret(ctx, conn) - if err != nil { - logger.Error(err, "failed to delete secret") + err := func() error { + // Validate connector name. + if stringx.StringWidth(conn.Name) > 30 { + return field.TooLongMaxLength( + field.NewPath("name"), stringx.StringWidth(conn.Name), 30) } - - return nil, field.TooLongMaxLength(field.NewPath("name"), stringx.StringWidth(conn.Name), 30) - } - - err := resourcehandlers.IsConnected(ctx, conn, r.client) - if err != nil { - derr := r.deleteSecret(ctx, conn) - if derr != nil { - logger.Error(derr, "failed to delete secret") + // Validate connector secret name. + if conn.Spec.SecretName == "" { + return field.Required(field.NewPath("spec.secretName"), "transferred secret name is required") } - - return nil, err + return nil + }() + if err != nil { + return r.revokeTransferredSecret(ctx, conn), err } - return nil, nil } func (r *ConnectorWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (ctrladmission.Warnings, error) { - conn := newObj.(*walruscore.Connector) - if !reflect.DeepEqual(oldObj.(*walruscore.Connector).Spec, conn.Spec) { - err := resourcehandlers.IsConnected(ctx, conn, r.client) - if err != nil { - return nil, err + oldConn, newConn := oldObj.(*walruscore.Connector), newObj.(*walruscore.Connector) + + // Validate immutable fields. + if err := r.validateImmutables(oldConn, newConn); err != nil { + if oldConn.Spec.SecretName != newConn.Spec.SecretName { + return r.revokeTransferredSecret(ctx, newConn), err } + return nil, err + } + + // Validate conditions. + if err := r.validateConditions(oldConn, newConn); err != nil { + return nil, err } return nil, nil @@ -82,77 +85,180 @@ func (r *ConnectorWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj ru func (r *ConnectorWebhook) ValidateDelete(ctx context.Context, obj runtime.Object) (ctrladmission.Warnings, error) { conn := obj.(*walruscore.Connector) - labelSelector := labels.SelectorFromSet(labels.Set{ - "walrus.seal.io/connector": fmt.Sprintf("%s-%s", conn.Namespace, conn.Name), - }) + // Cannot delete the connector if it is in use. cbList := new(walruscore.ConnectorBindingList) - err := r.client.List(ctx, cbList, ctrlcli.MatchingLabelsSelector{Selector: labelSelector}) + err := r.Client.List(ctx, cbList, + ctrlcli.MatchingLabels{ + "spec.connector": kubemeta.GetNamespacedNameKey(conn), + }) if err != nil { - return nil, err + return nil, kerrors.NewInternalError(fmt.Errorf("list related connector binding: %w", err)) } - if len(cbList.Items) > 0 { - return nil, field.Forbidden(field.NewPath("metadata", "name"), fmt.Sprintf("used by environment %s", cbList.Items[0].Namespace)) + return nil, field.Invalid( + field.NewPath("metadata.name"), conn.GetName(), "blocked by in-used connector bindings") } return nil, nil } +func (r *ConnectorWebhook) validateImmutables(oldConn, newConn *walruscore.Connector) error { + if oldConn.Spec.ApplicableEnvironmentType != newConn.Spec.ApplicableEnvironmentType { + return field.Invalid( + field.NewPath("spec.applicableEnvironmentType"), oldConn.Spec.ApplicableEnvironmentType, "field is immutable") + } + if oldConn.Spec.Category != newConn.Spec.Category { + return field.Invalid( + field.NewPath("spec.category"), oldConn.Spec.Category, "field is immutable") + } + if oldConn.Spec.Type != newConn.Spec.Type { + return field.Invalid( + field.NewPath("spec.type"), oldConn.Spec.Type, "field is immutable") + } + if oldConn.Spec.SecretName != newConn.Spec.SecretName { + return field.Invalid( + field.NewPath("spec.secretName"), oldConn.Spec.SecretName, "field is immutable") + } + return nil +} + +func (r *ConnectorWebhook) validateConditions(oldConn, newConn *walruscore.Connector) error { + switch { + case oldConn.Generation != newConn.Generation: + return nil + case apistatus.ConnectorConditionConnected.IsUnknown(newConn): + if len(oldConn.Status.Conditions) == 0 || + apistatus.ConnectorConditionConnected.IsTrueOrFalse(oldConn) { + return nil + } + return field.Invalid( + field.NewPath("status.conditions"), newConn.Status.Conditions, "previous connecting has not been completed yet") + case apistatus.ConnectorConditionDeleting.Exists(newConn): + if newConn.DeletionTimestamp != nil { + return nil + } + return field.Invalid( + field.NewPath("status.conditions"), newConn.Status.Conditions, "deletion has not been requested yet") + } + return nil +} + func (r *ConnectorWebhook) Default(ctx context.Context, obj runtime.Object) error { conn := obj.(*walruscore.Connector) - if conn.DeletionTimestamp != nil { + // Nothing to do for deletion. return nil } - data := map[string][]byte{} - for k, v := range conn.Spec.Config.Data { - data[k] = []byte(v.Value) + // Set applicable environment type. + if conn.Spec.ApplicableEnvironmentType == "" { + conn.Spec.ApplicableEnvironmentType = walruscore.EnvironmentTypeDevelopment } - name := fmt.Sprintf("connector-config-%s", stringx.SumByFNV64a(conn.Namespace, conn.Name)) - eSec := &core.Secret{ - ObjectMeta: meta.ObjectMeta{ - Namespace: conn.Namespace, - Name: name, - }, - Data: data, - } + // Transfer configuration to a secret if needed. + return r.transferSecret(ctx, conn) +} - _, err := kubeclientset.UpdateWithCtrlClient(ctx, r.client, eSec, kubeclientset.WithCreateIfNotExisted[*core.Secret]()) +func (r *ConnectorWebhook) transferSecret(ctx context.Context, conn *walruscore.Connector) error { + var eSec *core.Secret + { + switch { + case conn.Generation == 0: + // Create the secret. + eSec = &core.Secret{ + ObjectMeta: meta.ObjectMeta{ + Namespace: conn.Namespace, + GenerateName: "connector-config-", + }, + } + case conn.Spec.SecretName != "": + // Check if we need to update the secret. + need := true + for k := range conn.Spec.Config.Data { + if !conn.Spec.Config.Data[k].Sensitive { + continue + } + if conn.Spec.Config.Data[k].Value == "(sensitive)" { + need = false + continue + } + break + } + if !need { + // Return directly if no need to update the secret. + return nil + } + // Update the secret. + eSec = &core.Secret{ + ObjectMeta: meta.ObjectMeta{ + Namespace: conn.Namespace, + Name: conn.Spec.SecretName, + }, + } + } + eSec.Data = make(map[string][]byte, len(conn.Spec.Config.Data)) + for k := range conn.Spec.Config.Data { + eSec.Data[k] = []byte(conn.Spec.Config.Data[k].Value) + } + } + alignFn := func(aSec *core.Secret) (*core.Secret, bool, error) { + if aSec.Data == nil { + aSec.Data = make(map[string][]byte) + } + if reflect.DeepEqual(aSec.Data, eSec.Data) { + return nil, true, nil + } + aSec.Data = maps.Clone(eSec.Data) + return aSec, false, nil + } + eSec, err := kubeclientset.CreateWithCtrlClient(ctx, r.Client, eSec, + kubeclientset.WithUpdateIfExisted(alignFn)) if err != nil { - return err + return kerrors.NewInternalError(fmt.Errorf("create connector transferred secret: %w", err)) } + conn.Spec.SecretName = eSec.Name - configData := map[string]walruscore.ConnectorConfigEntry{} - for k, v := range conn.Spec.Config.Data { - if v.Visible { - configData[k] = v - } else { - configData[k] = walruscore.ConnectorConfigEntry{ - Value: "", - Visible: false, - } + // Reverse controlling, + // which ensures the connector not leaked after the secret is deleted. + kubemeta.ControlOn(conn, eSec, core.SchemeGroupVersion.WithKind("Secret")) + + // Desensitize configuration. + for k := range conn.Spec.Config.Data { + if !conn.Spec.Config.Data[k].Sensitive { + continue + } + conn.Spec.Config.Data[k] = walruscore.ConnectorConfigEntry{ + Sensitive: true, + Value: "(sensitive)", } } - conn.Spec.Config.Data = configData - conn.Spec.SecretName = name - - kubemeta.SanitizeLastAppliedAnnotation(conn) + // Overwrite last applied annotation if needed. + kubemeta.OverwriteLastAppliedAnnotation(conn) return nil } -func (r *ConnectorWebhook) deleteSecret(ctx context.Context, conn *walruscore.Connector) error { - name := conn.Spec.SecretName - eSec := &core.Secret{ +func (r *ConnectorWebhook) revokeTransferredSecret(ctx context.Context, conn *walruscore.Connector) ctrladmission.Warnings { + logger := ctrllog.FromContext(ctx) + + sec := &core.Secret{ ObjectMeta: meta.ObjectMeta{ Namespace: conn.Namespace, - Name: name, + Name: conn.Spec.SecretName, }, } - return kubeclientset.DeleteWithCtrlClient(ctx, r.client, eSec) + err := kubeclientset.DeleteWithCtrlClient(ctx, r.Client, sec, + kubeclientset.WithDeleteMetaOptions(meta.DeleteOptions{PropagationPolicy: ptr.To(meta.DeletePropagationForeground)})) + if err != nil { + logger.Error(err, "clean up connector transferred secret") + return []string{ + fmt.Sprintf("Unable to revoke the connector transferred secret %q, please remove it manually", + kubemeta.GetNamespacedNameKey(sec)), + } + } + + return nil } diff --git a/pkg/webhooks/walruscore/connector_binding.go b/pkg/webhooks/walruscore/connector_binding.go index cc534d4f6..20e33cfea 100644 --- a/pkg/webhooks/walruscore/connector_binding.go +++ b/pkg/webhooks/walruscore/connector_binding.go @@ -20,26 +20,25 @@ import ( // ConnectorBindingWebhook hooks a v1.ConnectorBinding object. // // nolint: lll +// +k8s:webhook-gen:validating:group="walruscore.seal.io",version="v1",resource="connectorbindings",scope="Namespaced" +// +k8s:webhook-gen:validating:operations=["CREATE","UPDATE"],failurePolicy="Fail",sideEffects="None",matchPolicy="Equivalent",timeoutSeconds=10 // +k8s:webhook-gen:mutating:group="walruscore.seal.io",version="v1",resource="connectorbindings",scope="Namespaced" // +k8s:webhook-gen:mutating:operations=["CREATE","UPDATE"],failurePolicy="Fail",sideEffects="NoneOnDryRun",matchPolicy="Equivalent",timeoutSeconds=10 -// +k8s:webhook-gen:validating:group="walruscore.seal.io",version="v1",resource="connectorbindings",scope="Namespaced" -// +k8s:webhook-gen:validating:operations=["CREATE","UPDATE","DELETE"],failurePolicy="Fail",sideEffects="None",matchPolicy="Equivalent",timeoutSeconds=10 type ConnectorBindingWebhook struct { - client ctrlcli.Client + webhook.DefaultCustomValidator + + Client ctrlcli.Client } func (r *ConnectorBindingWebhook) SetupWebhook(_ context.Context, opts webhook.SetupOptions) (runtime.Object, error) { - r.client = opts.Manager.GetClient() + r.Client = opts.Manager.GetClient() return &walruscore.ConnectorBinding{}, nil } var _ ctrlwebhook.CustomValidator = (*ConnectorBindingWebhook)(nil) -func (r *ConnectorBindingWebhook) ValidateCreate( - ctx context.Context, - obj runtime.Object, -) (ctrladmission.Warnings, error) { +func (r *ConnectorBindingWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (ctrladmission.Warnings, error) { cb := obj.(*walruscore.ConnectorBinding) conn := &walruscore.Connector{ @@ -48,49 +47,65 @@ func (r *ConnectorBindingWebhook) ValidateCreate( Namespace: cb.Spec.Connector.Namespace, }, } - err := r.client.Get(ctx, ctrlcli.ObjectKeyFromObject(conn), conn) + err := r.Client.Get(ctx, ctrlcli.ObjectKeyFromObject(conn), conn) if err != nil { - return nil, err + return nil, field.Invalid( + field.NewPath("spec.connector"), cb.Spec.Connector, "connector not found") + } + + // Validate if the given category and type are valid. + { + if conn.Spec.Category != cb.Spec.Connector.Category { + return nil, field.Invalid( + field.NewPath("spec.connector"), cb.Spec.Connector, + fmt.Sprintf("connector category mismatch, expected %s, got %s", conn.Spec.Category, cb.Spec.Connector.Category)) + } + if conn.Spec.Type != cb.Spec.Connector.Type { + return nil, field.Invalid( + field.NewPath("spec.connector"), cb.Spec.Connector, + fmt.Sprintf("connector type mismatch, expected %s, got %s", conn.Spec.Type, cb.Spec.Connector.Type)) + } } - // Validate connector applicable environment type. + // Validate if the connector be applicable to the type of environment. { envList := new(walrus.EnvironmentList) - err = r.client.List(ctx, envList, ctrlcli.MatchingFields{"metadata.name": cb.Namespace}) + err = r.Client.List(ctx, envList, + // Since the environment name is unique, + // we can use it as the field selector without the namespace(project) of environment. + ctrlcli.MatchingFields{ + "metadata.name": cb.Namespace, + }) if err != nil { return nil, err } if len(envList.Items) != 1 { return nil, field.Forbidden( - field.NewPath("metadata", "namespace"), "connector must be created to a valid environment") + field.NewPath("metadata.namespace"), "connector binding must be created in a valid environment namespace") } - if envList.Items[0].Spec.Type != conn.Spec.ApplicableEnvironmentType { + if eType, aType := envList.Items[0].Spec.Type, conn.Spec.ApplicableEnvironmentType; eType != aType { return nil, field.Invalid( - field.NewPath("spec", "connector"), - cb.Spec.Connector, - fmt.Sprintf("connector must be created to a %s environment", conn.Spec.ApplicableEnvironmentType), - ) + field.NewPath("spec.connector"), cb.Spec.Connector, + fmt.Sprintf("connector is not applicable to this environment, expected %s, got %s", eType, aType)) } } - // Validate duplicated binding. + // Validate if there is duplicated binding. { cbList := new(walruscore.ConnectorBindingList) - err := r.client.List(ctx, cbList, ctrlcli.InNamespace(cb.Namespace)) + err = r.Client.List(ctx, cbList, + ctrlcli.InNamespace(cb.Namespace)) if err != nil { return nil, err } for i := range cbList.Items { - if cbList.Items[i].Status.Category == conn.Spec.Category && - cbList.Items[i].Status.Type == conn.Spec.Type { + if cbList.Items[i].Spec.Connector.Type == conn.Spec.Type { return nil, field.Invalid( - field.NewPath("spec", "connector"), - cb.Spec.Connector, - "connectors for the same purpose cannot be bound repeatedly", - ) + field.NewPath("spec.connector"), cb.Spec.Connector, + "connectors for the same purpose cannot be bound repeatedly") } } } @@ -98,47 +113,42 @@ func (r *ConnectorBindingWebhook) ValidateCreate( return nil, nil } -func (r *ConnectorBindingWebhook) ValidateUpdate( - ctx context.Context, - oldObj, newObj runtime.Object, -) (ctrladmission.Warnings, error) { +func (r *ConnectorBindingWebhook) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (ctrladmission.Warnings, error) { oldCb, newCb := oldObj.(*walruscore.ConnectorBinding), newObj.(*walruscore.ConnectorBinding) + + // Validate immutable fields. if !reflect.DeepEqual(oldCb.Spec, newCb.Spec) { - return nil, field.Forbidden(field.NewPath("spec"), "cannot update connector binding spec") + return nil, field.Invalid( + field.NewPath("spec.connector"), oldCb.Spec.Connector, "field is immutable") } return nil, nil } -func (r *ConnectorBindingWebhook) ValidateDelete( - ctx context.Context, - obj runtime.Object, -) (ctrladmission.Warnings, error) { - return nil, nil -} - func (r *ConnectorBindingWebhook) Default(ctx context.Context, obj runtime.Object) error { cb := obj.(*walruscore.ConnectorBinding) if cb.DeletionTimestamp != nil { + // Nothing to do for deletion. return nil } - connector := &walruscore.Connector{ + // Set the category and type of the connector if needed. + if cb.Spec.Connector.Category != "" && cb.Spec.Connector.Type != "" { + return nil + } + conn := &walruscore.Connector{ ObjectMeta: meta.ObjectMeta{ Name: cb.Spec.Connector.Name, Namespace: cb.Spec.Connector.Namespace, }, } - if err := r.client.Get(ctx, ctrlcli.ObjectKeyFromObject(connector), connector); err != nil { - return err - } - - labels := cb.Labels - if labels == nil { - labels = map[string]string{} + err := r.Client.Get(ctx, ctrlcli.ObjectKeyFromObject(conn), conn) + if err != nil { + return field.Invalid( + field.NewPath("spec.connector"), cb.Spec.Connector, "connector not found") } - labels["walrus.seal.io/connector"] = fmt.Sprintf("%s-%s", cb.Spec.Connector.Namespace, cb.Spec.Connector.Name) - cb.SetLabels(labels) + cb.Spec.Connector.Category = conn.Spec.Category + cb.Spec.Connector.Type = conn.Spec.Type return nil } diff --git a/pkg/webhooks/walruscore/template.go b/pkg/webhooks/walruscore/template.go index 717bbb086..9ef8f0328 100644 --- a/pkg/webhooks/walruscore/template.go +++ b/pkg/webhooks/walruscore/template.go @@ -2,42 +2,123 @@ package walruscore import ( "context" + "fmt" + kerrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/validation/field" + ctrlcli "sigs.k8s.io/controller-runtime/pkg/client" ctrlwebhook "sigs.k8s.io/controller-runtime/pkg/webhook" ctrladmission "sigs.k8s.io/controller-runtime/pkg/webhook/admission" walruscore "github.com/seal-io/walrus/pkg/apis/walruscore/v1" + "github.com/seal-io/walrus/pkg/apistatus" + "github.com/seal-io/walrus/pkg/kubemeta" "github.com/seal-io/walrus/pkg/templates/sourceurl" "github.com/seal-io/walrus/pkg/webhook" ) // TemplateWebhook hooks a v1.Template object. // +// nolint: lll // +k8s:webhook-gen:validating:group="walruscore.seal.io",version="v1",resource="templates",scope="Namespaced" -// +k8s:webhook-gen:validating:operations=["CREATE","DELETE"],failurePolicy="Fail",sideEffects="None",matchPolicy="Equivalent",timeoutSeconds=10 +// +k8s:webhook-gen:validating:operations=["CREATE","UPDATE","DELETE"],failurePolicy="Fail",sideEffects="None",matchPolicy="Equivalent",timeoutSeconds=10,subResources=["status"] type TemplateWebhook struct { webhook.DefaultCustomValidator + + Client ctrlcli.Client } func (r *TemplateWebhook) SetupWebhook(_ context.Context, opts webhook.SetupOptions) (runtime.Object, error) { + r.Client = opts.Manager.GetClient() + return &walruscore.Template{}, nil } var _ ctrlwebhook.CustomValidator = (*TemplateWebhook)(nil) func (r *TemplateWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (ctrladmission.Warnings, error) { - t := obj.(*walruscore.Template) - _, err := sourceurl.ParseURLToSourceURL(t.Spec.VCSRepository.URL) + tmpl := obj.(*walruscore.Template) + + // Validate VCS repository URL. + _, err := sourceurl.ParseURLToSourceURL(tmpl.Spec.VCSRepository.URL) if err != nil { return nil, field.Invalid( - field.NewPath("spec.vcsRepository.url"), t.Spec.VCSRepository.URL, err.Error()) + field.NewPath("spec.vcsRepository.url"), tmpl.Spec.VCSRepository.URL, err.Error()) } + + return nil, nil +} + +func (r *TemplateWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (ctrladmission.Warnings, error) { + oldTmpl, newTmpl := oldObj.(*walruscore.Template), newObj.(*walruscore.Template) + + // Validate immutable fields. + if err := r.validateImmutables(oldTmpl, newTmpl); err != nil { + return nil, err + } + + // Validate conditions. + if err := r.validateConditions(oldTmpl, newTmpl); err != nil { + return nil, err + } + return nil, nil } func (r *TemplateWebhook) ValidateDelete(ctx context.Context, obj runtime.Object) (ctrladmission.Warnings, error) { - // TODO(michelia): add validate to prevent deletion of template depended by resource definition/resource/resource run. + tmpl := obj.(*walruscore.Template) + + // Cannot delete the template if it is in use. + resCompsList := new(walruscore.ResourceComponentsList) + err := r.Client.List(ctx, resCompsList, + ctrlcli.MatchingFields{ + "status.template": kubemeta.GetNamespacedNameKey(tmpl), + }) + if err != nil { + return nil, kerrors.NewInternalError(fmt.Errorf("list related resource components: %w", err)) + } + if len(resCompsList.Items) > 0 { + return nil, field.Invalid( + field.NewPath("metadata.name"), tmpl.GetName(), "blocked by in-used resource components") + } + return nil, nil } + +func (r *TemplateWebhook) validateImmutables(oldTmpl, newTmpl *walruscore.Template) error { + if oldTmpl.Spec.TemplateFormat != newTmpl.Spec.TemplateFormat { + return field.Invalid( + field.NewPath("spec.templateFormat"), oldTmpl.Spec.TemplateFormat, "field is immutable") + } + if oldTmpl.Spec.VCSRepository.Platform != newTmpl.Spec.VCSRepository.Platform { + return field.Invalid( + field.NewPath("spec.vcsRepository.platform"), oldTmpl.Spec.VCSRepository.Platform, "field is immutable") + } + if oldTmpl.Spec.VCSRepository.URL != newTmpl.Spec.VCSRepository.URL { + return field.Invalid( + field.NewPath("spec.vcsRepository.url"), oldTmpl.Spec.VCSRepository.URL, "field is immutable") + } + return nil +} + +func (r *TemplateWebhook) validateConditions(oldTmpl, newTmpl *walruscore.Template) error { + switch { + case oldTmpl.Generation != newTmpl.Generation: + return nil + case apistatus.TemplateConditionSynced.IsUnknown(newTmpl): + if len(oldTmpl.Status.Conditions) == 0 || + apistatus.TemplateConditionSynced.IsTrueOrFalse(oldTmpl) { + return nil + } + return field.Invalid( + field.NewPath("status.conditions"), newTmpl.Status.Conditions, "previous syncing has not been completed yet") + case apistatus.TemplateConditionDeleting.Exists(newTmpl): + if newTmpl.DeletionTimestamp != nil { + return nil + } + return field.Invalid( + field.NewPath("status.conditions"), newTmpl.Status.Conditions, "deletion has not been requested yet") + } + return nil +} diff --git a/pkg/webhooks/walruscore/zz_generated.webhooks.go b/pkg/webhooks/walruscore/zz_generated.webhooks.go index 9230be23e..2f626cff9 100644 --- a/pkg/webhooks/walruscore/zz_generated.webhooks.go +++ b/pkg/webhooks/walruscore/zz_generated.webhooks.go @@ -83,13 +83,13 @@ func vwh_walrus_pkg_webhooks_walruscore_CatalogWebhook(c v1.WebhookClientConfig) }, Resources: []string{ "catalogs", + "catalogs/status", }, Scope: ptr.To[v1.ScopeType]("Namespaced"), }, Operations: []v1.OperationType{ "CREATE", "UPDATE", - "DELETE", }, }, }, @@ -137,7 +137,6 @@ func vwh_walrus_pkg_webhooks_walruscore_ConnectorBindingWebhook(c v1.WebhookClie Operations: []v1.OperationType{ "CREATE", "UPDATE", - "DELETE", }, }, }, @@ -369,11 +368,13 @@ func vwh_walrus_pkg_webhooks_walruscore_TemplateWebhook(c v1.WebhookClientConfig }, Resources: []string{ "templates", + "templates/status", }, Scope: ptr.To[v1.ScopeType]("Namespaced"), }, Operations: []v1.OperationType{ "CREATE", + "UPDATE", "DELETE", }, }, diff --git a/staging/github.com/seal-io/code-generator/cmd/crd-gen/generators/testdata/crd_gen/dummy.go b/staging/github.com/seal-io/code-generator/cmd/crd-gen/generators/testdata/crd_gen/dummy.go index fb2c56fdd..eb79ca340 100644 --- a/staging/github.com/seal-io/code-generator/cmd/crd-gen/generators/testdata/crd_gen/dummy.go +++ b/staging/github.com/seal-io/code-generator/cmd/crd-gen/generators/testdata/crd_gen/dummy.go @@ -58,7 +58,7 @@ type DummySpec struct { // Map. - // +mapType="atomic" + // +mapType=atomic // +k8s:validation:maxProperties=3 MapString map[string]string `json:"mapString,omitempty"` MapPointString map[string]*string `json:"mapPointString,omitempty"` @@ -70,7 +70,7 @@ type DummySpec struct { E map[string]struct{} `json:"e"` F []struct{} `json:"f"` } `json:"mapObject,omitempty"` - // +mapType="atomic" + // +mapType=atomic MapInOrString map[string]intstr.IntOrString `json:"mapInOrString,omitempty"` MapStringPointer *map[string]string `json:"mapStringPointer,omitempty"` MapInterface map[string]any `json:"mapInterface,omitempty"` diff --git a/staging/github.com/seal-io/code-generator/cmd/crd-gen/generators/testdata/reflect_type/dummy.go b/staging/github.com/seal-io/code-generator/cmd/crd-gen/generators/testdata/reflect_type/dummy.go index 9a3634af6..f013ebdf9 100644 --- a/staging/github.com/seal-io/code-generator/cmd/crd-gen/generators/testdata/reflect_type/dummy.go +++ b/staging/github.com/seal-io/code-generator/cmd/crd-gen/generators/testdata/reflect_type/dummy.go @@ -58,7 +58,7 @@ type DummySpec struct { // Map. - // +mapType="atomic" + // +mapType=atomic // +k8s:validation:maxProperties=3 MapString map[string]string `json:"mapString,omitempty"` MapPointString map[string]*string `json:"mapPointString,omitempty"` @@ -70,7 +70,7 @@ type DummySpec struct { E map[string]struct{} `json:"e"` F []struct{} `json:"f"` } `json:"mapObject,omitempty"` - // +mapType="atomic" + // +mapType=atomic MapInOrString map[string]intstr.IntOrString `json:"mapInOrString,omitempty"` MapStringPointer *map[string]string `json:"mapStringPointer,omitempty"` MapInterface map[string]any `json:"mapInterface,omitempty"`