From 7a9a2fbcdeaa6b7c3c1ec7035abe749c5ee04381 Mon Sep 17 00:00:00 2001 From: Anton Sidelnikov <53078276+anton-sidelnikov@users.noreply.github.com> Date: Wed, 7 Aug 2024 11:04:17 +0200 Subject: [PATCH] cluster, node, addon, node_pool (#12) --- apis/cce/v1alpha1/zz_addonv3_types.go | 19 +- apis/cce/v1alpha1/zz_clusterv3_types.go | 120 ++- apis/cce/v1alpha1/zz_generated.deepcopy.go | 384 ++++++++ apis/cce/v1alpha1/zz_generated.resolvers.go | 684 +++++++++++++ apis/cce/v1alpha1/zz_nodepoolv3_types.go | 113 ++- apis/cce/v1alpha1/zz_nodev3_terraformed.go | 5 + apis/cce/v1alpha1/zz_nodev3_types.go | 112 ++- apis/compute/v1alpha1/zz_instancev2_types.go | 24 +- apis/ecs/v1alpha1/zz_generated.resolvers.go | 6 +- apis/ecs/v1alpha1/zz_instancev1_types.go | 4 +- .../v1alpha1/zz_generated.conversion_hubs.go | 3 + apis/kms/v1alpha1/zz_generated.deepcopy.go | 347 +++++++ apis/kms/v1alpha1/zz_generated.managed.go | 60 ++ apis/kms/v1alpha1/zz_generated.managedlist.go | 9 + apis/kms/v1alpha1/zz_keyv1_terraformed.go | 129 +++ apis/kms/v1alpha1/zz_keyv1_types.go | 227 +++++ apis/rds/v1alpha1/zz_generated.resolvers.go | 14 +- apis/rds/v1alpha1/zz_instancev3_types.go | 8 +- apis/rds/v1alpha1/zz_readreplicav3_types.go | 4 +- config/cce/config.go | 111 ++- config/common/common.go | 139 +++ config/compute/config.go | 39 +- config/external_name.go | 1 + config/rds/config.go | 66 +- examples-generated/cce/v1alpha1/addonv3.yaml | 12 +- .../cce/v1alpha1/clusterv3.yaml | 8 +- .../cce/v1alpha1/nodepoolv3.yaml | 12 +- examples-generated/cce/v1alpha1/nodev3.yaml | 12 +- examples-generated/kms/v1alpha1/keyv1.yaml | 17 + examples/cce/cluster.yaml | 218 +++++ .../controller/kms/keyv1/zz_controller.go | 87 ++ internal/controller/zz_setup.go | 2 + ...entelekomcloud.crossplane.io_addonv3s.yaml | 152 ++- ...telekomcloud.crossplane.io_clusterv3s.yaml | 896 ++++++++++++++++- ...elekomcloud.crossplane.io_nodepoolv3s.yaml | 892 ++++++++++++++++- ...pentelekomcloud.crossplane.io_nodev3s.yaml | 902 +++++++++++++++++- ...elekomcloud.crossplane.io_instancev2s.yaml | 18 +- ...opentelekomcloud.crossplane.io_keyv1s.yaml | 493 ++++++++++ 38 files changed, 6171 insertions(+), 178 deletions(-) create mode 100644 apis/cce/v1alpha1/zz_generated.resolvers.go create mode 100755 apis/kms/v1alpha1/zz_keyv1_terraformed.go create mode 100755 apis/kms/v1alpha1/zz_keyv1_types.go create mode 100644 config/common/common.go create mode 100644 examples-generated/kms/v1alpha1/keyv1.yaml create mode 100644 examples/cce/cluster.yaml create mode 100755 internal/controller/kms/keyv1/zz_controller.go create mode 100644 package/crds/kms.opentelekomcloud.crossplane.io_keyv1s.yaml diff --git a/apis/cce/v1alpha1/zz_addonv3_types.go b/apis/cce/v1alpha1/zz_addonv3_types.go index f0f88e3..0326608 100755 --- a/apis/cce/v1alpha1/zz_addonv3_types.go +++ b/apis/cce/v1alpha1/zz_addonv3_types.go @@ -16,8 +16,17 @@ import ( type AddonV3InitParameters struct { // ID of cluster to install the add-on on. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/cce/v1alpha1.ClusterV3 ClusterID *string `json:"clusterId,omitempty" tf:"cluster_id,omitempty"` + // Reference to a ClusterV3 in cce to populate clusterId. + // +kubebuilder:validation:Optional + ClusterIDRef *v1.Reference `json:"clusterIdRef,omitempty" tf:"-"` + + // Selector for a ClusterV3 in cce to populate clusterId. + // +kubebuilder:validation:Optional + ClusterIDSelector *v1.Selector `json:"clusterIdSelector,omitempty" tf:"-"` + // Name of the add-on template to be installed, for example, coredns. TemplateName *string `json:"templateName,omitempty" tf:"template_name,omitempty"` @@ -54,9 +63,18 @@ type AddonV3Observation struct { type AddonV3Parameters struct { // ID of cluster to install the add-on on. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/cce/v1alpha1.ClusterV3 // +kubebuilder:validation:Optional ClusterID *string `json:"clusterId,omitempty" tf:"cluster_id,omitempty"` + // Reference to a ClusterV3 in cce to populate clusterId. + // +kubebuilder:validation:Optional + ClusterIDRef *v1.Reference `json:"clusterIdRef,omitempty" tf:"-"` + + // Selector for a ClusterV3 in cce to populate clusterId. + // +kubebuilder:validation:Optional + ClusterIDSelector *v1.Selector `json:"clusterIdSelector,omitempty" tf:"-"` + // Name of the add-on template to be installed, for example, coredns. // +kubebuilder:validation:Optional TemplateName *string `json:"templateName,omitempty" tf:"template_name,omitempty"` @@ -151,7 +169,6 @@ type AddonV3Status struct { type AddonV3 struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.clusterId) || (has(self.initProvider) && has(self.initProvider.clusterId))",message="spec.forProvider.clusterId is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.templateName) || (has(self.initProvider) && has(self.initProvider.templateName))",message="spec.forProvider.templateName is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.templateVersion) || (has(self.initProvider) && has(self.initProvider.templateVersion))",message="spec.forProvider.templateVersion is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.values) || (has(self.initProvider) && has(self.initProvider.values))",message="spec.forProvider.values is a required parameter" diff --git a/apis/cce/v1alpha1/zz_clusterv3_types.go b/apis/cce/v1alpha1/zz_clusterv3_types.go index aa6388f..0ff60ef 100755 --- a/apis/cce/v1alpha1/zz_clusterv3_types.go +++ b/apis/cce/v1alpha1/zz_clusterv3_types.go @@ -158,17 +158,47 @@ type ClusterV3InitParameters struct { Description *string `json:"description,omitempty" tf:"description,omitempty"` // EIP address of the cluster. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.EIPV1 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractEipAddress() EIP *string `json:"eip,omitempty" tf:"eip,omitempty"` + // Reference to a EIPV1 in vpc to populate eip. + // +kubebuilder:validation:Optional + EIPRef *v1.Reference `json:"eipRef,omitempty" tf:"-"` + + // Selector for a EIPV1 in vpc to populate eip. + // +kubebuilder:validation:Optional + EIPSelector *v1.Selector `json:"eipSelector,omitempty" tf:"-"` + // System and data disks encryption of master nodes. Changing this parameter will create a new cluster resource. EnableVolumeEncryption *bool `json:"enableVolumeEncryption,omitempty" tf:"enable_volume_encryption,omitempty"` // Specifies the ENI network segment. Specified when creating a CCE Turbo cluster. Changing this parameter will create a new cluster resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.SubnetV1 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractSubnetCIDR() EniSubnetCidr *string `json:"eniSubnetCidr,omitempty" tf:"eni_subnet_cidr,omitempty"` + // Reference to a SubnetV1 in vpc to populate eniSubnetCidr. + // +kubebuilder:validation:Optional + EniSubnetCidrRef *v1.Reference `json:"eniSubnetCidrRef,omitempty" tf:"-"` + + // Selector for a SubnetV1 in vpc to populate eniSubnetCidr. + // +kubebuilder:validation:Optional + EniSubnetCidrSelector *v1.Selector `json:"eniSubnetCidrSelector,omitempty" tf:"-"` + // - Specifies the ENI subnet ID. Specified when creating a CCE Turbo cluster. Changing this parameter will create a new cluster resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.SubnetV1 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractSubnetID() EniSubnetID *string `json:"eniSubnetId,omitempty" tf:"eni_subnet_id,omitempty"` + // Reference to a SubnetV1 in vpc to populate eniSubnetId. + // +kubebuilder:validation:Optional + EniSubnetIDRef *v1.Reference `json:"eniSubnetIdRef,omitempty" tf:"-"` + + // Selector for a SubnetV1 in vpc to populate eniSubnetId. + // +kubebuilder:validation:Optional + EniSubnetIDSelector *v1.Selector `json:"eniSubnetIdSelector,omitempty" tf:"-"` + // Extended parameter. Changing this parameter will create a new cluster resource. // List of cluster extended params. // +mapType=granular @@ -178,8 +208,18 @@ type ClusterV3InitParameters struct { FlavorID *string `json:"flavorId,omitempty" tf:"flavor_id,omitempty"` // The ID of the high speed network used to create bare metal nodes. Changing this parameter will create a new cluster resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.SubnetV1 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractNetworkID() HighwaySubnetID *string `json:"highwaySubnetId,omitempty" tf:"highway_subnet_id,omitempty"` + // Reference to a SubnetV1 in vpc to populate highwaySubnetId. + // +kubebuilder:validation:Optional + HighwaySubnetIDRef *v1.Reference `json:"highwaySubnetIdRef,omitempty" tf:"-"` + + // Selector for a SubnetV1 in vpc to populate highwaySubnetId. + // +kubebuilder:validation:Optional + HighwaySubnetIDSelector *v1.Selector `json:"highwaySubnetIdSelector,omitempty" tf:"-"` + // Skip all cluster addons operations. IgnoreAddons *bool `json:"ignoreAddons,omitempty" tf:"ignore_addons,omitempty"` @@ -212,10 +252,29 @@ type ClusterV3InitParameters struct { Region *string `json:"region,omitempty" tf:"region,omitempty"` // The Network ID of the subnet used to create the node. Changing this parameter will create a new cluster resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.SubnetV1 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractNetworkID() SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` + // Reference to a SubnetV1 in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDRef *v1.Reference `json:"subnetIdRef,omitempty" tf:"-"` + + // Selector for a SubnetV1 in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDSelector *v1.Selector `json:"subnetIdSelector,omitempty" tf:"-"` + // The ID of the VPC used to create the node. Changing this parameter will create a new cluster resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.VpcV1 VPCID *string `json:"vpcId,omitempty" tf:"vpc_id,omitempty"` + + // Reference to a VpcV1 in vpc to populate vpcId. + // +kubebuilder:validation:Optional + VPCIDRef *v1.Reference `json:"vpcIdRef,omitempty" tf:"-"` + + // Selector for a VpcV1 in vpc to populate vpcId. + // +kubebuilder:validation:Optional + VPCIDSelector *v1.Selector `json:"vpcIdSelector,omitempty" tf:"-"` } type ClusterV3Observation struct { @@ -465,21 +524,51 @@ type ClusterV3Parameters struct { Description *string `json:"description,omitempty" tf:"description,omitempty"` // EIP address of the cluster. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.EIPV1 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractEipAddress() // +kubebuilder:validation:Optional EIP *string `json:"eip,omitempty" tf:"eip,omitempty"` + // Reference to a EIPV1 in vpc to populate eip. + // +kubebuilder:validation:Optional + EIPRef *v1.Reference `json:"eipRef,omitempty" tf:"-"` + + // Selector for a EIPV1 in vpc to populate eip. + // +kubebuilder:validation:Optional + EIPSelector *v1.Selector `json:"eipSelector,omitempty" tf:"-"` + // System and data disks encryption of master nodes. Changing this parameter will create a new cluster resource. // +kubebuilder:validation:Optional EnableVolumeEncryption *bool `json:"enableVolumeEncryption,omitempty" tf:"enable_volume_encryption,omitempty"` // Specifies the ENI network segment. Specified when creating a CCE Turbo cluster. Changing this parameter will create a new cluster resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.SubnetV1 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractSubnetCIDR() // +kubebuilder:validation:Optional EniSubnetCidr *string `json:"eniSubnetCidr,omitempty" tf:"eni_subnet_cidr,omitempty"` + // Reference to a SubnetV1 in vpc to populate eniSubnetCidr. + // +kubebuilder:validation:Optional + EniSubnetCidrRef *v1.Reference `json:"eniSubnetCidrRef,omitempty" tf:"-"` + + // Selector for a SubnetV1 in vpc to populate eniSubnetCidr. + // +kubebuilder:validation:Optional + EniSubnetCidrSelector *v1.Selector `json:"eniSubnetCidrSelector,omitempty" tf:"-"` + // - Specifies the ENI subnet ID. Specified when creating a CCE Turbo cluster. Changing this parameter will create a new cluster resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.SubnetV1 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractSubnetID() // +kubebuilder:validation:Optional EniSubnetID *string `json:"eniSubnetId,omitempty" tf:"eni_subnet_id,omitempty"` + // Reference to a SubnetV1 in vpc to populate eniSubnetId. + // +kubebuilder:validation:Optional + EniSubnetIDRef *v1.Reference `json:"eniSubnetIdRef,omitempty" tf:"-"` + + // Selector for a SubnetV1 in vpc to populate eniSubnetId. + // +kubebuilder:validation:Optional + EniSubnetIDSelector *v1.Selector `json:"eniSubnetIdSelector,omitempty" tf:"-"` + // Extended parameter. Changing this parameter will create a new cluster resource. // List of cluster extended params. // +kubebuilder:validation:Optional @@ -491,9 +580,19 @@ type ClusterV3Parameters struct { FlavorID *string `json:"flavorId,omitempty" tf:"flavor_id,omitempty"` // The ID of the high speed network used to create bare metal nodes. Changing this parameter will create a new cluster resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.SubnetV1 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractNetworkID() // +kubebuilder:validation:Optional HighwaySubnetID *string `json:"highwaySubnetId,omitempty" tf:"highway_subnet_id,omitempty"` + // Reference to a SubnetV1 in vpc to populate highwaySubnetId. + // +kubebuilder:validation:Optional + HighwaySubnetIDRef *v1.Reference `json:"highwaySubnetIdRef,omitempty" tf:"-"` + + // Selector for a SubnetV1 in vpc to populate highwaySubnetId. + // +kubebuilder:validation:Optional + HighwaySubnetIDSelector *v1.Selector `json:"highwaySubnetIdSelector,omitempty" tf:"-"` + // Skip all cluster addons operations. // +kubebuilder:validation:Optional IgnoreAddons *bool `json:"ignoreAddons,omitempty" tf:"ignore_addons,omitempty"` @@ -536,12 +635,31 @@ type ClusterV3Parameters struct { Region *string `json:"region,omitempty" tf:"region,omitempty"` // The Network ID of the subnet used to create the node. Changing this parameter will create a new cluster resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.SubnetV1 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractNetworkID() // +kubebuilder:validation:Optional SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` + // Reference to a SubnetV1 in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDRef *v1.Reference `json:"subnetIdRef,omitempty" tf:"-"` + + // Selector for a SubnetV1 in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDSelector *v1.Selector `json:"subnetIdSelector,omitempty" tf:"-"` + // The ID of the VPC used to create the node. Changing this parameter will create a new cluster resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.VpcV1 // +kubebuilder:validation:Optional VPCID *string `json:"vpcId,omitempty" tf:"vpc_id,omitempty"` + + // Reference to a VpcV1 in vpc to populate vpcId. + // +kubebuilder:validation:Optional + VPCIDRef *v1.Reference `json:"vpcIdRef,omitempty" tf:"-"` + + // Selector for a VpcV1 in vpc to populate vpcId. + // +kubebuilder:validation:Optional + VPCIDSelector *v1.Selector `json:"vpcIdSelector,omitempty" tf:"-"` } // ClusterV3Spec defines the desired state of ClusterV3 @@ -584,8 +702,6 @@ type ClusterV3 struct { // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.containerNetworkType) || (has(self.initProvider) && has(self.initProvider.containerNetworkType))",message="spec.forProvider.containerNetworkType is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.flavorId) || (has(self.initProvider) && has(self.initProvider.flavorId))",message="spec.forProvider.flavorId is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.name) || (has(self.initProvider) && has(self.initProvider.name))",message="spec.forProvider.name is a required parameter" - // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.subnetId) || (has(self.initProvider) && has(self.initProvider.subnetId))",message="spec.forProvider.subnetId is a required parameter" - // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.vpcId) || (has(self.initProvider) && has(self.initProvider.vpcId))",message="spec.forProvider.vpcId is a required parameter" Spec ClusterV3Spec `json:"spec"` Status ClusterV3Status `json:"status,omitempty"` } diff --git a/apis/cce/v1alpha1/zz_generated.deepcopy.go b/apis/cce/v1alpha1/zz_generated.deepcopy.go index 4934923..96dc039 100644 --- a/apis/cce/v1alpha1/zz_generated.deepcopy.go +++ b/apis/cce/v1alpha1/zz_generated.deepcopy.go @@ -48,6 +48,16 @@ func (in *AddonV3InitParameters) DeepCopyInto(out *AddonV3InitParameters) { *out = new(string) **out = **in } + if in.ClusterIDRef != nil { + in, out := &in.ClusterIDRef, &out.ClusterIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.ClusterIDSelector != nil { + in, out := &in.ClusterIDSelector, &out.ClusterIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.TemplateName != nil { in, out := &in.TemplateName, &out.TemplateName *out = new(string) @@ -169,6 +179,16 @@ func (in *AddonV3Parameters) DeepCopyInto(out *AddonV3Parameters) { *out = new(string) **out = **in } + if in.ClusterIDRef != nil { + in, out := &in.ClusterIDRef, &out.ClusterIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.ClusterIDSelector != nil { + in, out := &in.ClusterIDSelector, &out.ClusterIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.TemplateName != nil { in, out := &in.TemplateName, &out.TemplateName *out = new(string) @@ -581,6 +601,16 @@ func (in *ClusterV3InitParameters) DeepCopyInto(out *ClusterV3InitParameters) { *out = new(string) **out = **in } + if in.EIPRef != nil { + in, out := &in.EIPRef, &out.EIPRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.EIPSelector != nil { + in, out := &in.EIPSelector, &out.EIPSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.EnableVolumeEncryption != nil { in, out := &in.EnableVolumeEncryption, &out.EnableVolumeEncryption *out = new(bool) @@ -591,11 +621,31 @@ func (in *ClusterV3InitParameters) DeepCopyInto(out *ClusterV3InitParameters) { *out = new(string) **out = **in } + if in.EniSubnetCidrRef != nil { + in, out := &in.EniSubnetCidrRef, &out.EniSubnetCidrRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.EniSubnetCidrSelector != nil { + in, out := &in.EniSubnetCidrSelector, &out.EniSubnetCidrSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.EniSubnetID != nil { in, out := &in.EniSubnetID, &out.EniSubnetID *out = new(string) **out = **in } + if in.EniSubnetIDRef != nil { + in, out := &in.EniSubnetIDRef, &out.EniSubnetIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.EniSubnetIDSelector != nil { + in, out := &in.EniSubnetIDSelector, &out.EniSubnetIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.ExtendParam != nil { in, out := &in.ExtendParam, &out.ExtendParam *out = make(map[string]*string, len(*in)) @@ -622,6 +672,16 @@ func (in *ClusterV3InitParameters) DeepCopyInto(out *ClusterV3InitParameters) { *out = new(string) **out = **in } + if in.HighwaySubnetIDRef != nil { + in, out := &in.HighwaySubnetIDRef, &out.HighwaySubnetIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.HighwaySubnetIDSelector != nil { + in, out := &in.HighwaySubnetIDSelector, &out.HighwaySubnetIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.IgnoreAddons != nil { in, out := &in.IgnoreAddons, &out.IgnoreAddons *out = new(bool) @@ -688,11 +748,31 @@ func (in *ClusterV3InitParameters) DeepCopyInto(out *ClusterV3InitParameters) { *out = new(string) **out = **in } + if in.SubnetIDRef != nil { + in, out := &in.SubnetIDRef, &out.SubnetIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.SubnetIDSelector != nil { + in, out := &in.SubnetIDSelector, &out.SubnetIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.VPCID != nil { in, out := &in.VPCID, &out.VPCID *out = new(string) **out = **in } + if in.VPCIDRef != nil { + in, out := &in.VPCIDRef, &out.VPCIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.VPCIDSelector != nil { + in, out := &in.VPCIDSelector, &out.VPCIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterV3InitParameters. @@ -1143,6 +1223,16 @@ func (in *ClusterV3Parameters) DeepCopyInto(out *ClusterV3Parameters) { *out = new(string) **out = **in } + if in.EIPRef != nil { + in, out := &in.EIPRef, &out.EIPRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.EIPSelector != nil { + in, out := &in.EIPSelector, &out.EIPSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.EnableVolumeEncryption != nil { in, out := &in.EnableVolumeEncryption, &out.EnableVolumeEncryption *out = new(bool) @@ -1153,11 +1243,31 @@ func (in *ClusterV3Parameters) DeepCopyInto(out *ClusterV3Parameters) { *out = new(string) **out = **in } + if in.EniSubnetCidrRef != nil { + in, out := &in.EniSubnetCidrRef, &out.EniSubnetCidrRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.EniSubnetCidrSelector != nil { + in, out := &in.EniSubnetCidrSelector, &out.EniSubnetCidrSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.EniSubnetID != nil { in, out := &in.EniSubnetID, &out.EniSubnetID *out = new(string) **out = **in } + if in.EniSubnetIDRef != nil { + in, out := &in.EniSubnetIDRef, &out.EniSubnetIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.EniSubnetIDSelector != nil { + in, out := &in.EniSubnetIDSelector, &out.EniSubnetIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.ExtendParam != nil { in, out := &in.ExtendParam, &out.ExtendParam *out = make(map[string]*string, len(*in)) @@ -1184,6 +1294,16 @@ func (in *ClusterV3Parameters) DeepCopyInto(out *ClusterV3Parameters) { *out = new(string) **out = **in } + if in.HighwaySubnetIDRef != nil { + in, out := &in.HighwaySubnetIDRef, &out.HighwaySubnetIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.HighwaySubnetIDSelector != nil { + in, out := &in.HighwaySubnetIDSelector, &out.HighwaySubnetIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.IgnoreAddons != nil { in, out := &in.IgnoreAddons, &out.IgnoreAddons *out = new(bool) @@ -1250,11 +1370,31 @@ func (in *ClusterV3Parameters) DeepCopyInto(out *ClusterV3Parameters) { *out = new(string) **out = **in } + if in.SubnetIDRef != nil { + in, out := &in.SubnetIDRef, &out.SubnetIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.SubnetIDSelector != nil { + in, out := &in.SubnetIDSelector, &out.SubnetIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.VPCID != nil { in, out := &in.VPCID, &out.VPCID *out = new(string) **out = **in } + if in.VPCIDRef != nil { + in, out := &in.VPCIDRef, &out.VPCIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.VPCIDSelector != nil { + in, out := &in.VPCIDSelector, &out.VPCIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterV3Parameters. @@ -1331,6 +1471,16 @@ func (in *DataVolumesInitParameters) DeepCopyInto(out *DataVolumesInitParameters *out = new(string) **out = **in } + if in.KMSIDRef != nil { + in, out := &in.KMSIDRef, &out.KMSIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.KMSIDSelector != nil { + in, out := &in.KMSIDSelector, &out.KMSIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Size != nil { in, out := &in.Size, &out.Size *out = new(float64) @@ -1433,6 +1583,16 @@ func (in *DataVolumesParameters) DeepCopyInto(out *DataVolumesParameters) { *out = new(string) **out = **in } + if in.KMSIDRef != nil { + in, out := &in.KMSIDRef, &out.KMSIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.KMSIDSelector != nil { + in, out := &in.KMSIDSelector, &out.KMSIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Size != nil { in, out := &in.Size, &out.Size *out = new(float64) @@ -1490,6 +1650,16 @@ func (in *NodePoolV3InitParameters) DeepCopyInto(out *NodePoolV3InitParameters) *out = new(string) **out = **in } + if in.AgencyNameRef != nil { + in, out := &in.AgencyNameRef, &out.AgencyNameRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.AgencyNameSelector != nil { + in, out := &in.AgencyNameSelector, &out.AgencyNameSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.AvailabilityZone != nil { in, out := &in.AvailabilityZone, &out.AvailabilityZone *out = new(string) @@ -1500,6 +1670,16 @@ func (in *NodePoolV3InitParameters) DeepCopyInto(out *NodePoolV3InitParameters) *out = new(string) **out = **in } + if in.ClusterIDRef != nil { + in, out := &in.ClusterIDRef, &out.ClusterIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.ClusterIDSelector != nil { + in, out := &in.ClusterIDSelector, &out.ClusterIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.DataVolumes != nil { in, out := &in.DataVolumes, &out.DataVolumes *out = make([]DataVolumesInitParameters, len(*in)) @@ -1548,6 +1728,16 @@ func (in *NodePoolV3InitParameters) DeepCopyInto(out *NodePoolV3InitParameters) *out = new(string) **out = **in } + if in.KeyPairRef != nil { + in, out := &in.KeyPairRef, &out.KeyPairRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.KeyPairSelector != nil { + in, out := &in.KeyPairSelector, &out.KeyPairSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.MaxNodeCount != nil { in, out := &in.MaxNodeCount, &out.MaxNodeCount *out = new(float64) @@ -1630,6 +1820,16 @@ func (in *NodePoolV3InitParameters) DeepCopyInto(out *NodePoolV3InitParameters) *out = new(string) **out = **in } + if in.SubnetIDRef != nil { + in, out := &in.SubnetIDRef, &out.SubnetIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.SubnetIDSelector != nil { + in, out := &in.SubnetIDSelector, &out.SubnetIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Taints != nil { in, out := &in.Taints, &out.Taints *out = make([]TaintsInitParameters, len(*in)) @@ -1893,6 +2093,16 @@ func (in *NodePoolV3Parameters) DeepCopyInto(out *NodePoolV3Parameters) { *out = new(string) **out = **in } + if in.AgencyNameRef != nil { + in, out := &in.AgencyNameRef, &out.AgencyNameRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.AgencyNameSelector != nil { + in, out := &in.AgencyNameSelector, &out.AgencyNameSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.AvailabilityZone != nil { in, out := &in.AvailabilityZone, &out.AvailabilityZone *out = new(string) @@ -1903,6 +2113,16 @@ func (in *NodePoolV3Parameters) DeepCopyInto(out *NodePoolV3Parameters) { *out = new(string) **out = **in } + if in.ClusterIDRef != nil { + in, out := &in.ClusterIDRef, &out.ClusterIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.ClusterIDSelector != nil { + in, out := &in.ClusterIDSelector, &out.ClusterIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.DataVolumes != nil { in, out := &in.DataVolumes, &out.DataVolumes *out = make([]DataVolumesParameters, len(*in)) @@ -1951,6 +2171,16 @@ func (in *NodePoolV3Parameters) DeepCopyInto(out *NodePoolV3Parameters) { *out = new(string) **out = **in } + if in.KeyPairRef != nil { + in, out := &in.KeyPairRef, &out.KeyPairRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.KeyPairSelector != nil { + in, out := &in.KeyPairSelector, &out.KeyPairSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.MaxNodeCount != nil { in, out := &in.MaxNodeCount, &out.MaxNodeCount *out = new(float64) @@ -2033,6 +2263,16 @@ func (in *NodePoolV3Parameters) DeepCopyInto(out *NodePoolV3Parameters) { *out = new(string) **out = **in } + if in.SubnetIDRef != nil { + in, out := &in.SubnetIDRef, &out.SubnetIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.SubnetIDSelector != nil { + in, out := &in.SubnetIDSelector, &out.SubnetIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Taints != nil { in, out := &in.Taints, &out.Taints *out = make([]TaintsParameters, len(*in)) @@ -2159,6 +2399,16 @@ func (in *NodeV3DataVolumesInitParameters) DeepCopyInto(out *NodeV3DataVolumesIn *out = new(string) **out = **in } + if in.KMSIDRef != nil { + in, out := &in.KMSIDRef, &out.KMSIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.KMSIDSelector != nil { + in, out := &in.KMSIDSelector, &out.KMSIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Size != nil { in, out := &in.Size, &out.Size *out = new(float64) @@ -2261,6 +2511,16 @@ func (in *NodeV3DataVolumesParameters) DeepCopyInto(out *NodeV3DataVolumesParame *out = new(string) **out = **in } + if in.KMSIDRef != nil { + in, out := &in.KMSIDRef, &out.KMSIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.KMSIDSelector != nil { + in, out := &in.KMSIDSelector, &out.KMSIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Size != nil { in, out := &in.Size, &out.Size *out = new(float64) @@ -2291,6 +2551,16 @@ func (in *NodeV3InitParameters) DeepCopyInto(out *NodeV3InitParameters) { *out = new(string) **out = **in } + if in.AgencyNameRef != nil { + in, out := &in.AgencyNameRef, &out.AgencyNameRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.AgencyNameSelector != nil { + in, out := &in.AgencyNameSelector, &out.AgencyNameSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Annotations != nil { in, out := &in.Annotations, &out.Annotations *out = make(map[string]*string, len(*in)) @@ -2332,6 +2602,16 @@ func (in *NodeV3InitParameters) DeepCopyInto(out *NodeV3InitParameters) { *out = new(string) **out = **in } + if in.ClusterIDRef != nil { + in, out := &in.ClusterIDRef, &out.ClusterIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.ClusterIDSelector != nil { + in, out := &in.ClusterIDSelector, &out.ClusterIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.DataVolumes != nil { in, out := &in.DataVolumes, &out.DataVolumes *out = make([]NodeV3DataVolumesInitParameters, len(*in)) @@ -2365,6 +2645,18 @@ func (in *NodeV3InitParameters) DeepCopyInto(out *NodeV3InitParameters) { } } } + if in.EIPIdsRefs != nil { + in, out := &in.EIPIdsRefs, &out.EIPIdsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.EIPIdsSelector != nil { + in, out := &in.EIPIdsSelector, &out.EIPIdsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.EcsPerformanceType != nil { in, out := &in.EcsPerformanceType, &out.EcsPerformanceType *out = new(string) @@ -2406,6 +2698,16 @@ func (in *NodeV3InitParameters) DeepCopyInto(out *NodeV3InitParameters) { *out = new(string) **out = **in } + if in.KeyPairRef != nil { + in, out := &in.KeyPairRef, &out.KeyPairRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.KeyPairSelector != nil { + in, out := &in.KeyPairSelector, &out.KeyPairSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Labels != nil { in, out := &in.Labels, &out.Labels *out = make(map[string]*string, len(*in)) @@ -2835,6 +3137,16 @@ func (in *NodeV3Parameters) DeepCopyInto(out *NodeV3Parameters) { *out = new(string) **out = **in } + if in.AgencyNameRef != nil { + in, out := &in.AgencyNameRef, &out.AgencyNameRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.AgencyNameSelector != nil { + in, out := &in.AgencyNameSelector, &out.AgencyNameSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Annotations != nil { in, out := &in.Annotations, &out.Annotations *out = make(map[string]*string, len(*in)) @@ -2876,6 +3188,16 @@ func (in *NodeV3Parameters) DeepCopyInto(out *NodeV3Parameters) { *out = new(string) **out = **in } + if in.ClusterIDRef != nil { + in, out := &in.ClusterIDRef, &out.ClusterIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.ClusterIDSelector != nil { + in, out := &in.ClusterIDSelector, &out.ClusterIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.DataVolumes != nil { in, out := &in.DataVolumes, &out.DataVolumes *out = make([]NodeV3DataVolumesParameters, len(*in)) @@ -2909,6 +3231,18 @@ func (in *NodeV3Parameters) DeepCopyInto(out *NodeV3Parameters) { } } } + if in.EIPIdsRefs != nil { + in, out := &in.EIPIdsRefs, &out.EIPIdsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.EIPIdsSelector != nil { + in, out := &in.EIPIdsSelector, &out.EIPIdsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.EcsPerformanceType != nil { in, out := &in.EcsPerformanceType, &out.EcsPerformanceType *out = new(string) @@ -2950,6 +3284,16 @@ func (in *NodeV3Parameters) DeepCopyInto(out *NodeV3Parameters) { *out = new(string) **out = **in } + if in.KeyPairRef != nil { + in, out := &in.KeyPairRef, &out.KeyPairRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.KeyPairSelector != nil { + in, out := &in.KeyPairSelector, &out.KeyPairSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Labels != nil { in, out := &in.Labels, &out.Labels *out = make(map[string]*string, len(*in)) @@ -3102,6 +3446,16 @@ func (in *NodeV3RootVolumeInitParameters) DeepCopyInto(out *NodeV3RootVolumeInit *out = new(string) **out = **in } + if in.KMSIDRef != nil { + in, out := &in.KMSIDRef, &out.KMSIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.KMSIDSelector != nil { + in, out := &in.KMSIDSelector, &out.KMSIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Size != nil { in, out := &in.Size, &out.Size *out = new(float64) @@ -3204,6 +3558,16 @@ func (in *NodeV3RootVolumeParameters) DeepCopyInto(out *NodeV3RootVolumeParamete *out = new(string) **out = **in } + if in.KMSIDRef != nil { + in, out := &in.KMSIDRef, &out.KMSIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.KMSIDSelector != nil { + in, out := &in.KMSIDSelector, &out.KMSIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Size != nil { in, out := &in.Size, &out.Size *out = new(float64) @@ -3380,6 +3744,16 @@ func (in *RootVolumeInitParameters) DeepCopyInto(out *RootVolumeInitParameters) *out = new(string) **out = **in } + if in.KMSIDRef != nil { + in, out := &in.KMSIDRef, &out.KMSIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.KMSIDSelector != nil { + in, out := &in.KMSIDSelector, &out.KMSIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Size != nil { in, out := &in.Size, &out.Size *out = new(float64) @@ -3482,6 +3856,16 @@ func (in *RootVolumeParameters) DeepCopyInto(out *RootVolumeParameters) { *out = new(string) **out = **in } + if in.KMSIDRef != nil { + in, out := &in.KMSIDRef, &out.KMSIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.KMSIDSelector != nil { + in, out := &in.KMSIDSelector, &out.KMSIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Size != nil { in, out := &in.Size, &out.Size *out = new(float64) diff --git a/apis/cce/v1alpha1/zz_generated.resolvers.go b/apis/cce/v1alpha1/zz_generated.resolvers.go new file mode 100644 index 0000000..c4bfa40 --- /dev/null +++ b/apis/cce/v1alpha1/zz_generated.resolvers.go @@ -0,0 +1,684 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + reference "github.com/crossplane/crossplane-runtime/pkg/reference" + v1alpha13 "github.com/opentelekomcloud/provider-opentelekomcloud/apis/compute/v1alpha1" + v1alpha11 "github.com/opentelekomcloud/provider-opentelekomcloud/apis/identity/v1alpha1" + v1alpha12 "github.com/opentelekomcloud/provider-opentelekomcloud/apis/kms/v1alpha1" + v1alpha1 "github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1" + common "github.com/opentelekomcloud/provider-opentelekomcloud/config/common" + errors "github.com/pkg/errors" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +// ResolveReferences of this AddonV3. +func (mg *AddonV3) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.ClusterID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.ClusterIDRef, + Selector: mg.Spec.ForProvider.ClusterIDSelector, + To: reference.To{ + List: &ClusterV3List{}, + Managed: &ClusterV3{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.ClusterID") + } + mg.Spec.ForProvider.ClusterID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.ClusterIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.ClusterID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.ClusterIDRef, + Selector: mg.Spec.InitProvider.ClusterIDSelector, + To: reference.To{ + List: &ClusterV3List{}, + Managed: &ClusterV3{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.ClusterID") + } + mg.Spec.InitProvider.ClusterID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.ClusterIDRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this ClusterV3. +func (mg *ClusterV3) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.EIP), + Extract: common.ExtractEipAddress(), + Reference: mg.Spec.ForProvider.EIPRef, + Selector: mg.Spec.ForProvider.EIPSelector, + To: reference.To{ + List: &v1alpha1.EIPV1List{}, + Managed: &v1alpha1.EIPV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.EIP") + } + mg.Spec.ForProvider.EIP = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.EIPRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.EniSubnetCidr), + Extract: common.ExtractSubnetCIDR(), + Reference: mg.Spec.ForProvider.EniSubnetCidrRef, + Selector: mg.Spec.ForProvider.EniSubnetCidrSelector, + To: reference.To{ + List: &v1alpha1.SubnetV1List{}, + Managed: &v1alpha1.SubnetV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.EniSubnetCidr") + } + mg.Spec.ForProvider.EniSubnetCidr = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.EniSubnetCidrRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.EniSubnetID), + Extract: common.ExtractSubnetID(), + Reference: mg.Spec.ForProvider.EniSubnetIDRef, + Selector: mg.Spec.ForProvider.EniSubnetIDSelector, + To: reference.To{ + List: &v1alpha1.SubnetV1List{}, + Managed: &v1alpha1.SubnetV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.EniSubnetID") + } + mg.Spec.ForProvider.EniSubnetID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.EniSubnetIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.HighwaySubnetID), + Extract: common.ExtractNetworkID(), + Reference: mg.Spec.ForProvider.HighwaySubnetIDRef, + Selector: mg.Spec.ForProvider.HighwaySubnetIDSelector, + To: reference.To{ + List: &v1alpha1.SubnetV1List{}, + Managed: &v1alpha1.SubnetV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.HighwaySubnetID") + } + mg.Spec.ForProvider.HighwaySubnetID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.HighwaySubnetIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.SubnetID), + Extract: common.ExtractNetworkID(), + Reference: mg.Spec.ForProvider.SubnetIDRef, + Selector: mg.Spec.ForProvider.SubnetIDSelector, + To: reference.To{ + List: &v1alpha1.SubnetV1List{}, + Managed: &v1alpha1.SubnetV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.SubnetID") + } + mg.Spec.ForProvider.SubnetID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.SubnetIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.VPCID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.VPCIDRef, + Selector: mg.Spec.ForProvider.VPCIDSelector, + To: reference.To{ + List: &v1alpha1.VpcV1List{}, + Managed: &v1alpha1.VpcV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.VPCID") + } + mg.Spec.ForProvider.VPCID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.VPCIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.EIP), + Extract: common.ExtractEipAddress(), + Reference: mg.Spec.InitProvider.EIPRef, + Selector: mg.Spec.InitProvider.EIPSelector, + To: reference.To{ + List: &v1alpha1.EIPV1List{}, + Managed: &v1alpha1.EIPV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.EIP") + } + mg.Spec.InitProvider.EIP = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.EIPRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.EniSubnetCidr), + Extract: common.ExtractSubnetCIDR(), + Reference: mg.Spec.InitProvider.EniSubnetCidrRef, + Selector: mg.Spec.InitProvider.EniSubnetCidrSelector, + To: reference.To{ + List: &v1alpha1.SubnetV1List{}, + Managed: &v1alpha1.SubnetV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.EniSubnetCidr") + } + mg.Spec.InitProvider.EniSubnetCidr = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.EniSubnetCidrRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.EniSubnetID), + Extract: common.ExtractSubnetID(), + Reference: mg.Spec.InitProvider.EniSubnetIDRef, + Selector: mg.Spec.InitProvider.EniSubnetIDSelector, + To: reference.To{ + List: &v1alpha1.SubnetV1List{}, + Managed: &v1alpha1.SubnetV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.EniSubnetID") + } + mg.Spec.InitProvider.EniSubnetID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.EniSubnetIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.HighwaySubnetID), + Extract: common.ExtractNetworkID(), + Reference: mg.Spec.InitProvider.HighwaySubnetIDRef, + Selector: mg.Spec.InitProvider.HighwaySubnetIDSelector, + To: reference.To{ + List: &v1alpha1.SubnetV1List{}, + Managed: &v1alpha1.SubnetV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.HighwaySubnetID") + } + mg.Spec.InitProvider.HighwaySubnetID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.HighwaySubnetIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.SubnetID), + Extract: common.ExtractNetworkID(), + Reference: mg.Spec.InitProvider.SubnetIDRef, + Selector: mg.Spec.InitProvider.SubnetIDSelector, + To: reference.To{ + List: &v1alpha1.SubnetV1List{}, + Managed: &v1alpha1.SubnetV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.SubnetID") + } + mg.Spec.InitProvider.SubnetID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.SubnetIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.VPCID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.VPCIDRef, + Selector: mg.Spec.InitProvider.VPCIDSelector, + To: reference.To{ + List: &v1alpha1.VpcV1List{}, + Managed: &v1alpha1.VpcV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.VPCID") + } + mg.Spec.InitProvider.VPCID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.VPCIDRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this NodePoolV3. +func (mg *NodePoolV3) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.AgencyName), + Extract: common.ExtractAgencyName(), + Reference: mg.Spec.ForProvider.AgencyNameRef, + Selector: mg.Spec.ForProvider.AgencyNameSelector, + To: reference.To{ + List: &v1alpha11.AgencyV3List{}, + Managed: &v1alpha11.AgencyV3{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.AgencyName") + } + mg.Spec.ForProvider.AgencyName = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.AgencyNameRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.ClusterID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.ClusterIDRef, + Selector: mg.Spec.ForProvider.ClusterIDSelector, + To: reference.To{ + List: &ClusterV3List{}, + Managed: &ClusterV3{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.ClusterID") + } + mg.Spec.ForProvider.ClusterID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.ClusterIDRef = rsp.ResolvedReference + + for i3 := 0; i3 < len(mg.Spec.ForProvider.DataVolumes); i3++ { + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.DataVolumes[i3].KMSID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.DataVolumes[i3].KMSIDRef, + Selector: mg.Spec.ForProvider.DataVolumes[i3].KMSIDSelector, + To: reference.To{ + List: &v1alpha12.KeyV1List{}, + Managed: &v1alpha12.KeyV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.DataVolumes[i3].KMSID") + } + mg.Spec.ForProvider.DataVolumes[i3].KMSID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.DataVolumes[i3].KMSIDRef = rsp.ResolvedReference + + } + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.KeyPair), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.KeyPairRef, + Selector: mg.Spec.ForProvider.KeyPairSelector, + To: reference.To{ + List: &v1alpha13.KeypairV2List{}, + Managed: &v1alpha13.KeypairV2{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.KeyPair") + } + mg.Spec.ForProvider.KeyPair = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.KeyPairRef = rsp.ResolvedReference + + for i3 := 0; i3 < len(mg.Spec.ForProvider.RootVolume); i3++ { + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.RootVolume[i3].KMSID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.RootVolume[i3].KMSIDRef, + Selector: mg.Spec.ForProvider.RootVolume[i3].KMSIDSelector, + To: reference.To{ + List: &v1alpha12.KeyV1List{}, + Managed: &v1alpha12.KeyV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.RootVolume[i3].KMSID") + } + mg.Spec.ForProvider.RootVolume[i3].KMSID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.RootVolume[i3].KMSIDRef = rsp.ResolvedReference + + } + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.SubnetID), + Extract: common.ExtractNetworkID(), + Reference: mg.Spec.ForProvider.SubnetIDRef, + Selector: mg.Spec.ForProvider.SubnetIDSelector, + To: reference.To{ + List: &v1alpha1.SubnetV1List{}, + Managed: &v1alpha1.SubnetV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.SubnetID") + } + mg.Spec.ForProvider.SubnetID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.SubnetIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.AgencyName), + Extract: common.ExtractAgencyName(), + Reference: mg.Spec.InitProvider.AgencyNameRef, + Selector: mg.Spec.InitProvider.AgencyNameSelector, + To: reference.To{ + List: &v1alpha11.AgencyV3List{}, + Managed: &v1alpha11.AgencyV3{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.AgencyName") + } + mg.Spec.InitProvider.AgencyName = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.AgencyNameRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.ClusterID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.ClusterIDRef, + Selector: mg.Spec.InitProvider.ClusterIDSelector, + To: reference.To{ + List: &ClusterV3List{}, + Managed: &ClusterV3{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.ClusterID") + } + mg.Spec.InitProvider.ClusterID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.ClusterIDRef = rsp.ResolvedReference + + for i3 := 0; i3 < len(mg.Spec.InitProvider.DataVolumes); i3++ { + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.DataVolumes[i3].KMSID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.DataVolumes[i3].KMSIDRef, + Selector: mg.Spec.InitProvider.DataVolumes[i3].KMSIDSelector, + To: reference.To{ + List: &v1alpha12.KeyV1List{}, + Managed: &v1alpha12.KeyV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.DataVolumes[i3].KMSID") + } + mg.Spec.InitProvider.DataVolumes[i3].KMSID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.DataVolumes[i3].KMSIDRef = rsp.ResolvedReference + + } + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.KeyPair), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.KeyPairRef, + Selector: mg.Spec.InitProvider.KeyPairSelector, + To: reference.To{ + List: &v1alpha13.KeypairV2List{}, + Managed: &v1alpha13.KeypairV2{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.KeyPair") + } + mg.Spec.InitProvider.KeyPair = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.KeyPairRef = rsp.ResolvedReference + + for i3 := 0; i3 < len(mg.Spec.InitProvider.RootVolume); i3++ { + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.RootVolume[i3].KMSID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.RootVolume[i3].KMSIDRef, + Selector: mg.Spec.InitProvider.RootVolume[i3].KMSIDSelector, + To: reference.To{ + List: &v1alpha12.KeyV1List{}, + Managed: &v1alpha12.KeyV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.RootVolume[i3].KMSID") + } + mg.Spec.InitProvider.RootVolume[i3].KMSID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.RootVolume[i3].KMSIDRef = rsp.ResolvedReference + + } + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.SubnetID), + Extract: common.ExtractNetworkID(), + Reference: mg.Spec.InitProvider.SubnetIDRef, + Selector: mg.Spec.InitProvider.SubnetIDSelector, + To: reference.To{ + List: &v1alpha1.SubnetV1List{}, + Managed: &v1alpha1.SubnetV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.SubnetID") + } + mg.Spec.InitProvider.SubnetID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.SubnetIDRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this NodeV3. +func (mg *NodeV3) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var mrsp reference.MultiResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.AgencyName), + Extract: common.ExtractAgencyName(), + Reference: mg.Spec.ForProvider.AgencyNameRef, + Selector: mg.Spec.ForProvider.AgencyNameSelector, + To: reference.To{ + List: &v1alpha11.AgencyV3List{}, + Managed: &v1alpha11.AgencyV3{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.AgencyName") + } + mg.Spec.ForProvider.AgencyName = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.AgencyNameRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.ClusterID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.ClusterIDRef, + Selector: mg.Spec.ForProvider.ClusterIDSelector, + To: reference.To{ + List: &ClusterV3List{}, + Managed: &ClusterV3{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.ClusterID") + } + mg.Spec.ForProvider.ClusterID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.ClusterIDRef = rsp.ResolvedReference + + for i3 := 0; i3 < len(mg.Spec.ForProvider.DataVolumes); i3++ { + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.DataVolumes[i3].KMSID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.DataVolumes[i3].KMSIDRef, + Selector: mg.Spec.ForProvider.DataVolumes[i3].KMSIDSelector, + To: reference.To{ + List: &v1alpha12.KeyV1List{}, + Managed: &v1alpha12.KeyV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.DataVolumes[i3].KMSID") + } + mg.Spec.ForProvider.DataVolumes[i3].KMSID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.DataVolumes[i3].KMSIDRef = rsp.ResolvedReference + + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.EIPIds), + Extract: reference.ExternalName(), + References: mg.Spec.ForProvider.EIPIdsRefs, + Selector: mg.Spec.ForProvider.EIPIdsSelector, + To: reference.To{ + List: &v1alpha1.EIPV1List{}, + Managed: &v1alpha1.EIPV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.EIPIds") + } + mg.Spec.ForProvider.EIPIds = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.EIPIdsRefs = mrsp.ResolvedReferences + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.KeyPair), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.KeyPairRef, + Selector: mg.Spec.ForProvider.KeyPairSelector, + To: reference.To{ + List: &v1alpha13.KeypairV2List{}, + Managed: &v1alpha13.KeypairV2{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.KeyPair") + } + mg.Spec.ForProvider.KeyPair = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.KeyPairRef = rsp.ResolvedReference + + for i3 := 0; i3 < len(mg.Spec.ForProvider.RootVolume); i3++ { + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.RootVolume[i3].KMSID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.RootVolume[i3].KMSIDRef, + Selector: mg.Spec.ForProvider.RootVolume[i3].KMSIDSelector, + To: reference.To{ + List: &v1alpha12.KeyV1List{}, + Managed: &v1alpha12.KeyV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.RootVolume[i3].KMSID") + } + mg.Spec.ForProvider.RootVolume[i3].KMSID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.RootVolume[i3].KMSIDRef = rsp.ResolvedReference + + } + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.AgencyName), + Extract: common.ExtractAgencyName(), + Reference: mg.Spec.InitProvider.AgencyNameRef, + Selector: mg.Spec.InitProvider.AgencyNameSelector, + To: reference.To{ + List: &v1alpha11.AgencyV3List{}, + Managed: &v1alpha11.AgencyV3{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.AgencyName") + } + mg.Spec.InitProvider.AgencyName = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.AgencyNameRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.ClusterID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.ClusterIDRef, + Selector: mg.Spec.InitProvider.ClusterIDSelector, + To: reference.To{ + List: &ClusterV3List{}, + Managed: &ClusterV3{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.ClusterID") + } + mg.Spec.InitProvider.ClusterID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.ClusterIDRef = rsp.ResolvedReference + + for i3 := 0; i3 < len(mg.Spec.InitProvider.DataVolumes); i3++ { + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.DataVolumes[i3].KMSID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.DataVolumes[i3].KMSIDRef, + Selector: mg.Spec.InitProvider.DataVolumes[i3].KMSIDSelector, + To: reference.To{ + List: &v1alpha12.KeyV1List{}, + Managed: &v1alpha12.KeyV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.DataVolumes[i3].KMSID") + } + mg.Spec.InitProvider.DataVolumes[i3].KMSID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.DataVolumes[i3].KMSIDRef = rsp.ResolvedReference + + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.EIPIds), + Extract: reference.ExternalName(), + References: mg.Spec.InitProvider.EIPIdsRefs, + Selector: mg.Spec.InitProvider.EIPIdsSelector, + To: reference.To{ + List: &v1alpha1.EIPV1List{}, + Managed: &v1alpha1.EIPV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.EIPIds") + } + mg.Spec.InitProvider.EIPIds = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.EIPIdsRefs = mrsp.ResolvedReferences + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.KeyPair), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.KeyPairRef, + Selector: mg.Spec.InitProvider.KeyPairSelector, + To: reference.To{ + List: &v1alpha13.KeypairV2List{}, + Managed: &v1alpha13.KeypairV2{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.KeyPair") + } + mg.Spec.InitProvider.KeyPair = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.KeyPairRef = rsp.ResolvedReference + + for i3 := 0; i3 < len(mg.Spec.InitProvider.RootVolume); i3++ { + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.RootVolume[i3].KMSID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.RootVolume[i3].KMSIDRef, + Selector: mg.Spec.InitProvider.RootVolume[i3].KMSIDSelector, + To: reference.To{ + List: &v1alpha12.KeyV1List{}, + Managed: &v1alpha12.KeyV1{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.RootVolume[i3].KMSID") + } + mg.Spec.InitProvider.RootVolume[i3].KMSID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.RootVolume[i3].KMSIDRef = rsp.ResolvedReference + + } + + return nil +} diff --git a/apis/cce/v1alpha1/zz_nodepoolv3_types.go b/apis/cce/v1alpha1/zz_nodepoolv3_types.go index f8b1cb9..931574b 100755 --- a/apis/cce/v1alpha1/zz_nodepoolv3_types.go +++ b/apis/cce/v1alpha1/zz_nodepoolv3_types.go @@ -24,8 +24,17 @@ type DataVolumesInitParameters struct { ExtendParams map[string]*string `json:"extendParams,omitempty" tf:"extend_params,omitempty"` // The Encryption KMS ID of the system volume. By default, it tries to get from env by OS_KMS_ID. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/kms/v1alpha1.KeyV1 KMSID *string `json:"kmsId,omitempty" tf:"kms_id,omitempty"` + // Reference to a KeyV1 in kms to populate kmsId. + // +kubebuilder:validation:Optional + KMSIDRef *v1.Reference `json:"kmsIdRef,omitempty" tf:"-"` + + // Selector for a KeyV1 in kms to populate kmsId. + // +kubebuilder:validation:Optional + KMSIDSelector *v1.Selector `json:"kmsIdSelector,omitempty" tf:"-"` + // Disk size in GB. Size *float64 `json:"size,omitempty" tf:"size,omitempty"` @@ -66,9 +75,18 @@ type DataVolumesParameters struct { ExtendParams map[string]*string `json:"extendParams,omitempty" tf:"extend_params,omitempty"` // The Encryption KMS ID of the system volume. By default, it tries to get from env by OS_KMS_ID. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/kms/v1alpha1.KeyV1 // +kubebuilder:validation:Optional KMSID *string `json:"kmsId,omitempty" tf:"kms_id,omitempty"` + // Reference to a KeyV1 in kms to populate kmsId. + // +kubebuilder:validation:Optional + KMSIDRef *v1.Reference `json:"kmsIdRef,omitempty" tf:"-"` + + // Selector for a KeyV1 in kms to populate kmsId. + // +kubebuilder:validation:Optional + KMSIDSelector *v1.Selector `json:"kmsIdSelector,omitempty" tf:"-"` + // Disk size in GB. // +kubebuilder:validation:Optional Size *float64 `json:"size" tf:"size,omitempty"` @@ -81,16 +99,35 @@ type DataVolumesParameters struct { type NodePoolV3InitParameters struct { // IAM agency name. Changing this parameter will create a new resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/identity/v1alpha1.AgencyV3 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractAgencyName() AgencyName *string `json:"agencyName,omitempty" tf:"agency_name,omitempty"` + // Reference to a AgencyV3 in identity to populate agencyName. + // +kubebuilder:validation:Optional + AgencyNameRef *v1.Reference `json:"agencyNameRef,omitempty" tf:"-"` + + // Selector for a AgencyV3 in identity to populate agencyName. + // +kubebuilder:validation:Optional + AgencyNameSelector *v1.Selector `json:"agencyNameSelector,omitempty" tf:"-"` + // Specify the name of the available partition (AZ). If zone is not // specified than node_pool will be in randomly selected AZ. The default value is random. Changing // this parameter will create a new resource. AvailabilityZone *string `json:"availabilityZone,omitempty" tf:"availability_zone,omitempty"` // ID of the cluster. Changing this parameter will create a new resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/cce/v1alpha1.ClusterV3 ClusterID *string `json:"clusterId,omitempty" tf:"cluster_id,omitempty"` + // Reference to a ClusterV3 in cce to populate clusterId. + // +kubebuilder:validation:Optional + ClusterIDRef *v1.Reference `json:"clusterIdRef,omitempty" tf:"-"` + + // Selector for a ClusterV3 in cce to populate clusterId. + // +kubebuilder:validation:Optional + ClusterIDSelector *v1.Selector `json:"clusterIdSelector,omitempty" tf:"-"` + // Represents the data disk to be created. Changing this parameter will create a new resource. DataVolumes []DataVolumesInitParameters `json:"dataVolumes,omitempty" tf:"data_volumes,omitempty"` @@ -114,8 +151,17 @@ type NodePoolV3InitParameters struct { // Key pair name when logging in to select the key pair mode. // This parameter and password are alternative. Changing this parameter will create a new resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/compute/v1alpha1.KeypairV2 KeyPair *string `json:"keyPair,omitempty" tf:"key_pair,omitempty"` + // Reference to a KeypairV2 in compute to populate keyPair. + // +kubebuilder:validation:Optional + KeyPairRef *v1.Reference `json:"keyPairRef,omitempty" tf:"-"` + + // Selector for a KeypairV2 in compute to populate keyPair. + // +kubebuilder:validation:Optional + KeyPairSelector *v1.Selector `json:"keyPairSelector,omitempty" tf:"-"` + // Maximum number of nodes allowed if auto scaling is enabled. MaxNodeCount *float64 `json:"maxNodeCount,omitempty" tf:"max_node_count,omitempty"` @@ -172,8 +218,18 @@ type NodePoolV3InitParameters struct { Storage *string `json:"storage,omitempty" tf:"storage,omitempty"` // The ID of the subnet to which the NIC belongs. Changing this parameter will create a new resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.SubnetV1 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractNetworkID() SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` + // Reference to a SubnetV1 in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDRef *v1.Reference `json:"subnetIdRef,omitempty" tf:"-"` + + // Selector for a SubnetV1 in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDSelector *v1.Selector `json:"subnetIdSelector,omitempty" tf:"-"` + // Taints to created nodes to configure anti-affinity. Taints []TaintsInitParameters `json:"taints,omitempty" tf:"taints,omitempty"` @@ -291,9 +347,19 @@ type NodePoolV3Observation struct { type NodePoolV3Parameters struct { // IAM agency name. Changing this parameter will create a new resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/identity/v1alpha1.AgencyV3 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractAgencyName() // +kubebuilder:validation:Optional AgencyName *string `json:"agencyName,omitempty" tf:"agency_name,omitempty"` + // Reference to a AgencyV3 in identity to populate agencyName. + // +kubebuilder:validation:Optional + AgencyNameRef *v1.Reference `json:"agencyNameRef,omitempty" tf:"-"` + + // Selector for a AgencyV3 in identity to populate agencyName. + // +kubebuilder:validation:Optional + AgencyNameSelector *v1.Selector `json:"agencyNameSelector,omitempty" tf:"-"` + // Specify the name of the available partition (AZ). If zone is not // specified than node_pool will be in randomly selected AZ. The default value is random. Changing // this parameter will create a new resource. @@ -301,9 +367,18 @@ type NodePoolV3Parameters struct { AvailabilityZone *string `json:"availabilityZone,omitempty" tf:"availability_zone,omitempty"` // ID of the cluster. Changing this parameter will create a new resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/cce/v1alpha1.ClusterV3 // +kubebuilder:validation:Optional ClusterID *string `json:"clusterId,omitempty" tf:"cluster_id,omitempty"` + // Reference to a ClusterV3 in cce to populate clusterId. + // +kubebuilder:validation:Optional + ClusterIDRef *v1.Reference `json:"clusterIdRef,omitempty" tf:"-"` + + // Selector for a ClusterV3 in cce to populate clusterId. + // +kubebuilder:validation:Optional + ClusterIDSelector *v1.Selector `json:"clusterIdSelector,omitempty" tf:"-"` + // Represents the data disk to be created. Changing this parameter will create a new resource. // +kubebuilder:validation:Optional DataVolumes []DataVolumesParameters `json:"dataVolumes,omitempty" tf:"data_volumes,omitempty"` @@ -333,9 +408,18 @@ type NodePoolV3Parameters struct { // Key pair name when logging in to select the key pair mode. // This parameter and password are alternative. Changing this parameter will create a new resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/compute/v1alpha1.KeypairV2 // +kubebuilder:validation:Optional KeyPair *string `json:"keyPair,omitempty" tf:"key_pair,omitempty"` + // Reference to a KeypairV2 in compute to populate keyPair. + // +kubebuilder:validation:Optional + KeyPairRef *v1.Reference `json:"keyPairRef,omitempty" tf:"-"` + + // Selector for a KeypairV2 in compute to populate keyPair. + // +kubebuilder:validation:Optional + KeyPairSelector *v1.Selector `json:"keyPairSelector,omitempty" tf:"-"` + // Maximum number of nodes allowed if auto scaling is enabled. // +kubebuilder:validation:Optional MaxNodeCount *float64 `json:"maxNodeCount,omitempty" tf:"max_node_count,omitempty"` @@ -407,9 +491,19 @@ type NodePoolV3Parameters struct { Storage *string `json:"storage,omitempty" tf:"storage,omitempty"` // The ID of the subnet to which the NIC belongs. Changing this parameter will create a new resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.SubnetV1 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractNetworkID() // +kubebuilder:validation:Optional SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` + // Reference to a SubnetV1 in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDRef *v1.Reference `json:"subnetIdRef,omitempty" tf:"-"` + + // Selector for a SubnetV1 in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDSelector *v1.Selector `json:"subnetIdSelector,omitempty" tf:"-"` + // Taints to created nodes to configure anti-affinity. // +kubebuilder:validation:Optional Taints []TaintsParameters `json:"taints,omitempty" tf:"taints,omitempty"` @@ -431,8 +525,17 @@ type RootVolumeInitParameters struct { ExtendParams map[string]*string `json:"extendParams,omitempty" tf:"extend_params,omitempty"` // The Encryption KMS ID of the system volume. By default, it tries to get from env by OS_KMS_ID. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/kms/v1alpha1.KeyV1 KMSID *string `json:"kmsId,omitempty" tf:"kms_id,omitempty"` + // Reference to a KeyV1 in kms to populate kmsId. + // +kubebuilder:validation:Optional + KMSIDRef *v1.Reference `json:"kmsIdRef,omitempty" tf:"-"` + + // Selector for a KeyV1 in kms to populate kmsId. + // +kubebuilder:validation:Optional + KMSIDSelector *v1.Selector `json:"kmsIdSelector,omitempty" tf:"-"` + // Disk size in GB. Size *float64 `json:"size,omitempty" tf:"size,omitempty"` @@ -473,9 +576,18 @@ type RootVolumeParameters struct { ExtendParams map[string]*string `json:"extendParams,omitempty" tf:"extend_params,omitempty"` // The Encryption KMS ID of the system volume. By default, it tries to get from env by OS_KMS_ID. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/kms/v1alpha1.KeyV1 // +kubebuilder:validation:Optional KMSID *string `json:"kmsId,omitempty" tf:"kms_id,omitempty"` + // Reference to a KeyV1 in kms to populate kmsId. + // +kubebuilder:validation:Optional + KMSIDRef *v1.Reference `json:"kmsIdRef,omitempty" tf:"-"` + + // Selector for a KeyV1 in kms to populate kmsId. + // +kubebuilder:validation:Optional + KMSIDSelector *v1.Selector `json:"kmsIdSelector,omitempty" tf:"-"` + // Disk size in GB. // +kubebuilder:validation:Optional Size *float64 `json:"size" tf:"size,omitempty"` @@ -560,7 +672,6 @@ type NodePoolV3Status struct { type NodePoolV3 struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.clusterId) || (has(self.initProvider) && has(self.initProvider.clusterId))",message="spec.forProvider.clusterId is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.dataVolumes) || (has(self.initProvider) && has(self.initProvider.dataVolumes))",message="spec.forProvider.dataVolumes is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.flavor) || (has(self.initProvider) && has(self.initProvider.flavor))",message="spec.forProvider.flavor is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.initialNodeCount) || (has(self.initProvider) && has(self.initProvider.initialNodeCount))",message="spec.forProvider.initialNodeCount is a required parameter" diff --git a/apis/cce/v1alpha1/zz_nodev3_terraformed.go b/apis/cce/v1alpha1/zz_nodev3_terraformed.go index e5cb832..0583ad4 100755 --- a/apis/cce/v1alpha1/zz_nodev3_terraformed.go +++ b/apis/cce/v1alpha1/zz_nodev3_terraformed.go @@ -118,6 +118,11 @@ func (tr *NodeV3) LateInitialize(attrs []byte) (bool, error) { return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") } opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + opts = append(opts, resource.WithNameFilter("BandwidthChargeMode")) + opts = append(opts, resource.WithNameFilter("BandwidthSize")) + opts = append(opts, resource.WithNameFilter("EIPCount")) + opts = append(opts, resource.WithNameFilter("Iptype")) + opts = append(opts, resource.WithNameFilter("Sharetype")) li := resource.NewGenericLateInitializer(opts...) return li.LateInitialize(&tr.Spec.ForProvider, params) diff --git a/apis/cce/v1alpha1/zz_nodev3_types.go b/apis/cce/v1alpha1/zz_nodev3_types.go index d891d82..1d0f1c7 100755 --- a/apis/cce/v1alpha1/zz_nodev3_types.go +++ b/apis/cce/v1alpha1/zz_nodev3_types.go @@ -24,8 +24,17 @@ type NodeV3DataVolumesInitParameters struct { ExtendParams map[string]*string `json:"extendParams,omitempty" tf:"extend_params,omitempty"` // The Encryption KMS ID of the system volume. By default, it tries to get from env by OS_KMS_ID. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/kms/v1alpha1.KeyV1 KMSID *string `json:"kmsId,omitempty" tf:"kms_id,omitempty"` + // Reference to a KeyV1 in kms to populate kmsId. + // +kubebuilder:validation:Optional + KMSIDRef *v1.Reference `json:"kmsIdRef,omitempty" tf:"-"` + + // Selector for a KeyV1 in kms to populate kmsId. + // +kubebuilder:validation:Optional + KMSIDSelector *v1.Selector `json:"kmsIdSelector,omitempty" tf:"-"` + // Disk size in GB. Size *float64 `json:"size,omitempty" tf:"size,omitempty"` @@ -66,9 +75,18 @@ type NodeV3DataVolumesParameters struct { ExtendParams map[string]*string `json:"extendParams,omitempty" tf:"extend_params,omitempty"` // The Encryption KMS ID of the system volume. By default, it tries to get from env by OS_KMS_ID. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/kms/v1alpha1.KeyV1 // +kubebuilder:validation:Optional KMSID *string `json:"kmsId,omitempty" tf:"kms_id,omitempty"` + // Reference to a KeyV1 in kms to populate kmsId. + // +kubebuilder:validation:Optional + KMSIDRef *v1.Reference `json:"kmsIdRef,omitempty" tf:"-"` + + // Selector for a KeyV1 in kms to populate kmsId. + // +kubebuilder:validation:Optional + KMSIDSelector *v1.Selector `json:"kmsIdSelector,omitempty" tf:"-"` + // Disk size in GB. // +kubebuilder:validation:Optional Size *float64 `json:"size" tf:"size,omitempty"` @@ -81,8 +99,18 @@ type NodeV3DataVolumesParameters struct { type NodeV3InitParameters struct { // IAM agency name. Changing this parameter will create a new resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/identity/v1alpha1.AgencyV3 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractAgencyName() AgencyName *string `json:"agencyName,omitempty" tf:"agency_name,omitempty"` + // Reference to a AgencyV3 in identity to populate agencyName. + // +kubebuilder:validation:Optional + AgencyNameRef *v1.Reference `json:"agencyNameRef,omitempty" tf:"-"` + + // Selector for a AgencyV3 in identity to populate agencyName. + // +kubebuilder:validation:Optional + AgencyNameSelector *v1.Selector `json:"agencyNameSelector,omitempty" tf:"-"` + // Node annotation, key/value pair format. Changing this parameter will create a new resource // +mapType=granular Annotations map[string]*string `json:"annotations,omitempty" tf:"annotations,omitempty"` @@ -100,8 +128,17 @@ type NodeV3InitParameters struct { BillingMode *float64 `json:"billingMode,omitempty" tf:"billing_mode,omitempty"` // ID of the cluster. Changing this parameter will create a new resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/cce/v1alpha1.ClusterV3 ClusterID *string `json:"clusterId,omitempty" tf:"cluster_id,omitempty"` + // Reference to a ClusterV3 in cce to populate clusterId. + // +kubebuilder:validation:Optional + ClusterIDRef *v1.Reference `json:"clusterIdRef,omitempty" tf:"-"` + + // Selector for a ClusterV3 in cce to populate clusterId. + // +kubebuilder:validation:Optional + ClusterIDSelector *v1.Selector `json:"clusterIdSelector,omitempty" tf:"-"` + // Represents the data disk to be created. Changing this parameter will create a new resource. DataVolumes []NodeV3DataVolumesInitParameters `json:"dataVolumes,omitempty" tf:"data_volumes,omitempty"` @@ -117,9 +154,18 @@ type NodeV3InitParameters struct { EIPCount *float64 `json:"eipCount,omitempty" tf:"eip_count,omitempty"` // List of existing elastic IP IDs. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.EIPV1 // +listType=set EIPIds []*string `json:"eipIds,omitempty" tf:"eip_ids,omitempty"` + // References to EIPV1 in vpc to populate eipIds. + // +kubebuilder:validation:Optional + EIPIdsRefs []v1.Reference `json:"eipIdsRefs,omitempty" tf:"-"` + + // Selector for a list of EIPV1 in vpc to populate eipIds. + // +kubebuilder:validation:Optional + EIPIdsSelector *v1.Selector `json:"eipIdsSelector,omitempty" tf:"-"` + // Classification of cloud server specifications. Changing this parameter will create a new cluster resource. EcsPerformanceType *string `json:"ecsPerformanceType,omitempty" tf:"ecs_performance_type,omitempty"` @@ -137,8 +183,17 @@ type NodeV3InitParameters struct { K8STags map[string]*string `json:"k8sTags,omitempty" tf:"k8s_tags,omitempty"` // Key pair name when logging in to select the key pair mode. Changing this parameter will create a new resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/compute/v1alpha1.KeypairV2 KeyPair *string `json:"keyPair,omitempty" tf:"key_pair,omitempty"` + // Reference to a KeypairV2 in compute to populate keyPair. + // +kubebuilder:validation:Optional + KeyPairRef *v1.Reference `json:"keyPairRef,omitempty" tf:"-"` + + // Selector for a KeypairV2 in compute to populate keyPair. + // +kubebuilder:validation:Optional + KeyPairSelector *v1.Selector `json:"keyPairSelector,omitempty" tf:"-"` + // Node tag, key/value pair format. Changing this parameter will create a new resource. // +mapType=granular Labels map[string]*string `json:"labels,omitempty" tf:"labels,omitempty"` @@ -332,9 +387,19 @@ type NodeV3Observation struct { type NodeV3Parameters struct { // IAM agency name. Changing this parameter will create a new resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/identity/v1alpha1.AgencyV3 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractAgencyName() // +kubebuilder:validation:Optional AgencyName *string `json:"agencyName,omitempty" tf:"agency_name,omitempty"` + // Reference to a AgencyV3 in identity to populate agencyName. + // +kubebuilder:validation:Optional + AgencyNameRef *v1.Reference `json:"agencyNameRef,omitempty" tf:"-"` + + // Selector for a AgencyV3 in identity to populate agencyName. + // +kubebuilder:validation:Optional + AgencyNameSelector *v1.Selector `json:"agencyNameSelector,omitempty" tf:"-"` + // Node annotation, key/value pair format. Changing this parameter will create a new resource // +kubebuilder:validation:Optional // +mapType=granular @@ -357,9 +422,18 @@ type NodeV3Parameters struct { BillingMode *float64 `json:"billingMode,omitempty" tf:"billing_mode,omitempty"` // ID of the cluster. Changing this parameter will create a new resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/cce/v1alpha1.ClusterV3 // +kubebuilder:validation:Optional ClusterID *string `json:"clusterId,omitempty" tf:"cluster_id,omitempty"` + // Reference to a ClusterV3 in cce to populate clusterId. + // +kubebuilder:validation:Optional + ClusterIDRef *v1.Reference `json:"clusterIdRef,omitempty" tf:"-"` + + // Selector for a ClusterV3 in cce to populate clusterId. + // +kubebuilder:validation:Optional + ClusterIDSelector *v1.Selector `json:"clusterIdSelector,omitempty" tf:"-"` + // Represents the data disk to be created. Changing this parameter will create a new resource. // +kubebuilder:validation:Optional DataVolumes []NodeV3DataVolumesParameters `json:"dataVolumes,omitempty" tf:"data_volumes,omitempty"` @@ -379,10 +453,19 @@ type NodeV3Parameters struct { EIPCount *float64 `json:"eipCount,omitempty" tf:"eip_count,omitempty"` // List of existing elastic IP IDs. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.EIPV1 // +kubebuilder:validation:Optional // +listType=set EIPIds []*string `json:"eipIds,omitempty" tf:"eip_ids,omitempty"` + // References to EIPV1 in vpc to populate eipIds. + // +kubebuilder:validation:Optional + EIPIdsRefs []v1.Reference `json:"eipIdsRefs,omitempty" tf:"-"` + + // Selector for a list of EIPV1 in vpc to populate eipIds. + // +kubebuilder:validation:Optional + EIPIdsSelector *v1.Selector `json:"eipIdsSelector,omitempty" tf:"-"` + // Classification of cloud server specifications. Changing this parameter will create a new cluster resource. // +kubebuilder:validation:Optional EcsPerformanceType *string `json:"ecsPerformanceType,omitempty" tf:"ecs_performance_type,omitempty"` @@ -405,9 +488,18 @@ type NodeV3Parameters struct { K8STags map[string]*string `json:"k8sTags,omitempty" tf:"k8s_tags,omitempty"` // Key pair name when logging in to select the key pair mode. Changing this parameter will create a new resource. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/compute/v1alpha1.KeypairV2 // +kubebuilder:validation:Optional KeyPair *string `json:"keyPair,omitempty" tf:"key_pair,omitempty"` + // Reference to a KeypairV2 in compute to populate keyPair. + // +kubebuilder:validation:Optional + KeyPairRef *v1.Reference `json:"keyPairRef,omitempty" tf:"-"` + + // Selector for a KeypairV2 in compute to populate keyPair. + // +kubebuilder:validation:Optional + KeyPairSelector *v1.Selector `json:"keyPairSelector,omitempty" tf:"-"` + // Node tag, key/value pair format. Changing this parameter will create a new resource. // +kubebuilder:validation:Optional // +mapType=granular @@ -495,8 +587,17 @@ type NodeV3RootVolumeInitParameters struct { ExtendParams map[string]*string `json:"extendParams,omitempty" tf:"extend_params,omitempty"` // The Encryption KMS ID of the system volume. By default, it tries to get from env by OS_KMS_ID. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/kms/v1alpha1.KeyV1 KMSID *string `json:"kmsId,omitempty" tf:"kms_id,omitempty"` + // Reference to a KeyV1 in kms to populate kmsId. + // +kubebuilder:validation:Optional + KMSIDRef *v1.Reference `json:"kmsIdRef,omitempty" tf:"-"` + + // Selector for a KeyV1 in kms to populate kmsId. + // +kubebuilder:validation:Optional + KMSIDSelector *v1.Selector `json:"kmsIdSelector,omitempty" tf:"-"` + // Disk size in GB. Size *float64 `json:"size,omitempty" tf:"size,omitempty"` @@ -537,9 +638,18 @@ type NodeV3RootVolumeParameters struct { ExtendParams map[string]*string `json:"extendParams,omitempty" tf:"extend_params,omitempty"` // The Encryption KMS ID of the system volume. By default, it tries to get from env by OS_KMS_ID. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/kms/v1alpha1.KeyV1 // +kubebuilder:validation:Optional KMSID *string `json:"kmsId,omitempty" tf:"kms_id,omitempty"` + // Reference to a KeyV1 in kms to populate kmsId. + // +kubebuilder:validation:Optional + KMSIDRef *v1.Reference `json:"kmsIdRef,omitempty" tf:"-"` + + // Selector for a KeyV1 in kms to populate kmsId. + // +kubebuilder:validation:Optional + KMSIDSelector *v1.Selector `json:"kmsIdSelector,omitempty" tf:"-"` + // Disk size in GB. // +kubebuilder:validation:Optional Size *float64 `json:"size" tf:"size,omitempty"` @@ -625,10 +735,8 @@ type NodeV3 struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.availabilityZone) || (has(self.initProvider) && has(self.initProvider.availabilityZone))",message="spec.forProvider.availabilityZone is a required parameter" - // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.clusterId) || (has(self.initProvider) && has(self.initProvider.clusterId))",message="spec.forProvider.clusterId is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.dataVolumes) || (has(self.initProvider) && has(self.initProvider.dataVolumes))",message="spec.forProvider.dataVolumes is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.flavorId) || (has(self.initProvider) && has(self.initProvider.flavorId))",message="spec.forProvider.flavorId is a required parameter" - // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.keyPair) || (has(self.initProvider) && has(self.initProvider.keyPair))",message="spec.forProvider.keyPair is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.rootVolume) || (has(self.initProvider) && has(self.initProvider.rootVolume))",message="spec.forProvider.rootVolume is a required parameter" Spec NodeV3Spec `json:"spec"` Status NodeV3Status `json:"status,omitempty"` diff --git a/apis/compute/v1alpha1/zz_instancev2_types.go b/apis/compute/v1alpha1/zz_instancev2_types.go index 3bce382..c548a61 100755 --- a/apis/compute/v1alpha1/zz_instancev2_types.go +++ b/apis/compute/v1alpha1/zz_instancev2_types.go @@ -179,14 +179,14 @@ type InstanceV2InitParameters struct { // The name of a key pair to put on the server. The key pair must already be created and // associated with the tenant's account. Changing this creates a new server. - // +crossplane:generate:reference:type=KeypairV2 + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/compute/v1alpha1.KeypairV2 KeyPair *string `json:"keyPair,omitempty" tf:"key_pair,omitempty"` - // Reference to a KeypairV2 to populate keyPair. + // Reference to a KeypairV2 in compute to populate keyPair. // +kubebuilder:validation:Optional KeyPairRef *v1.Reference `json:"keyPairRef,omitempty" tf:"-"` - // Selector for a KeypairV2 to populate keyPair. + // Selector for a KeypairV2 in compute to populate keyPair. // +kubebuilder:validation:Optional KeyPairSelector *v1.Selector `json:"keyPairSelector,omitempty" tf:"-"` @@ -217,15 +217,15 @@ type InstanceV2InitParameters struct { // An array of one or more security group names to associate with the server. Changing // this results in adding/removing security groups from the existing server. - // +crossplane:generate:reference:type=SecgroupV2 + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/compute/v1alpha1.SecgroupV2 // +listType=set SecurityGroups []*string `json:"securityGroups,omitempty" tf:"security_groups,omitempty"` - // References to SecgroupV2 to populate securityGroups. + // References to SecgroupV2 in compute to populate securityGroups. // +kubebuilder:validation:Optional SecurityGroupsRefs []v1.Reference `json:"securityGroupsRefs,omitempty" tf:"-"` - // Selector for a list of SecgroupV2 to populate securityGroups. + // Selector for a list of SecgroupV2 in compute to populate securityGroups. // +kubebuilder:validation:Optional SecurityGroupsSelector *v1.Selector `json:"securityGroupsSelector,omitempty" tf:"-"` @@ -394,15 +394,15 @@ type InstanceV2Parameters struct { // The name of a key pair to put on the server. The key pair must already be created and // associated with the tenant's account. Changing this creates a new server. - // +crossplane:generate:reference:type=KeypairV2 + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/compute/v1alpha1.KeypairV2 // +kubebuilder:validation:Optional KeyPair *string `json:"keyPair,omitempty" tf:"key_pair,omitempty"` - // Reference to a KeypairV2 to populate keyPair. + // Reference to a KeypairV2 in compute to populate keyPair. // +kubebuilder:validation:Optional KeyPairRef *v1.Reference `json:"keyPairRef,omitempty" tf:"-"` - // Selector for a KeypairV2 to populate keyPair. + // Selector for a KeypairV2 in compute to populate keyPair. // +kubebuilder:validation:Optional KeyPairSelector *v1.Selector `json:"keyPairSelector,omitempty" tf:"-"` @@ -440,16 +440,16 @@ type InstanceV2Parameters struct { // An array of one or more security group names to associate with the server. Changing // this results in adding/removing security groups from the existing server. - // +crossplane:generate:reference:type=SecgroupV2 + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/compute/v1alpha1.SecgroupV2 // +kubebuilder:validation:Optional // +listType=set SecurityGroups []*string `json:"securityGroups,omitempty" tf:"security_groups,omitempty"` - // References to SecgroupV2 to populate securityGroups. + // References to SecgroupV2 in compute to populate securityGroups. // +kubebuilder:validation:Optional SecurityGroupsRefs []v1.Reference `json:"securityGroupsRefs,omitempty" tf:"-"` - // Selector for a list of SecgroupV2 to populate securityGroups. + // Selector for a list of SecgroupV2 in compute to populate securityGroups. // +kubebuilder:validation:Optional SecurityGroupsSelector *v1.Selector `json:"securityGroupsSelector,omitempty" tf:"-"` diff --git a/apis/ecs/v1alpha1/zz_generated.resolvers.go b/apis/ecs/v1alpha1/zz_generated.resolvers.go index 5b558c8..629109e 100644 --- a/apis/ecs/v1alpha1/zz_generated.resolvers.go +++ b/apis/ecs/v1alpha1/zz_generated.resolvers.go @@ -10,7 +10,7 @@ import ( reference "github.com/crossplane/crossplane-runtime/pkg/reference" v1alpha1 "github.com/opentelekomcloud/provider-opentelekomcloud/apis/compute/v1alpha1" v1alpha11 "github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1" - compute "github.com/opentelekomcloud/provider-opentelekomcloud/config/compute" + common "github.com/opentelekomcloud/provider-opentelekomcloud/config/common" errors "github.com/pkg/errors" client "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -42,7 +42,7 @@ func (mg *InstanceV1) ResolveReferences(ctx context.Context, c client.Reader) er for i3 := 0; i3 < len(mg.Spec.ForProvider.Nics); i3++ { rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Nics[i3].NetworkID), - Extract: compute.ExtractNetworkID(), + Extract: common.ExtractNetworkID(), Reference: mg.Spec.ForProvider.Nics[i3].NetworkIDRef, Selector: mg.Spec.ForProvider.Nics[i3].NetworkIDSelector, To: reference.To{ @@ -108,7 +108,7 @@ func (mg *InstanceV1) ResolveReferences(ctx context.Context, c client.Reader) er for i3 := 0; i3 < len(mg.Spec.InitProvider.Nics); i3++ { rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.Nics[i3].NetworkID), - Extract: compute.ExtractNetworkID(), + Extract: common.ExtractNetworkID(), Reference: mg.Spec.InitProvider.Nics[i3].NetworkIDRef, Selector: mg.Spec.InitProvider.Nics[i3].NetworkIDSelector, To: reference.To{ diff --git a/apis/ecs/v1alpha1/zz_instancev1_types.go b/apis/ecs/v1alpha1/zz_instancev1_types.go index c1c0da7..c9bcc40 100755 --- a/apis/ecs/v1alpha1/zz_instancev1_types.go +++ b/apis/ecs/v1alpha1/zz_instancev1_types.go @@ -374,7 +374,7 @@ type NicsInitParameters struct { // The network UUID to attach to the server. Changing this creates a new server. // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.SubnetV1 - // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/compute.ExtractNetworkID() + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractNetworkID() NetworkID *string `json:"networkId,omitempty" tf:"network_id,omitempty"` // Reference to a SubnetV1 in vpc to populate networkId. @@ -413,7 +413,7 @@ type NicsParameters struct { // The network UUID to attach to the server. Changing this creates a new server. // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.SubnetV1 - // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/compute.ExtractNetworkID() + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractNetworkID() // +kubebuilder:validation:Optional NetworkID *string `json:"networkId,omitempty" tf:"network_id,omitempty"` diff --git a/apis/kms/v1alpha1/zz_generated.conversion_hubs.go b/apis/kms/v1alpha1/zz_generated.conversion_hubs.go index c7199b6..5b014cf 100755 --- a/apis/kms/v1alpha1/zz_generated.conversion_hubs.go +++ b/apis/kms/v1alpha1/zz_generated.conversion_hubs.go @@ -8,3 +8,6 @@ package v1alpha1 // Hub marks this type as a conversion hub. func (tr *GrantV1) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *KeyV1) Hub() {} diff --git a/apis/kms/v1alpha1/zz_generated.deepcopy.go b/apis/kms/v1alpha1/zz_generated.deepcopy.go index d1fcea4..89214c3 100644 --- a/apis/kms/v1alpha1/zz_generated.deepcopy.go +++ b/apis/kms/v1alpha1/zz_generated.deepcopy.go @@ -258,3 +258,350 @@ func (in *GrantV1Status) DeepCopy() *GrantV1Status { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KeyV1) DeepCopyInto(out *KeyV1) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyV1. +func (in *KeyV1) DeepCopy() *KeyV1 { + if in == nil { + return nil + } + out := new(KeyV1) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *KeyV1) 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 *KeyV1InitParameters) DeepCopyInto(out *KeyV1InitParameters) { + *out = *in + if in.AllowCancelDeletion != nil { + in, out := &in.AllowCancelDeletion, &out.AllowCancelDeletion + *out = new(bool) + **out = **in + } + if in.IsEnabled != nil { + in, out := &in.IsEnabled, &out.IsEnabled + *out = new(bool) + **out = **in + } + if in.KeyAlias != nil { + in, out := &in.KeyAlias, &out.KeyAlias + *out = new(string) + **out = **in + } + if in.KeyDescription != nil { + in, out := &in.KeyDescription, &out.KeyDescription + *out = new(string) + **out = **in + } + if in.PendingDays != nil { + in, out := &in.PendingDays, &out.PendingDays + *out = new(string) + **out = **in + } + if in.Realm != nil { + in, out := &in.Realm, &out.Realm + *out = new(string) + **out = **in + } + if in.RotationEnabled != nil { + in, out := &in.RotationEnabled, &out.RotationEnabled + *out = new(bool) + **out = **in + } + if in.RotationInterval != nil { + in, out := &in.RotationInterval, &out.RotationInterval + *out = new(float64) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyV1InitParameters. +func (in *KeyV1InitParameters) DeepCopy() *KeyV1InitParameters { + if in == nil { + return nil + } + out := new(KeyV1InitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KeyV1List) DeepCopyInto(out *KeyV1List) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]KeyV1, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyV1List. +func (in *KeyV1List) DeepCopy() *KeyV1List { + if in == nil { + return nil + } + out := new(KeyV1List) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *KeyV1List) 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 *KeyV1Observation) DeepCopyInto(out *KeyV1Observation) { + *out = *in + if in.AllowCancelDeletion != nil { + in, out := &in.AllowCancelDeletion, &out.AllowCancelDeletion + *out = new(bool) + **out = **in + } + if in.CreationDate != nil { + in, out := &in.CreationDate, &out.CreationDate + *out = new(string) + **out = **in + } + if in.DefaultKeyFlag != nil { + in, out := &in.DefaultKeyFlag, &out.DefaultKeyFlag + *out = new(string) + **out = **in + } + if in.DomainID != nil { + in, out := &in.DomainID, &out.DomainID + *out = new(string) + **out = **in + } + if in.ExpirationTime != nil { + in, out := &in.ExpirationTime, &out.ExpirationTime + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.IsEnabled != nil { + in, out := &in.IsEnabled, &out.IsEnabled + *out = new(bool) + **out = **in + } + if in.KeyAlias != nil { + in, out := &in.KeyAlias, &out.KeyAlias + *out = new(string) + **out = **in + } + if in.KeyDescription != nil { + in, out := &in.KeyDescription, &out.KeyDescription + *out = new(string) + **out = **in + } + if in.Origin != nil { + in, out := &in.Origin, &out.Origin + *out = new(string) + **out = **in + } + if in.PendingDays != nil { + in, out := &in.PendingDays, &out.PendingDays + *out = new(string) + **out = **in + } + if in.Realm != nil { + in, out := &in.Realm, &out.Realm + *out = new(string) + **out = **in + } + if in.RotationEnabled != nil { + in, out := &in.RotationEnabled, &out.RotationEnabled + *out = new(bool) + **out = **in + } + if in.RotationInterval != nil { + in, out := &in.RotationInterval, &out.RotationInterval + *out = new(float64) + **out = **in + } + if in.RotationNumber != nil { + in, out := &in.RotationNumber, &out.RotationNumber + *out = new(float64) + **out = **in + } + if in.ScheduledDeletionDate != nil { + in, out := &in.ScheduledDeletionDate, &out.ScheduledDeletionDate + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyV1Observation. +func (in *KeyV1Observation) DeepCopy() *KeyV1Observation { + if in == nil { + return nil + } + out := new(KeyV1Observation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KeyV1Parameters) DeepCopyInto(out *KeyV1Parameters) { + *out = *in + if in.AllowCancelDeletion != nil { + in, out := &in.AllowCancelDeletion, &out.AllowCancelDeletion + *out = new(bool) + **out = **in + } + if in.IsEnabled != nil { + in, out := &in.IsEnabled, &out.IsEnabled + *out = new(bool) + **out = **in + } + if in.KeyAlias != nil { + in, out := &in.KeyAlias, &out.KeyAlias + *out = new(string) + **out = **in + } + if in.KeyDescription != nil { + in, out := &in.KeyDescription, &out.KeyDescription + *out = new(string) + **out = **in + } + if in.PendingDays != nil { + in, out := &in.PendingDays, &out.PendingDays + *out = new(string) + **out = **in + } + if in.Realm != nil { + in, out := &in.Realm, &out.Realm + *out = new(string) + **out = **in + } + if in.RotationEnabled != nil { + in, out := &in.RotationEnabled, &out.RotationEnabled + *out = new(bool) + **out = **in + } + if in.RotationInterval != nil { + in, out := &in.RotationInterval, &out.RotationInterval + *out = new(float64) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyV1Parameters. +func (in *KeyV1Parameters) DeepCopy() *KeyV1Parameters { + if in == nil { + return nil + } + out := new(KeyV1Parameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KeyV1Spec) DeepCopyInto(out *KeyV1Spec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyV1Spec. +func (in *KeyV1Spec) DeepCopy() *KeyV1Spec { + if in == nil { + return nil + } + out := new(KeyV1Spec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KeyV1Status) DeepCopyInto(out *KeyV1Status) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyV1Status. +func (in *KeyV1Status) DeepCopy() *KeyV1Status { + if in == nil { + return nil + } + out := new(KeyV1Status) + in.DeepCopyInto(out) + return out +} diff --git a/apis/kms/v1alpha1/zz_generated.managed.go b/apis/kms/v1alpha1/zz_generated.managed.go index aae06df..a2fcab7 100644 --- a/apis/kms/v1alpha1/zz_generated.managed.go +++ b/apis/kms/v1alpha1/zz_generated.managed.go @@ -66,3 +66,63 @@ func (mg *GrantV1) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetail func (mg *GrantV1) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } + +// GetCondition of this KeyV1. +func (mg *KeyV1) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this KeyV1. +func (mg *KeyV1) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this KeyV1. +func (mg *KeyV1) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this KeyV1. +func (mg *KeyV1) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this KeyV1. +func (mg *KeyV1) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this KeyV1. +func (mg *KeyV1) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this KeyV1. +func (mg *KeyV1) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this KeyV1. +func (mg *KeyV1) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this KeyV1. +func (mg *KeyV1) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this KeyV1. +func (mg *KeyV1) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this KeyV1. +func (mg *KeyV1) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this KeyV1. +func (mg *KeyV1) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/kms/v1alpha1/zz_generated.managedlist.go b/apis/kms/v1alpha1/zz_generated.managedlist.go index f8b00d9..2b62a4a 100644 --- a/apis/kms/v1alpha1/zz_generated.managedlist.go +++ b/apis/kms/v1alpha1/zz_generated.managedlist.go @@ -15,3 +15,12 @@ func (l *GrantV1List) GetItems() []resource.Managed { } return items } + +// GetItems of this KeyV1List. +func (l *KeyV1List) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} diff --git a/apis/kms/v1alpha1/zz_keyv1_terraformed.go b/apis/kms/v1alpha1/zz_keyv1_terraformed.go new file mode 100755 index 0000000..4c0c8fb --- /dev/null +++ b/apis/kms/v1alpha1/zz_keyv1_terraformed.go @@ -0,0 +1,129 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this KeyV1 +func (mg *KeyV1) GetTerraformResourceType() string { + return "opentelekomcloud_kms_key_v1" +} + +// GetConnectionDetailsMapping for this KeyV1 +func (tr *KeyV1) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this KeyV1 +func (tr *KeyV1) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this KeyV1 +func (tr *KeyV1) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this KeyV1 +func (tr *KeyV1) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this KeyV1 +func (tr *KeyV1) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this KeyV1 +func (tr *KeyV1) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// GetInitParameters of this KeyV1 +func (tr *KeyV1) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this KeyV1 +func (tr *KeyV1) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this KeyV1 using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *KeyV1) LateInitialize(attrs []byte) (bool, error) { + params := &KeyV1Parameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *KeyV1) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/kms/v1alpha1/zz_keyv1_types.go b/apis/kms/v1alpha1/zz_keyv1_types.go new file mode 100755 index 0000000..6cb3269 --- /dev/null +++ b/apis/kms/v1alpha1/zz_keyv1_types.go @@ -0,0 +1,227 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type KeyV1InitParameters struct { + + // Specifies whether the key is enabled from Pending Deletion state. The value true indicates + // that the key state Pending Deletion will be cancelled. + AllowCancelDeletion *bool `json:"allowCancelDeletion,omitempty" tf:"allow_cancel_deletion,omitempty"` + + // Specifies whether the key is enabled. Defaults to true. + // Changing this updates the state of existing key. + IsEnabled *bool `json:"isEnabled,omitempty" tf:"is_enabled,omitempty"` + + // The alias in which to create the key. It is required when + // we create a new key. Changing this updates the alias of key. + KeyAlias *string `json:"keyAlias,omitempty" tf:"key_alias,omitempty"` + + // The description of the key as viewed in OpenTelekomCloud console. + // Changing this updates the description of key. + KeyDescription *string `json:"keyDescription,omitempty" tf:"key_description,omitempty"` + + // Duration in days after which the key is deleted + // after destruction of the resource, must be between 7 and 1096 days. Defaults to 7. + // It only is used when delete a key. + PendingDays *string `json:"pendingDays,omitempty" tf:"pending_days,omitempty"` + + // Region where a key resides. Changing this creates a new key. + Realm *string `json:"realm,omitempty" tf:"realm,omitempty"` + + // Specifies whether the key is enabled for rotation. + RotationEnabled *bool `json:"rotationEnabled,omitempty" tf:"rotation_enabled,omitempty"` + + // Rotation interval. The value is an integer ranging from 30 to 365. + // Set the interval based on how often a CMK is used. + // If it is frequently used, set a short interval; otherwise, set a long one. + RotationInterval *float64 `json:"rotationInterval,omitempty" tf:"rotation_interval,omitempty"` + + // Tags key/value pairs to associate with the AutoScaling Group. + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` +} + +type KeyV1Observation struct { + + // Specifies whether the key is enabled from Pending Deletion state. The value true indicates + // that the key state Pending Deletion will be cancelled. + AllowCancelDeletion *bool `json:"allowCancelDeletion,omitempty" tf:"allow_cancel_deletion,omitempty"` + + // Creation time (time stamp) of a key. + CreationDate *string `json:"creationDate,omitempty" tf:"creation_date,omitempty"` + + // Identification of a Master Key. The value 1 indicates a Default + // Master Key, and the value 0 indicates a key. + DefaultKeyFlag *string `json:"defaultKeyFlag,omitempty" tf:"default_key_flag,omitempty"` + + // ID of a user domain for the key. + DomainID *string `json:"domainId,omitempty" tf:"domain_id,omitempty"` + + // Expiration time. + ExpirationTime *string `json:"expirationTime,omitempty" tf:"expiration_time,omitempty"` + + // The globally unique identifier for the key. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Specifies whether the key is enabled. Defaults to true. + // Changing this updates the state of existing key. + IsEnabled *bool `json:"isEnabled,omitempty" tf:"is_enabled,omitempty"` + + // The alias in which to create the key. It is required when + // we create a new key. Changing this updates the alias of key. + KeyAlias *string `json:"keyAlias,omitempty" tf:"key_alias,omitempty"` + + // The description of the key as viewed in OpenTelekomCloud console. + // Changing this updates the description of key. + KeyDescription *string `json:"keyDescription,omitempty" tf:"key_description,omitempty"` + + // Origin of a key. The default value is kms. + Origin *string `json:"origin,omitempty" tf:"origin,omitempty"` + + // Duration in days after which the key is deleted + // after destruction of the resource, must be between 7 and 1096 days. Defaults to 7. + // It only is used when delete a key. + PendingDays *string `json:"pendingDays,omitempty" tf:"pending_days,omitempty"` + + // Region where a key resides. Changing this creates a new key. + Realm *string `json:"realm,omitempty" tf:"realm,omitempty"` + + // Specifies whether the key is enabled for rotation. + RotationEnabled *bool `json:"rotationEnabled,omitempty" tf:"rotation_enabled,omitempty"` + + // Rotation interval. The value is an integer ranging from 30 to 365. + // Set the interval based on how often a CMK is used. + // If it is frequently used, set a short interval; otherwise, set a long one. + RotationInterval *float64 `json:"rotationInterval,omitempty" tf:"rotation_interval,omitempty"` + + // Number of key rotations. + RotationNumber *float64 `json:"rotationNumber,omitempty" tf:"rotation_number,omitempty"` + + // Scheduled deletion time (time stamp) of a key. + ScheduledDeletionDate *string `json:"scheduledDeletionDate,omitempty" tf:"scheduled_deletion_date,omitempty"` + + // Tags key/value pairs to associate with the AutoScaling Group. + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` +} + +type KeyV1Parameters struct { + + // Specifies whether the key is enabled from Pending Deletion state. The value true indicates + // that the key state Pending Deletion will be cancelled. + // +kubebuilder:validation:Optional + AllowCancelDeletion *bool `json:"allowCancelDeletion,omitempty" tf:"allow_cancel_deletion,omitempty"` + + // Specifies whether the key is enabled. Defaults to true. + // Changing this updates the state of existing key. + // +kubebuilder:validation:Optional + IsEnabled *bool `json:"isEnabled,omitempty" tf:"is_enabled,omitempty"` + + // The alias in which to create the key. It is required when + // we create a new key. Changing this updates the alias of key. + // +kubebuilder:validation:Optional + KeyAlias *string `json:"keyAlias,omitempty" tf:"key_alias,omitempty"` + + // The description of the key as viewed in OpenTelekomCloud console. + // Changing this updates the description of key. + // +kubebuilder:validation:Optional + KeyDescription *string `json:"keyDescription,omitempty" tf:"key_description,omitempty"` + + // Duration in days after which the key is deleted + // after destruction of the resource, must be between 7 and 1096 days. Defaults to 7. + // It only is used when delete a key. + // +kubebuilder:validation:Optional + PendingDays *string `json:"pendingDays,omitempty" tf:"pending_days,omitempty"` + + // Region where a key resides. Changing this creates a new key. + // +kubebuilder:validation:Optional + Realm *string `json:"realm,omitempty" tf:"realm,omitempty"` + + // Specifies whether the key is enabled for rotation. + // +kubebuilder:validation:Optional + RotationEnabled *bool `json:"rotationEnabled,omitempty" tf:"rotation_enabled,omitempty"` + + // Rotation interval. The value is an integer ranging from 30 to 365. + // Set the interval based on how often a CMK is used. + // If it is frequently used, set a short interval; otherwise, set a long one. + // +kubebuilder:validation:Optional + RotationInterval *float64 `json:"rotationInterval,omitempty" tf:"rotation_interval,omitempty"` + + // Tags key/value pairs to associate with the AutoScaling Group. + // +kubebuilder:validation:Optional + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` +} + +// KeyV1Spec defines the desired state of KeyV1 +type KeyV1Spec struct { + v1.ResourceSpec `json:",inline"` + ForProvider KeyV1Parameters `json:"forProvider"` + // THIS IS A BETA FIELD. It will be honored + // unless the Management Policies feature flag is disabled. + // InitProvider holds the same fields as ForProvider, with the exception + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // required on creation, but we do not desire to update them after creation, + // for example because of an external controller is managing them, like an + // autoscaler. + InitProvider KeyV1InitParameters `json:"initProvider,omitempty"` +} + +// KeyV1Status defines the observed state of KeyV1. +type KeyV1Status struct { + v1.ResourceStatus `json:",inline"` + AtProvider KeyV1Observation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// KeyV1 is the Schema for the KeyV1s API. Manages a KMS Key resource within OpenTelekomCloud. +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,opentelekomcloud} +type KeyV1 struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.keyAlias) || (has(self.initProvider) && has(self.initProvider.keyAlias))",message="spec.forProvider.keyAlias is a required parameter" + Spec KeyV1Spec `json:"spec"` + Status KeyV1Status `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// KeyV1List contains a list of KeyV1s +type KeyV1List struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []KeyV1 `json:"items"` +} + +// Repository type metadata. +var ( + KeyV1_Kind = "KeyV1" + KeyV1_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: KeyV1_Kind}.String() + KeyV1_KindAPIVersion = KeyV1_Kind + "." + CRDGroupVersion.String() + KeyV1_GroupVersionKind = CRDGroupVersion.WithKind(KeyV1_Kind) +) + +func init() { + SchemeBuilder.Register(&KeyV1{}, &KeyV1List{}) +} diff --git a/apis/rds/v1alpha1/zz_generated.resolvers.go b/apis/rds/v1alpha1/zz_generated.resolvers.go index 4ededdd..462aa88 100644 --- a/apis/rds/v1alpha1/zz_generated.resolvers.go +++ b/apis/rds/v1alpha1/zz_generated.resolvers.go @@ -10,7 +10,7 @@ import ( reference "github.com/crossplane/crossplane-runtime/pkg/reference" v1alpha11 "github.com/opentelekomcloud/provider-opentelekomcloud/apis/compute/v1alpha1" v1alpha1 "github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1" - rds "github.com/opentelekomcloud/provider-opentelekomcloud/config/rds" + common "github.com/opentelekomcloud/provider-opentelekomcloud/config/common" errors "github.com/pkg/errors" client "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -83,7 +83,7 @@ func (mg *InstanceV3) ResolveReferences(ctx context.Context, c client.Reader) er mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.PublicIps), - Extract: rds.ExtractEipAddress(), + Extract: common.ExtractEipAddress(), References: mg.Spec.ForProvider.PublicIpsRefs, Selector: mg.Spec.ForProvider.PublicIpsSelector, To: reference.To{ @@ -115,7 +115,7 @@ func (mg *InstanceV3) ResolveReferences(ctx context.Context, c client.Reader) er rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.SubnetID), - Extract: rds.ExtractNetworkID(), + Extract: common.ExtractNetworkID(), Reference: mg.Spec.ForProvider.SubnetIDRef, Selector: mg.Spec.ForProvider.SubnetIDSelector, To: reference.To{ @@ -163,7 +163,7 @@ func (mg *InstanceV3) ResolveReferences(ctx context.Context, c client.Reader) er mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.PublicIps), - Extract: rds.ExtractEipAddress(), + Extract: common.ExtractEipAddress(), References: mg.Spec.InitProvider.PublicIpsRefs, Selector: mg.Spec.InitProvider.PublicIpsSelector, To: reference.To{ @@ -195,7 +195,7 @@ func (mg *InstanceV3) ResolveReferences(ctx context.Context, c client.Reader) er rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.SubnetID), - Extract: rds.ExtractNetworkID(), + Extract: common.ExtractNetworkID(), Reference: mg.Spec.InitProvider.SubnetIDRef, Selector: mg.Spec.InitProvider.SubnetIDSelector, To: reference.To{ @@ -238,7 +238,7 @@ func (mg *ReadReplicaV3) ResolveReferences(ctx context.Context, c client.Reader) mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.PublicIps), - Extract: rds.ExtractEipAddress(), + Extract: common.ExtractEipAddress(), References: mg.Spec.ForProvider.PublicIpsRefs, Selector: mg.Spec.ForProvider.PublicIpsSelector, To: reference.To{ @@ -270,7 +270,7 @@ func (mg *ReadReplicaV3) ResolveReferences(ctx context.Context, c client.Reader) mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.PublicIps), - Extract: rds.ExtractEipAddress(), + Extract: common.ExtractEipAddress(), References: mg.Spec.InitProvider.PublicIpsRefs, Selector: mg.Spec.InitProvider.PublicIpsSelector, To: reference.To{ diff --git a/apis/rds/v1alpha1/zz_instancev3_types.go b/apis/rds/v1alpha1/zz_instancev3_types.go index 350edc8..5d546fb 100755 --- a/apis/rds/v1alpha1/zz_instancev3_types.go +++ b/apis/rds/v1alpha1/zz_instancev3_types.go @@ -221,7 +221,7 @@ type InstanceV3InitParameters struct { // Specifies floating IP to be assigned to the instance. // This should be a list with single element only. // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.EIPV1 - // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/rds.ExtractEipAddress() + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractEipAddress() // +crossplane:generate:reference:refFieldName=PublicIpsRefs // +crossplane:generate:reference:selectorFieldName=PublicIpsSelector PublicIps []*string `json:"publicIps,omitempty" tf:"public_ips,omitempty"` @@ -254,7 +254,7 @@ type InstanceV3InitParameters struct { // Specifies the subnet id. Changing this parameter will create a new resource. // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.SubnetV1 - // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/rds.ExtractNetworkID() + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractNetworkID() SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` // Reference to a SubnetV1 in vpc to populate subnetId. @@ -457,7 +457,7 @@ type InstanceV3Parameters struct { // Specifies floating IP to be assigned to the instance. // This should be a list with single element only. // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.EIPV1 - // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/rds.ExtractEipAddress() + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractEipAddress() // +crossplane:generate:reference:refFieldName=PublicIpsRefs // +crossplane:generate:reference:selectorFieldName=PublicIpsSelector // +kubebuilder:validation:Optional @@ -495,7 +495,7 @@ type InstanceV3Parameters struct { // Specifies the subnet id. Changing this parameter will create a new resource. // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.SubnetV1 - // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/rds.ExtractNetworkID() + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractNetworkID() // +kubebuilder:validation:Optional SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` diff --git a/apis/rds/v1alpha1/zz_readreplicav3_types.go b/apis/rds/v1alpha1/zz_readreplicav3_types.go index 6467b10..5686541 100755 --- a/apis/rds/v1alpha1/zz_readreplicav3_types.go +++ b/apis/rds/v1alpha1/zz_readreplicav3_types.go @@ -48,7 +48,7 @@ type ReadReplicaV3InitParameters struct { // Specifies floating IP to be assigned to the instance. // This should be a list with single element only. // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.EIPV1 - // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/rds.ExtractEipAddress() + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractEipAddress() // +crossplane:generate:reference:refFieldName=PublicIpsRefs // +crossplane:generate:reference:selectorFieldName=PublicIpsSelector // +listType=set @@ -146,7 +146,7 @@ type ReadReplicaV3Parameters struct { // Specifies floating IP to be assigned to the instance. // This should be a list with single element only. // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/vpc/v1alpha1.EIPV1 - // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/rds.ExtractEipAddress() + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractEipAddress() // +crossplane:generate:reference:refFieldName=PublicIpsRefs // +crossplane:generate:reference:selectorFieldName=PublicIpsSelector // +kubebuilder:validation:Optional diff --git a/config/cce/config.go b/config/cce/config.go index 48487d4..aa8779d 100644 --- a/config/cce/config.go +++ b/config/cce/config.go @@ -1,8 +1,115 @@ package cce -import "github.com/crossplane/upjet/pkg/config" +import ( + "github.com/crossplane/upjet/pkg/config" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/opentelekomcloud/provider-opentelekomcloud/config/common" +) // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { - // Nothing for now + p.AddResourceConfigurator("opentelekomcloud_cce_cluster_v3", func(r *config.Resource) { + r.UseAsync = true + r.References["vpc_id"] = config.Reference{ + TerraformName: "opentelekomcloud_vpc_v1", + } + r.References["subnet_id"] = config.Reference{ + TerraformName: "opentelekomcloud_vpc_subnet_v1", + Extractor: common.NetworkIDExtractor, + } + r.References["highway_subnet_id"] = config.Reference{ + TerraformName: "opentelekomcloud_vpc_subnet_v1", + Extractor: common.NetworkIDExtractor, + } + r.References["eni_subnet_id"] = config.Reference{ + TerraformName: "opentelekomcloud_vpc_subnet_v1", + Extractor: common.SubnetIDExtractor, + } + r.References["eni_subnet_cidr"] = config.Reference{ + TerraformName: "opentelekomcloud_vpc_subnet_v1", + Extractor: common.SubnetCIDRExtractor, + } + r.References["eip"] = config.Reference{ + TerraformName: "opentelekomcloud_vpc_eip_v1", + Extractor: common.EipAddressExtractor, + } + r.TerraformCustomDiff = func(diff *terraform.InstanceDiff, _ *terraform.InstanceState, _ *terraform.ResourceConfig) (*terraform.InstanceDiff, error) { + if ipsDiff, ok := diff.Attributes["eip"]; ok && ipsDiff.New == "" { + delete(diff.Attributes, "eip") + } + return diff, nil + } + }) + p.AddResourceConfigurator("opentelekomcloud_cce_node_v3", func(r *config.Resource) { + r.UseAsync = true + r.References["cluster_id"] = config.Reference{ + TerraformName: "opentelekomcloud_cce_cluster_v3", + } + r.References["eip_ids"] = config.Reference{ + TerraformName: "opentelekomcloud_vpc_eip_v1", + } + r.References["key_pair"] = config.Reference{ + TerraformName: "opentelekomcloud_compute_keypair_v2", + } + r.References["root_volume.kms_id"] = config.Reference{ + TerraformName: "opentelekomcloud_kms_key_v1", + } + r.References["data_volumes.kms_id"] = config.Reference{ + TerraformName: "opentelekomcloud_kms_key_v1", + } + r.References["agency_name"] = config.Reference{ + TerraformName: "opentelekomcloud_identity_agency_v3", + Extractor: common.AgencyNameExtractor, + } + r.LateInitializer = config.LateInitializer{ + IgnoredFields: []string{ + "iptype", + "bandwidth_charge_mode", + "bandwidth_size", + "sharetype", + "eip_count", + }, + } + r.TerraformCustomDiff = func(diff *terraform.InstanceDiff, _ *terraform.InstanceState, _ *terraform.ResourceConfig) (*terraform.InstanceDiff, error) { + if ipsDiff, ok := diff.Attributes["public_ip"]; ok && ipsDiff.New == "" { + delete(diff.Attributes, "public_ip") + } + return diff, nil + } + }) + p.AddResourceConfigurator("opentelekomcloud_cce_addon_v3", func(r *config.Resource) { + r.UseAsync = true + r.References["cluster_id"] = config.Reference{ + TerraformName: "opentelekomcloud_cce_cluster_v3", + } + r.References["custom.cluster_id"] = config.Reference{ + TerraformName: "opentelekomcloud_cce_cluster_v3", + } + r.References["custom.tenant_id"] = config.Reference{ + TerraformName: "opentelekomcloud_identity_project_v3", + } + }) + p.AddResourceConfigurator("opentelekomcloud_cce_node_pool_v3", func(r *config.Resource) { + r.UseAsync = true + r.References["cluster_id"] = config.Reference{ + TerraformName: "opentelekomcloud_cce_cluster_v3", + } + r.References["key_pair"] = config.Reference{ + TerraformName: "opentelekomcloud_compute_keypair_v2", + } + r.References["root_volume.kms_id"] = config.Reference{ + TerraformName: "opentelekomcloud_kms_key_v1", + } + r.References["data_volumes.kms_id"] = config.Reference{ + TerraformName: "opentelekomcloud_kms_key_v1", + } + r.References["agency_name"] = config.Reference{ + TerraformName: "opentelekomcloud_identity_agency_v3", + Extractor: common.AgencyNameExtractor, + } + r.References["subnet_id"] = config.Reference{ + TerraformName: "opentelekomcloud_vpc_subnet_v1", + Extractor: common.NetworkIDExtractor, + } + }) } diff --git a/config/common/common.go b/config/common/common.go new file mode 100644 index 0000000..8e46906 --- /dev/null +++ b/config/common/common.go @@ -0,0 +1,139 @@ +package common + +import ( + xpref "github.com/crossplane/crossplane-runtime/pkg/reference" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/upjet/pkg/resource" +) + +const ( + // SelfPackagePath is the golang path for this package. + SelfPackagePath = "github.com/opentelekomcloud/provider-opentelekomcloud/config/common" + + // NetworkIDExtractor is the golang path to ExtractNetworkID function + // in this package. + NetworkIDExtractor = SelfPackagePath + ".ExtractNetworkID()" + + // SubnetIDExtractor is the golang path to ExtractSubnetID function + // in this package. + SubnetIDExtractor = SelfPackagePath + ".ExtractSubnetID()" + + // EipAddressExtractor is the golang path to ExtractEipAddress function + // in this package. + EipAddressExtractor = SelfPackagePath + ".ExtractEipAddress()" + + // SubnetCIDRExtractor is the golang path to ExtractSubnetCIDR function + // in this package. + SubnetCIDRExtractor = SelfPackagePath + ".ExtractSubnetCIDR()" + + // AgencyNameExtractor is the golang path to ExtractAgencyName function + // in this package. + AgencyNameExtractor = SelfPackagePath + ".ExtractAgencyName()" +) + +// ExtractNetworkID extracts the value of `spec.forProvider.network_id` +// from an Observable resource. If mr is not an Observable +// resource, returns an empty string. +func ExtractNetworkID() xpref.ExtractValueFn { + return func(mr xpresource.Managed) string { + tr, ok := mr.(resource.Observable) + if !ok { + return "" + } + o, err := tr.GetObservation() + if err != nil { + return "" + } + + if k := o["network_id"]; k != nil { + return k.(string) + } + return "" + } +} + +// ExtractEipAddress extracts the value of `spec.forProvider.address` +// from a Terraformed resource. If mr is not a Terraformed +// resource, returns an empty string. +func ExtractEipAddress() xpref.ExtractValueFn { + return func(mr xpresource.Managed) string { + tr, ok := mr.(resource.Terraformed) + if !ok { + return "" + } + o, err := tr.GetParameters() + if err != nil { + return "" + } + publicIPList := o["publicip"].([]any) + if len(publicIPList) > 0 { + publicIP := publicIPList[0].(map[string]any) + if k := publicIP["ip_address"]; k != nil { + return k.(string) + } + } + + return "" + } +} + +// ExtractSubnetCIDR extracts the value of `spec.forProvider.cidr` +// from an Observable resource. If mr is not an Observable +// resource, returns an empty string. +func ExtractSubnetCIDR() xpref.ExtractValueFn { + return func(mr xpresource.Managed) string { + tr, ok := mr.(resource.Observable) + if !ok { + return "" + } + o, err := tr.GetObservation() + if err != nil { + return "" + } + if k := o["cidr"]; k != nil { + return k.(string) + } + return "" + } +} + +// ExtractSubnetID extracts the value of `spec.forProvider.subnet_id` +// from an Observable resource. If mr is not an Observable +// resource, returns an empty string. +func ExtractSubnetID() xpref.ExtractValueFn { + return func(mr xpresource.Managed) string { + tr, ok := mr.(resource.Observable) + if !ok { + return "" + } + o, err := tr.GetObservation() + if err != nil { + return "" + } + if k := o["subnet_id"]; k != nil { + return k.(string) + } + return "" + } +} + +// ExtractAgencyName extracts the value of `spec.forProvider.name` +// from a Terraformed resource. If mr is not a Terraformed +// resource, returns an empty string. +func ExtractAgencyName() xpref.ExtractValueFn { + return func(mr xpresource.Managed) string { + tr, ok := mr.(resource.Terraformed) + if !ok { + return "" + } + o, err := tr.GetParameters() + if err != nil { + return "" + } + if k := o["name"]; k != nil { + return k.(string) + } + + return "" + } +} diff --git a/config/compute/config.go b/config/compute/config.go index c5571d9..c1a03ce 100644 --- a/config/compute/config.go +++ b/config/compute/config.go @@ -1,10 +1,8 @@ package compute import ( - xpref "github.com/crossplane/crossplane-runtime/pkg/reference" - xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/upjet/pkg/config" - "github.com/crossplane/upjet/pkg/resource" + "github.com/opentelekomcloud/provider-opentelekomcloud/config/common" ) // Configure configures individual resources by adding custom ResourceConfigurators. @@ -12,10 +10,10 @@ func Configure(p *config.Provider) { p.AddResourceConfigurator("opentelekomcloud_compute_instance_v2", func(r *config.Resource) { r.UseAsync = true r.References["key_pair"] = config.Reference{ - Type: "KeypairV2", + TerraformName: "opentelekomcloud_compute_keypair_v2", } r.References["security_groups"] = config.Reference{ - Type: "SecgroupV2", + TerraformName: "opentelekomcloud_compute_secgroup_v2", } }) p.AddResourceConfigurator("opentelekomcloud_compute_keypair_v2", func(r *config.Resource) { @@ -36,36 +34,7 @@ func Configure(p *config.Provider) { } r.References["nics.network_id"] = config.Reference{ TerraformName: "opentelekomcloud_vpc_subnet_v1", - Extractor: ExtractNetworkIDFunc, + Extractor: common.NetworkIDExtractor, } }) } - -const ( - // APISPackagePath is the package path for generated APIs root package - APISPackagePath = "github.com/opentelekomcloud/provider-opentelekomcloud/config/compute" - - // ExtractNetworkIDFunc extracts network_id from subnet resource - ExtractNetworkIDFunc = APISPackagePath + ".ExtractNetworkID()" -) - -// ExtractNetworkID extracts the value of `spec.forProvider.network_id` -// from an Observable resource. If mr is not a Observable -// resource, returns an empty string. -func ExtractNetworkID() xpref.ExtractValueFn { - return func(mr xpresource.Managed) string { - tr, ok := mr.(resource.Observable) - if !ok { - return "" - } - o, err := tr.GetObservation() - if err != nil { - return "" - } - - if k := o["network_id"]; k != nil { - return k.(string) - } - return "" - } -} diff --git a/config/external_name.go b/config/external_name.go index 2564ea7..56a3cb4 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -92,6 +92,7 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "opentelekomcloud_images_image_v2": config.IdentifierFromProvider, "opentelekomcloud_ims_data_image_v2": config.IdentifierFromProvider, "opentelekomcloud_ims_image_v2": config.IdentifierFromProvider, + "opentelekomcloud_kms_key_v1": config.IdentifierFromProvider, "opentelekomcloud_kms_grant_v1": config.IdentifierFromProvider, // LB diff --git a/config/rds/config.go b/config/rds/config.go index 1503c9b..2b271b4 100644 --- a/config/rds/config.go +++ b/config/rds/config.go @@ -1,11 +1,9 @@ package rds import ( - xpref "github.com/crossplane/crossplane-runtime/pkg/reference" - xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/upjet/pkg/config" - "github.com/crossplane/upjet/pkg/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/opentelekomcloud/provider-opentelekomcloud/config/common" ) // Configure configures individual resources by adding custom ResourceConfigurators. @@ -22,11 +20,11 @@ func Configure(p *config.Provider) { } r.References["subnet_id"] = config.Reference{ TerraformName: "opentelekomcloud_vpc_subnet_v1", - Extractor: ExtractNetworkIDFunc, + Extractor: common.NetworkIDExtractor, } r.References["public_ips"] = config.Reference{ TerraformName: "opentelekomcloud_vpc_eip_v1", - Extractor: ExtractEipAddressFunc, + Extractor: common.EipAddressExtractor, RefFieldName: "PublicIpsRefs", SelectorFieldName: "PublicIpsSelector", } @@ -53,65 +51,9 @@ func Configure(p *config.Provider) { } r.References["public_ips"] = config.Reference{ TerraformName: "opentelekomcloud_vpc_eip_v1", - Extractor: ExtractEipAddressFunc, + Extractor: common.EipAddressExtractor, RefFieldName: "PublicIpsRefs", SelectorFieldName: "PublicIpsSelector", } }) } - -const ( - // APISPackagePath is the package path for generated APIs root package - APISPackagePath = "github.com/opentelekomcloud/provider-opentelekomcloud/config/rds" - - // ExtractNetworkIDFunc extracts network_id from subnet resource - ExtractNetworkIDFunc = APISPackagePath + ".ExtractNetworkID()" - // ExtractEipAddressFunc extracts ip_address from eip resource - ExtractEipAddressFunc = APISPackagePath + ".ExtractEipAddress()" -) - -// ExtractNetworkID extracts the value of `spec.forProvider.network_id` -// from an Observable resource. If mr is not a Observable -// resource, returns an empty string. -func ExtractNetworkID() xpref.ExtractValueFn { - return func(mr xpresource.Managed) string { - tr, ok := mr.(resource.Observable) - if !ok { - return "" - } - o, err := tr.GetObservation() - if err != nil { - return "" - } - - if k := o["network_id"]; k != nil { - return k.(string) - } - return "" - } -} - -// ExtractEipAddress extracts the value of `spec.forProvider.address` -// from an Terraformed resource. If mr is not a Observable -// resource, returns an empty string. -func ExtractEipAddress() xpref.ExtractValueFn { - return func(mr xpresource.Managed) string { - tr, ok := mr.(resource.Terraformed) - if !ok { - return "" - } - o, err := tr.GetParameters() - if err != nil { - return "" - } - publicIPList := o["publicip"].([]any) - if len(publicIPList) > 0 { - publicIP := publicIPList[0].(map[string]any) - if k := publicIP["ip_address"]; k != nil { - return k.(string) - } - } - - return "" - } -} diff --git a/examples-generated/cce/v1alpha1/addonv3.yaml b/examples-generated/cce/v1alpha1/addonv3.yaml index f8f24c8..1aeae13 100644 --- a/examples-generated/cce/v1alpha1/addonv3.yaml +++ b/examples-generated/cce/v1alpha1/addonv3.yaml @@ -8,7 +8,9 @@ metadata: name: addon spec: forProvider: - clusterId: ${opentelekomcloud_cce_cluster_v3.cluster_1.id} + clusterIdSelector: + matchLabels: + testing.upbound.io/example-name: cluster_1 templateName: metrics-server templateVersion: 1.3.6 values: @@ -36,5 +38,9 @@ spec: flavorId: ${var.flavor_id} kubernetesSvcIpRange: 10.247.0.0/16 name: cce-cluster-1 - subnetId: ${var.subnet_id} - vpcId: ${var.vpc_id} + subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: example + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: example diff --git a/examples-generated/cce/v1alpha1/clusterv3.yaml b/examples-generated/cce/v1alpha1/clusterv3.yaml index c912681..7449f88 100644 --- a/examples-generated/cce/v1alpha1/clusterv3.yaml +++ b/examples-generated/cce/v1alpha1/clusterv3.yaml @@ -15,5 +15,9 @@ spec: flavorId: ${var.flavor_id} kubeProxyMode: ipvs name: cluster - subnetId: ${var.subnet_id} - vpcId: ${var.vpc_id} + subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: example + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: example diff --git a/examples-generated/cce/v1alpha1/nodepoolv3.yaml b/examples-generated/cce/v1alpha1/nodepoolv3.yaml index a051257..43729df 100644 --- a/examples-generated/cce/v1alpha1/nodepoolv3.yaml +++ b/examples-generated/cce/v1alpha1/nodepoolv3.yaml @@ -8,9 +8,13 @@ metadata: name: node-pool-1 spec: forProvider: - agencyName: test-agency + agencyNameSelector: + matchLabels: + testing.upbound.io/example-name: example availabilityZone: ${var.availability_zone} - clusterId: ${var.cluster_id} + clusterIdSelector: + matchLabels: + testing.upbound.io/example-name: example dataVolumes: - size: 100 volumetype: SSD @@ -20,7 +24,9 @@ spec: volumetype: SSD flavor: s2.xlarge.2 initialNodeCount: 2 - keyPair: ${var.ssh_key} + keyPairSelector: + matchLabels: + testing.upbound.io/example-name: example maxNodeCount: 9 minNodeCount: 2 name: opentelekomcloud-cce-node-pool-test diff --git a/examples-generated/cce/v1alpha1/nodev3.yaml b/examples-generated/cce/v1alpha1/nodev3.yaml index edfff34..23c3c02 100644 --- a/examples-generated/cce/v1alpha1/nodev3.yaml +++ b/examples-generated/cce/v1alpha1/nodev3.yaml @@ -8,10 +8,14 @@ metadata: name: node-1 spec: forProvider: - agencyName: test-agency + agencyNameSelector: + matchLabels: + testing.upbound.io/example-name: example availabilityZone: ${var.availability_zone} bandwidthSize: 100 - clusterId: ${var.cluster_id} + clusterIdSelector: + matchLabels: + testing.upbound.io/example-name: example dataVolumes: - size: 100 volumetype: SATA @@ -20,7 +24,9 @@ spec: size: 100 volumetype: SSD flavorId: s2.large.2 - keyPair: ${var.ssh_key} + keyPairSelector: + matchLabels: + testing.upbound.io/example-name: example name: node1 os: EulerOS 2.9 rootVolume: diff --git a/examples-generated/kms/v1alpha1/keyv1.yaml b/examples-generated/kms/v1alpha1/keyv1.yaml new file mode 100644 index 0000000..ad99964 --- /dev/null +++ b/examples-generated/kms/v1alpha1/keyv1.yaml @@ -0,0 +1,17 @@ +apiVersion: kms.opentelekomcloud.crossplane.io/v1alpha1 +kind: KeyV1 +metadata: + annotations: + meta.upbound.io/example-id: kms/v1alpha1/keyv1 + labels: + testing.upbound.io/example-name: key_1 + name: key-1 +spec: + forProvider: + isEnabled: true + keyAlias: key_1 + keyDescription: first test key + pendingDays: "7" + realm: eu-de-01 + tags: + muh: kuh diff --git a/examples/cce/cluster.yaml b/examples/cce/cluster.yaml new file mode 100644 index 0000000..0407a12 --- /dev/null +++ b/examples/cce/cluster.yaml @@ -0,0 +1,218 @@ +apiVersion: compute.opentelekomcloud.crossplane.io/v1alpha1 +kind: KeypairV2 +metadata: + annotations: + meta.upbound.io/example-id: compute/v1alpha1/keypairv2 + labels: + testing.upbound.io/example-name: sample-instance + name: sample-instance +spec: + forProvider: + name: crossplane-keypair + publicKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDTUED6lEQhwmmpqypHQLqGu8xoUzvT8/uHb9c/uSTNq/qk5GN7gOeK8bs9DvPf4BIYBj5CPzhaidVDue+poqfL9su0mZ1K+eldWoGwkmjOB22kiA9vYmKDEG5u+S3S2UxsM+k09Qh8WGGMuvmCRF7KyNf8rlSJns3bsyG0vDjKuo3hdoCQi5RW950VtaAaefRXfQqgk1y8SR2xZKM0e24yICHd1C40tb5RgiNx7s45VHfVY6XMO+eESeHyDEJMr1AoJhkuiziE1feYmLIC2C02wpRXdLxqu2DbrJfqaPWe0J5mZKTXAFzpr/kdReDDp0lgJhjcralcLSZVa1JhQ1iX4n7+v0YKa6WHInnjmeN4PLz8gBanE40OpkZI/DVIWbhX/CrYi+tpZKzYc9ZGdd9UDGPNUNwIMMvat73zp/arAhh9n2nl68/iqM/Xhs8BQ8PYYSuMkhEAZksmSN3Qr6PuE3OpmoHRt+nWwtap751O3JwI8Kmt2iH+I4EOD5cx2CPNjFEOnLLSRqcnQ6CszDfDxDfEAT3wNT/4spM7xqDcvUD523b91fJb1N5NjgmxAmksOxJlrJzTUbVLwLh+RcPd/Lz8kB/NX/peZhcUFLdRbdAUIIgKuEOPBTbFm39Hgj5YVSnSQIkXp6hwO7FSh88ps+8fTPgW01IKr8MG4GhiWQ== + +--- + +apiVersion: vpc.opentelekomcloud.crossplane.io/v1alpha1 +kind: VpcV1 +metadata: + annotations: + meta.upbound.io/example-id: vpc/v1alpha1/v1 + labels: + testing.upbound.io/example-name: sample-instance + name: sample-instance +spec: + forProvider: + cidr: "192.168.0.0/16" + name: crossplane-vpc + tags: + managed-by: crossplane +--- + +apiVersion: vpc.opentelekomcloud.crossplane.io/v1alpha1 +kind: SubnetV1 +metadata: + annotations: + meta.upbound.io/example-id: vpc/v1alpha1/subnetv1 + labels: + testing.upbound.io/example-name: sample-instance + name: sample-instance +spec: + forProvider: + cidr: "192.168.0.0/16" + gatewayIp: "192.168.0.1" + name: crossplane-subnet + ntpAddresses: "10.100.0.33,10.100.0.34" + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: sample-instance + tags: + managed-by: crossplane + +--- + +apiVersion: cce.opentelekomcloud.crossplane.io/v1alpha1 +kind: ClusterV3 +metadata: + annotations: + meta.upbound.io/example-id: cce/v1alpha1/clusterv3 + labels: + testing.upbound.io/example-name: sample-crossplane-cluster + name: sample-crossplane-cluster +spec: + forProvider: + authenticationMode: rbac + clusterType: VirtualMachine + description: crossplane + flavorId: cce.s1.small + containerNetworkType: eni + name: crossplane-cluster + subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: sample-instance + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: sample-instance + eniSubnetIdSelector: + matchLabels: + testing.upbound.io/example-name: sample-instance + eniSubnetCidrSelector: + matchLabels: + testing.upbound.io/example-name: sample-instance + +--- + +apiVersion: cce.opentelekomcloud.crossplane.io/v1alpha1 +kind: NodeV3 +metadata: + annotations: + meta.upbound.io/example-id: cce/v1alpha1/nodev3 + labels: + testing.upbound.io/example-name: sample-instance + name: sample-instance +spec: + forProvider: + availabilityZone: eu-de-01 + bandwidthSize: 100 + clusterIdSelector: + matchLabels: + testing.upbound.io/example-name: sample-crossplane-cluster + dataVolumes: + - size: 100 + volumetype: SATA + - extendParams: + useType: docker + size: 100 + volumetype: SSD + flavorId: s2.large.2 + keyPairSelector: + matchLabels: + testing.upbound.io/example-name: sample-instance + name: crossplane-node-01 + os: EulerOS 2.9 + rootVolume: + - size: 40 + volumetype: SATA + runtime: containerd + +--- + +apiVersion: cce.opentelekomcloud.crossplane.io/v1alpha1 +kind: AddonV3 +metadata: + annotations: + meta.upbound.io/example-id: cce/v1alpha1/addonv3 + labels: + testing.upbound.io/example-name: sample-addon + name: sample-addon +spec: + forProvider: + clusterIdSelector: + matchLabels: + testing.upbound.io/example-name: sample-crossplane-cluster + templateName: autoscaler + templateVersion: 1.28.22 + values: + - basic: + cceEndpoint : https://cce.eu-de.otc.t-systems.com + ecsEndpoint : https://ecs.eu-de.otc.t-systems.com + image_version : 1.28.22 + region : eu-de + swr_addr : 100.125.7.25:20202 + swr_user : cce-addons + custom: + cluster_id : 52bd7ba4-53e1-11ef-ade8-02550a10003a + coresTotal : "32000" + expander : priority + logLevel : "4" + maxEmptyBulkDeleteFlag : "10" + maxNodeProvisionTime : "15" + maxNodesTotal : "1000" + memoryTotal : "128000" + scaleDownDelayAfterAdd : "10" + scaleDownDelayAfterDelete : "11" + scaleDownDelayAfterFailure : "3" + scaleDownEnabled : "true" + scaleDownUnneededTime : "10" + scaleDownUtilizationThreshold : "0.5" + scaleUpCpuUtilizationThreshold : "1" + scaleUpMemUtilizationThreshold : "1" + scaleUpUnscheduledPodEnabled : "true" + scaleUpUtilizationEnabled : "true" + tenant_id : 5dd3c0b24cdc4d31952c49589182a89d + unremovableNodeRecheckTimeout : "5" + flavor: | + { + "description": "Has only one instance", + "name": "Single", + "replicas": 1, + "resources": [ + { + "limitsCpu": "1000m", + "limitsMem": "1000Mi", + "name": "autoscaler", + "requestsCpu": "500m", + "requestsMem": "500Mi" + } + ] + } + +--- + +apiVersion: cce.opentelekomcloud.crossplane.io/v1alpha1 +kind: NodePoolV3 +metadata: + annotations: + meta.upbound.io/example-id: cce/v1alpha1/nodepoolv3 + labels: + testing.upbound.io/example-name: sample-node-pool + name: sample-node-pool +spec: + forProvider: + availabilityZone: eu-de-01 + clusterIdSelector: + matchLabels: + testing.upbound.io/example-name: sample-crossplane-cluster + dataVolumes: + - size: 100 + volumetype: SSD + - extendParams: + useType: docker + size: 100 + volumetype: SSD + flavor: s2.xlarge.2 + initialNodeCount: 1 + keyPairSelector: + matchLabels: + testing.upbound.io/example-name: sample-instance + maxNodeCount: 9 + minNodeCount: 1 + name: sample-crossplane-node-pool + os: EulerOS 2.9 + priority: 1 + rootVolume: + - size: 40 + volumetype: SSD + runtime: containerd + scaleDownCooldownTime: 100 + scaleEnable: true diff --git a/internal/controller/kms/keyv1/zz_controller.go b/internal/controller/kms/keyv1/zz_controller.go new file mode 100755 index 0000000..acf04bc --- /dev/null +++ b/internal/controller/kms/keyv1/zz_controller.go @@ -0,0 +1,87 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package keyv1 + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/opentelekomcloud/provider-opentelekomcloud/apis/kms/v1alpha1" + features "github.com/opentelekomcloud/provider-opentelekomcloud/internal/features" +) + +// Setup adds a controller that reconciles KeyV1 managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.KeyV1_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.KeyV1_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.KeyV1_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["opentelekomcloud_kms_key_v1"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), + tjcontroller.WithCallbackProvider(ac), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.KeyV1 + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.KeyV1{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.KeyV1") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.KeyV1List{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.KeyV1List") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.KeyV1_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.KeyV1{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index 677e99a..2986a7a 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -68,6 +68,7 @@ import ( dataimagev2 "github.com/opentelekomcloud/provider-opentelekomcloud/internal/controller/ims/dataimagev2" imagev2ims "github.com/opentelekomcloud/provider-opentelekomcloud/internal/controller/ims/imagev2" grantv1 "github.com/opentelekomcloud/provider-opentelekomcloud/internal/controller/kms/grantv1" + keyv1 "github.com/opentelekomcloud/provider-opentelekomcloud/internal/controller/kms/keyv1" certificatev2 "github.com/opentelekomcloud/provider-opentelekomcloud/internal/controller/lb/certificatev2" certificatev3 "github.com/opentelekomcloud/provider-opentelekomcloud/internal/controller/lb/certificatev3" ipgroupv3 "github.com/opentelekomcloud/provider-opentelekomcloud/internal/controller/lb/ipgroupv3" @@ -219,6 +220,7 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { dataimagev2.Setup, imagev2ims.Setup, grantv1.Setup, + keyv1.Setup, certificatev2.Setup, certificatev3.Setup, ipgroupv3.Setup, diff --git a/package/crds/cce.opentelekomcloud.crossplane.io_addonv3s.yaml b/package/crds/cce.opentelekomcloud.crossplane.io_addonv3s.yaml index ccdabca..360ae1f 100644 --- a/package/crds/cce.opentelekomcloud.crossplane.io_addonv3s.yaml +++ b/package/crds/cce.opentelekomcloud.crossplane.io_addonv3s.yaml @@ -76,6 +76,80 @@ spec: clusterId: description: ID of cluster to install the add-on on. type: string + clusterIdRef: + description: Reference to a ClusterV3 in cce to populate clusterId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + clusterIdSelector: + description: Selector for a ClusterV3 in cce to populate clusterId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object templateName: description: Name of the add-on template to be installed, for example, coredns. @@ -123,6 +197,80 @@ spec: clusterId: description: ID of cluster to install the add-on on. type: string + clusterIdRef: + description: Reference to a ClusterV3 in cce to populate clusterId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + clusterIdSelector: + description: Selector for a ClusterV3 in cce to populate clusterId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object templateName: description: Name of the add-on template to be installed, for example, coredns. @@ -322,10 +470,6 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: spec.forProvider.clusterId is a required parameter - rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies - || ''Update'' in self.managementPolicies) || has(self.forProvider.clusterId) - || (has(self.initProvider) && has(self.initProvider.clusterId))' - message: spec.forProvider.templateName is a required parameter rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.templateName) diff --git a/package/crds/cce.opentelekomcloud.crossplane.io_clusterv3s.yaml b/package/crds/cce.opentelekomcloud.crossplane.io_clusterv3s.yaml index a7da926..38dbd38 100644 --- a/package/crds/cce.opentelekomcloud.crossplane.io_clusterv3s.yaml +++ b/package/crds/cce.opentelekomcloud.crossplane.io_clusterv3s.yaml @@ -179,6 +179,80 @@ spec: eip: description: EIP address of the cluster. type: string + eipRef: + description: Reference to a EIPV1 in vpc to populate eip. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + eipSelector: + description: Selector for a EIPV1 in vpc to populate eip. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object enableVolumeEncryption: description: System and data disks encryption of master nodes. Changing this parameter will create a new cluster resource. @@ -188,11 +262,159 @@ spec: creating a CCE Turbo cluster. Changing this parameter will create a new cluster resource. type: string + eniSubnetCidrRef: + description: Reference to a SubnetV1 in vpc to populate eniSubnetCidr. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + eniSubnetCidrSelector: + description: Selector for a SubnetV1 in vpc to populate eniSubnetCidr. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object eniSubnetId: description: '- Specifies the ENI subnet ID. Specified when creating a CCE Turbo cluster. Changing this parameter will create a new cluster resource.' type: string + eniSubnetIdRef: + description: Reference to a SubnetV1 in vpc to populate eniSubnetId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + eniSubnetIdSelector: + description: Selector for a SubnetV1 in vpc to populate eniSubnetId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object extendParam: additionalProperties: type: string @@ -210,6 +432,80 @@ spec: metal nodes. Changing this parameter will create a new cluster resource. type: string + highwaySubnetIdRef: + description: Reference to a SubnetV1 in vpc to populate highwaySubnetId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + highwaySubnetIdSelector: + description: Selector for a SubnetV1 in vpc to populate highwaySubnetId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object ignoreAddons: description: Skip all cluster addons operations. type: boolean @@ -253,10 +549,158 @@ spec: description: The Network ID of the subnet used to create the node. Changing this parameter will create a new cluster resource. type: string + subnetIdRef: + description: Reference to a SubnetV1 in vpc to populate subnetId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + subnetIdSelector: + description: Selector for a SubnetV1 in vpc to populate subnetId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object vpcId: description: The ID of the VPC used to create the node. Changing this parameter will create a new cluster resource. type: string + vpcIdRef: + description: Reference to a VpcV1 in vpc to populate vpcId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + vpcIdSelector: + description: Selector for a VpcV1 in vpc to populate vpcId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object initProvider: description: |- @@ -377,6 +821,80 @@ spec: eip: description: EIP address of the cluster. type: string + eipRef: + description: Reference to a EIPV1 in vpc to populate eip. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + eipSelector: + description: Selector for a EIPV1 in vpc to populate eip. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object enableVolumeEncryption: description: System and data disks encryption of master nodes. Changing this parameter will create a new cluster resource. @@ -386,11 +904,159 @@ spec: creating a CCE Turbo cluster. Changing this parameter will create a new cluster resource. type: string + eniSubnetCidrRef: + description: Reference to a SubnetV1 in vpc to populate eniSubnetCidr. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + eniSubnetCidrSelector: + description: Selector for a SubnetV1 in vpc to populate eniSubnetCidr. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object eniSubnetId: description: '- Specifies the ENI subnet ID. Specified when creating a CCE Turbo cluster. Changing this parameter will create a new cluster resource.' type: string + eniSubnetIdRef: + description: Reference to a SubnetV1 in vpc to populate eniSubnetId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + eniSubnetIdSelector: + description: Selector for a SubnetV1 in vpc to populate eniSubnetId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object extendParam: additionalProperties: type: string @@ -408,6 +1074,80 @@ spec: metal nodes. Changing this parameter will create a new cluster resource. type: string + highwaySubnetIdRef: + description: Reference to a SubnetV1 in vpc to populate highwaySubnetId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + highwaySubnetIdSelector: + description: Selector for a SubnetV1 in vpc to populate highwaySubnetId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object ignoreAddons: description: Skip all cluster addons operations. type: boolean @@ -451,10 +1191,158 @@ spec: description: The Network ID of the subnet used to create the node. Changing this parameter will create a new cluster resource. type: string + subnetIdRef: + description: Reference to a SubnetV1 in vpc to populate subnetId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + subnetIdSelector: + description: Selector for a SubnetV1 in vpc to populate subnetId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object vpcId: description: The ID of the VPC used to create the node. Changing this parameter will create a new cluster resource. type: string + vpcIdRef: + description: Reference to a VpcV1 in vpc to populate vpcId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + vpcIdSelector: + description: Selector for a VpcV1 in vpc to populate vpcId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object managementPolicies: default: @@ -640,14 +1528,6 @@ spec: rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.name) || (has(self.initProvider) && has(self.initProvider.name))' - - message: spec.forProvider.subnetId is a required parameter - rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies - || ''Update'' in self.managementPolicies) || has(self.forProvider.subnetId) - || (has(self.initProvider) && has(self.initProvider.subnetId))' - - message: spec.forProvider.vpcId is a required parameter - rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies - || ''Update'' in self.managementPolicies) || has(self.forProvider.vpcId) - || (has(self.initProvider) && has(self.initProvider.vpcId))' status: description: ClusterV3Status defines the observed state of ClusterV3. properties: diff --git a/package/crds/cce.opentelekomcloud.crossplane.io_nodepoolv3s.yaml b/package/crds/cce.opentelekomcloud.crossplane.io_nodepoolv3s.yaml index 936d8e1..86e4546 100644 --- a/package/crds/cce.opentelekomcloud.crossplane.io_nodepoolv3s.yaml +++ b/package/crds/cce.opentelekomcloud.crossplane.io_nodepoolv3s.yaml @@ -77,6 +77,80 @@ spec: description: IAM agency name. Changing this parameter will create a new resource. type: string + agencyNameRef: + description: Reference to a AgencyV3 in identity to populate agencyName. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + agencyNameSelector: + description: Selector for a AgencyV3 in identity to populate agencyName. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object availabilityZone: description: |- Specify the name of the available partition (AZ). If zone is not @@ -87,6 +161,80 @@ spec: description: ID of the cluster. Changing this parameter will create a new resource. type: string + clusterIdRef: + description: Reference to a ClusterV3 in cce to populate clusterId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + clusterIdSelector: + description: Selector for a ClusterV3 in cce to populate clusterId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object dataVolumes: description: Represents the data disk to be created. Changing this parameter will create a new resource. @@ -108,6 +256,80 @@ spec: description: The Encryption KMS ID of the system volume. By default, it tries to get from env by OS_KMS_ID. type: string + kmsIdRef: + description: Reference to a KeyV1 in kms to populate kmsId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + kmsIdSelector: + description: Selector for a KeyV1 in kms to populate kmsId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object size: description: Disk size in GB. type: number @@ -144,6 +366,80 @@ spec: Key pair name when logging in to select the key pair mode. This parameter and password are alternative. Changing this parameter will create a new resource. type: string + keyPairRef: + description: Reference to a KeypairV2 in compute to populate keyPair. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + keyPairSelector: + description: Selector for a KeypairV2 in compute to populate keyPair. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object maxNodeCount: description: Maximum number of nodes allowed if auto scaling is enabled. @@ -219,6 +515,80 @@ spec: description: The Encryption KMS ID of the system volume. By default, it tries to get from env by OS_KMS_ID. type: string + kmsIdRef: + description: Reference to a KeyV1 in kms to populate kmsId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + kmsIdSelector: + description: Selector for a KeyV1 in kms to populate kmsId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object size: description: Disk size in GB. type: number @@ -256,6 +626,80 @@ spec: description: The ID of the subnet to which the NIC belongs. Changing this parameter will create a new resource. type: string + subnetIdRef: + description: Reference to a SubnetV1 in vpc to populate subnetId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + subnetIdSelector: + description: Selector for a SubnetV1 in vpc to populate subnetId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object taints: description: Taints to created nodes to configure anti-affinity. items: @@ -302,6 +746,80 @@ spec: description: IAM agency name. Changing this parameter will create a new resource. type: string + agencyNameRef: + description: Reference to a AgencyV3 in identity to populate agencyName. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + agencyNameSelector: + description: Selector for a AgencyV3 in identity to populate agencyName. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object availabilityZone: description: |- Specify the name of the available partition (AZ). If zone is not @@ -312,6 +830,80 @@ spec: description: ID of the cluster. Changing this parameter will create a new resource. type: string + clusterIdRef: + description: Reference to a ClusterV3 in cce to populate clusterId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + clusterIdSelector: + description: Selector for a ClusterV3 in cce to populate clusterId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object dataVolumes: description: Represents the data disk to be created. Changing this parameter will create a new resource. @@ -333,6 +925,80 @@ spec: description: The Encryption KMS ID of the system volume. By default, it tries to get from env by OS_KMS_ID. type: string + kmsIdRef: + description: Reference to a KeyV1 in kms to populate kmsId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + kmsIdSelector: + description: Selector for a KeyV1 in kms to populate kmsId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object size: description: Disk size in GB. type: number @@ -369,6 +1035,80 @@ spec: Key pair name when logging in to select the key pair mode. This parameter and password are alternative. Changing this parameter will create a new resource. type: string + keyPairRef: + description: Reference to a KeypairV2 in compute to populate keyPair. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + keyPairSelector: + description: Selector for a KeypairV2 in compute to populate keyPair. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object maxNodeCount: description: Maximum number of nodes allowed if auto scaling is enabled. @@ -444,6 +1184,80 @@ spec: description: The Encryption KMS ID of the system volume. By default, it tries to get from env by OS_KMS_ID. type: string + kmsIdRef: + description: Reference to a KeyV1 in kms to populate kmsId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + kmsIdSelector: + description: Selector for a KeyV1 in kms to populate kmsId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object size: description: Disk size in GB. type: number @@ -481,6 +1295,80 @@ spec: description: The ID of the subnet to which the NIC belongs. Changing this parameter will create a new resource. type: string + subnetIdRef: + description: Reference to a SubnetV1 in vpc to populate subnetId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + subnetIdSelector: + description: Selector for a SubnetV1 in vpc to populate subnetId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object taints: description: Taints to created nodes to configure anti-affinity. items: @@ -678,10 +1566,6 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: spec.forProvider.clusterId is a required parameter - rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies - || ''Update'' in self.managementPolicies) || has(self.forProvider.clusterId) - || (has(self.initProvider) && has(self.initProvider.clusterId))' - message: spec.forProvider.dataVolumes is a required parameter rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.dataVolumes) diff --git a/package/crds/cce.opentelekomcloud.crossplane.io_nodev3s.yaml b/package/crds/cce.opentelekomcloud.crossplane.io_nodev3s.yaml index 929e183..6bc0f23 100644 --- a/package/crds/cce.opentelekomcloud.crossplane.io_nodev3s.yaml +++ b/package/crds/cce.opentelekomcloud.crossplane.io_nodev3s.yaml @@ -77,6 +77,80 @@ spec: description: IAM agency name. Changing this parameter will create a new resource. type: string + agencyNameRef: + description: Reference to a AgencyV3 in identity to populate agencyName. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + agencyNameSelector: + description: Selector for a AgencyV3 in identity to populate agencyName. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object annotations: additionalProperties: type: string @@ -102,6 +176,80 @@ spec: description: ID of the cluster. Changing this parameter will create a new resource. type: string + clusterIdRef: + description: Reference to a ClusterV3 in cce to populate clusterId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + clusterIdSelector: + description: Selector for a ClusterV3 in cce to populate clusterId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object dataVolumes: description: Represents the data disk to be created. Changing this parameter will create a new resource. @@ -123,6 +271,80 @@ spec: description: The Encryption KMS ID of the system volume. By default, it tries to get from env by OS_KMS_ID. type: string + kmsIdRef: + description: Reference to a KeyV1 in kms to populate kmsId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + kmsIdSelector: + description: Selector for a KeyV1 in kms to populate kmsId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object size: description: Disk size in GB. type: number @@ -154,6 +376,83 @@ spec: type: string type: array x-kubernetes-list-type: set + eipIdsRefs: + description: References to EIPV1 in vpc to populate eipIds. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + eipIdsSelector: + description: Selector for a list of EIPV1 in vpc to populate eipIds. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object extendParamChargingMode: description: Node charging mode, 0 is on-demand charging. Changing this parameter will create a new cluster resource. @@ -175,6 +474,80 @@ spec: description: Key pair name when logging in to select the key pair mode. Changing this parameter will create a new resource. type: string + keyPairRef: + description: Reference to a KeypairV2 in compute to populate keyPair. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + keyPairSelector: + description: Selector for a KeypairV2 in compute to populate keyPair. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object labels: additionalProperties: type: string @@ -243,6 +616,80 @@ spec: description: The Encryption KMS ID of the system volume. By default, it tries to get from env by OS_KMS_ID. type: string + kmsIdRef: + description: Reference to a KeyV1 in kms to populate kmsId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + kmsIdSelector: + description: Selector for a KeyV1 in kms to populate kmsId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object size: description: Disk size in GB. type: number @@ -311,6 +758,80 @@ spec: description: IAM agency name. Changing this parameter will create a new resource. type: string + agencyNameRef: + description: Reference to a AgencyV3 in identity to populate agencyName. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + agencyNameSelector: + description: Selector for a AgencyV3 in identity to populate agencyName. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object annotations: additionalProperties: type: string @@ -336,6 +857,80 @@ spec: description: ID of the cluster. Changing this parameter will create a new resource. type: string + clusterIdRef: + description: Reference to a ClusterV3 in cce to populate clusterId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + clusterIdSelector: + description: Selector for a ClusterV3 in cce to populate clusterId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object dataVolumes: description: Represents the data disk to be created. Changing this parameter will create a new resource. @@ -357,6 +952,80 @@ spec: description: The Encryption KMS ID of the system volume. By default, it tries to get from env by OS_KMS_ID. type: string + kmsIdRef: + description: Reference to a KeyV1 in kms to populate kmsId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + kmsIdSelector: + description: Selector for a KeyV1 in kms to populate kmsId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object size: description: Disk size in GB. type: number @@ -388,6 +1057,83 @@ spec: type: string type: array x-kubernetes-list-type: set + eipIdsRefs: + description: References to EIPV1 in vpc to populate eipIds. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + eipIdsSelector: + description: Selector for a list of EIPV1 in vpc to populate eipIds. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object extendParamChargingMode: description: Node charging mode, 0 is on-demand charging. Changing this parameter will create a new cluster resource. @@ -409,6 +1155,80 @@ spec: description: Key pair name when logging in to select the key pair mode. Changing this parameter will create a new resource. type: string + keyPairRef: + description: Reference to a KeypairV2 in compute to populate keyPair. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + keyPairSelector: + description: Selector for a KeypairV2 in compute to populate keyPair. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object labels: additionalProperties: type: string @@ -477,6 +1297,80 @@ spec: description: The Encryption KMS ID of the system volume. By default, it tries to get from env by OS_KMS_ID. type: string + kmsIdRef: + description: Reference to a KeyV1 in kms to populate kmsId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + kmsIdSelector: + description: Selector for a KeyV1 in kms to populate kmsId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object size: description: Disk size in GB. type: number @@ -700,10 +1594,6 @@ spec: rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.availabilityZone) || (has(self.initProvider) && has(self.initProvider.availabilityZone))' - - message: spec.forProvider.clusterId is a required parameter - rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies - || ''Update'' in self.managementPolicies) || has(self.forProvider.clusterId) - || (has(self.initProvider) && has(self.initProvider.clusterId))' - message: spec.forProvider.dataVolumes is a required parameter rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.dataVolumes) @@ -712,10 +1602,6 @@ spec: rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.flavorId) || (has(self.initProvider) && has(self.initProvider.flavorId))' - - message: spec.forProvider.keyPair is a required parameter - rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies - || ''Update'' in self.managementPolicies) || has(self.forProvider.keyPair) - || (has(self.initProvider) && has(self.initProvider.keyPair))' - message: spec.forProvider.rootVolume is a required parameter rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.rootVolume) diff --git a/package/crds/compute.opentelekomcloud.crossplane.io_instancev2s.yaml b/package/crds/compute.opentelekomcloud.crossplane.io_instancev2s.yaml index aa28f43..704f0b3 100644 --- a/package/crds/compute.opentelekomcloud.crossplane.io_instancev2s.yaml +++ b/package/crds/compute.opentelekomcloud.crossplane.io_instancev2s.yaml @@ -191,7 +191,7 @@ spec: associated with the tenant's account. Changing this creates a new server. type: string keyPairRef: - description: Reference to a KeypairV2 to populate keyPair. + description: Reference to a KeypairV2 in compute to populate keyPair. properties: name: description: Name of the referenced object. @@ -225,7 +225,7 @@ spec: - name type: object keyPairSelector: - description: Selector for a KeypairV2 to populate keyPair. + description: Selector for a KeypairV2 in compute to populate keyPair. properties: matchControllerRef: description: |- @@ -376,7 +376,7 @@ spec: type: array x-kubernetes-list-type: set securityGroupsRefs: - description: References to SecgroupV2 to populate securityGroups. + description: References to SecgroupV2 in compute to populate securityGroups. items: description: A Reference to a named object. properties: @@ -413,7 +413,8 @@ spec: type: object type: array securityGroupsSelector: - description: Selector for a list of SecgroupV2 to populate securityGroups. + description: Selector for a list of SecgroupV2 in compute to populate + securityGroups. properties: matchControllerRef: description: |- @@ -618,7 +619,7 @@ spec: associated with the tenant's account. Changing this creates a new server. type: string keyPairRef: - description: Reference to a KeypairV2 to populate keyPair. + description: Reference to a KeypairV2 in compute to populate keyPair. properties: name: description: Name of the referenced object. @@ -652,7 +653,7 @@ spec: - name type: object keyPairSelector: - description: Selector for a KeypairV2 to populate keyPair. + description: Selector for a KeypairV2 in compute to populate keyPair. properties: matchControllerRef: description: |- @@ -803,7 +804,7 @@ spec: type: array x-kubernetes-list-type: set securityGroupsRefs: - description: References to SecgroupV2 to populate securityGroups. + description: References to SecgroupV2 in compute to populate securityGroups. items: description: A Reference to a named object. properties: @@ -840,7 +841,8 @@ spec: type: object type: array securityGroupsSelector: - description: Selector for a list of SecgroupV2 to populate securityGroups. + description: Selector for a list of SecgroupV2 in compute to populate + securityGroups. properties: matchControllerRef: description: |- diff --git a/package/crds/kms.opentelekomcloud.crossplane.io_keyv1s.yaml b/package/crds/kms.opentelekomcloud.crossplane.io_keyv1s.yaml new file mode 100644 index 0000000..b22f1e0 --- /dev/null +++ b/package/crds/kms.opentelekomcloud.crossplane.io_keyv1s.yaml @@ -0,0 +1,493 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: keyv1s.kms.opentelekomcloud.crossplane.io +spec: + group: kms.opentelekomcloud.crossplane.io + names: + categories: + - crossplane + - managed + - opentelekomcloud + kind: KeyV1 + listKind: KeyV1List + plural: keyv1s + singular: keyv1 + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: KeyV1 is the Schema for the KeyV1s API. Manages a KMS Key resource + within OpenTelekomCloud. + properties: + apiVersion: + 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 + kind: + 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 + metadata: + type: object + spec: + description: KeyV1Spec defines the desired state of KeyV1 + properties: + deletionPolicy: + default: Delete + description: |- + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + allowCancelDeletion: + description: |- + Specifies whether the key is enabled from Pending Deletion state. The value true indicates + that the key state Pending Deletion will be cancelled. + type: boolean + isEnabled: + description: |- + Specifies whether the key is enabled. Defaults to true. + Changing this updates the state of existing key. + type: boolean + keyAlias: + description: |- + The alias in which to create the key. It is required when + we create a new key. Changing this updates the alias of key. + type: string + keyDescription: + description: |- + The description of the key as viewed in OpenTelekomCloud console. + Changing this updates the description of key. + type: string + pendingDays: + description: |- + Duration in days after which the key is deleted + after destruction of the resource, must be between 7 and 1096 days. Defaults to 7. + It only is used when delete a key. + type: string + realm: + description: Region where a key resides. Changing this creates + a new key. + type: string + rotationEnabled: + description: Specifies whether the key is enabled for rotation. + type: boolean + rotationInterval: + description: |- + Rotation interval. The value is an integer ranging from 30 to 365. + Set the interval based on how often a CMK is used. + If it is frequently used, set a short interval; otherwise, set a long one. + type: number + tags: + additionalProperties: + type: string + description: Tags key/value pairs to associate with the AutoScaling + Group. + type: object + x-kubernetes-map-type: granular + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + allowCancelDeletion: + description: |- + Specifies whether the key is enabled from Pending Deletion state. The value true indicates + that the key state Pending Deletion will be cancelled. + type: boolean + isEnabled: + description: |- + Specifies whether the key is enabled. Defaults to true. + Changing this updates the state of existing key. + type: boolean + keyAlias: + description: |- + The alias in which to create the key. It is required when + we create a new key. Changing this updates the alias of key. + type: string + keyDescription: + description: |- + The description of the key as viewed in OpenTelekomCloud console. + Changing this updates the description of key. + type: string + pendingDays: + description: |- + Duration in days after which the key is deleted + after destruction of the resource, must be between 7 and 1096 days. Defaults to 7. + It only is used when delete a key. + type: string + realm: + description: Region where a key resides. Changing this creates + a new key. + type: string + rotationEnabled: + description: Specifies whether the key is enabled for rotation. + type: boolean + rotationInterval: + description: |- + Rotation interval. The value is an integer ranging from 30 to 365. + Set the interval based on how often a CMK is used. + If it is frequently used, set a short interval; otherwise, set a long one. + type: number + tags: + additionalProperties: + type: string + description: Tags key/value pairs to associate with the AutoScaling + Group. + type: object + x-kubernetes-map-type: granular + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + items: + description: |- + A ManagementAction represents an action that the Crossplane controllers + can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: |- + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: |- + PublishConnectionDetailsTo specifies the connection secret config which + contains a name, metadata and a reference to secret store config to + which any connection details for this managed resource should be written. + Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: |- + SecretStoreConfigRef specifies which secret store config should be used + for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: |- + Annotations are the annotations to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.annotations". + - It is up to Secret Store implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: |- + Labels are the labels/tags to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store types. + type: object + type: + description: |- + Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: |- + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + This field is planned to be replaced in a future release in favor of + PublishConnectionDetailsTo. Currently, both could be set independently + and connection details would be published to both without affecting + each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: spec.forProvider.keyAlias is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.keyAlias) + || (has(self.initProvider) && has(self.initProvider.keyAlias))' + status: + description: KeyV1Status defines the observed state of KeyV1. + properties: + atProvider: + properties: + allowCancelDeletion: + description: |- + Specifies whether the key is enabled from Pending Deletion state. The value true indicates + that the key state Pending Deletion will be cancelled. + type: boolean + creationDate: + description: Creation time (time stamp) of a key. + type: string + defaultKeyFlag: + description: |- + Identification of a Master Key. The value 1 indicates a Default + Master Key, and the value 0 indicates a key. + type: string + domainId: + description: ID of a user domain for the key. + type: string + expirationTime: + description: Expiration time. + type: string + id: + description: The globally unique identifier for the key. + type: string + isEnabled: + description: |- + Specifies whether the key is enabled. Defaults to true. + Changing this updates the state of existing key. + type: boolean + keyAlias: + description: |- + The alias in which to create the key. It is required when + we create a new key. Changing this updates the alias of key. + type: string + keyDescription: + description: |- + The description of the key as viewed in OpenTelekomCloud console. + Changing this updates the description of key. + type: string + origin: + description: Origin of a key. The default value is kms. + type: string + pendingDays: + description: |- + Duration in days after which the key is deleted + after destruction of the resource, must be between 7 and 1096 days. Defaults to 7. + It only is used when delete a key. + type: string + realm: + description: Region where a key resides. Changing this creates + a new key. + type: string + rotationEnabled: + description: Specifies whether the key is enabled for rotation. + type: boolean + rotationInterval: + description: |- + Rotation interval. The value is an integer ranging from 30 to 365. + Set the interval based on how often a CMK is used. + If it is frequently used, set a short interval; otherwise, set a long one. + type: number + rotationNumber: + description: Number of key rotations. + type: number + scheduledDeletionDate: + description: Scheduled deletion time (time stamp) of a key. + type: string + tags: + additionalProperties: + type: string + description: Tags key/value pairs to associate with the AutoScaling + Group. + type: object + x-kubernetes-map-type: granular + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {}