From 50b5ae42c8280db270433c6ad0a397253c77f546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergen=20Yal=C3=A7=C4=B1n?= Date: Thu, 16 May 2024 11:56:12 +0300 Subject: [PATCH] Make MaxItems values consistent between JSON schema and provider schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sergen Yalçın --- apis/composer/v1beta2/zz_environment_types.go | 6 +- .../composer/v1beta2/zz_generated.deepcopy.go | 18 +- apis/compute/v1beta2/zz_generated.deepcopy.go | 18 +- .../v1beta2/zz_instancefromtemplate_types.go | 6 +- apis/container/v1beta2/zz_cluster_types.go | 16 +- .../v1beta2/zz_generated.deepcopy.go | 84 +-- apis/container/v1beta2/zz_nodepool_types.go | 12 +- .../v1beta1/zz_generated.conversion_hubs.go | 3 - .../v1beta1/zz_generated.conversion_spokes.go | 20 + .../zz_cryptokeyversion_terraformed.go | 129 ++++ apis/kms/v1beta2/zz_cryptokeyversion_types.go | 207 +++++++ .../v1beta2/zz_generated.conversion_hubs.go | 3 + apis/kms/v1beta2/zz_generated.deepcopy.go | 401 +++++++++++++ apis/kms/v1beta2/zz_generated.managed.go | 60 ++ apis/kms/v1beta2/zz_generated.managedlist.go | 9 + apis/kms/v1beta2/zz_generated.resolvers.go | 50 ++ config/cloudcomposer/config.go | 9 + config/compute/config.go | 3 + config/container/config.go | 26 + config/kms/config.go | 24 +- .../kms/v1beta2/cryptokeyversion.yaml | 44 ++ examples/composer/v1beta2/environment.yaml | 15 + .../compute/v1beta2/instancefromtemplate.yaml | 52 ++ .../composer.gcp.upbound.io_environments.yaml | 240 ++++---- ....gcp.upbound.io_instancefromtemplates.yaml | 54 +- .../container.gcp.upbound.io_clusters.yaml | 160 +++-- .../container.gcp.upbound.io_nodepools.yaml | 96 ++- .../kms.gcp.upbound.io_cryptokeyversions.yaml | 552 ++++++++++++++++++ 28 files changed, 1918 insertions(+), 399 deletions(-) create mode 100755 apis/kms/v1beta2/zz_cryptokeyversion_terraformed.go create mode 100755 apis/kms/v1beta2/zz_cryptokeyversion_types.go create mode 100644 examples-generated/kms/v1beta2/cryptokeyversion.yaml create mode 100644 examples/composer/v1beta2/environment.yaml create mode 100644 examples/compute/v1beta2/instancefromtemplate.yaml diff --git a/apis/composer/v1beta2/zz_environment_types.go b/apis/composer/v1beta2/zz_environment_types.go index c25f14601..9cfa229ae 100755 --- a/apis/composer/v1beta2/zz_environment_types.go +++ b/apis/composer/v1beta2/zz_environment_types.go @@ -708,7 +708,7 @@ type NodeConfigInitParameters struct { // Configuration for controlling how IPs are allocated in the GKE cluster. // Structure is documented below. // Cannot be updated. - IPAllocationPolicy []IPAllocationPolicyInitParameters `json:"ipAllocationPolicy,omitempty" tf:"ip_allocation_policy,omitempty"` + IPAllocationPolicy *IPAllocationPolicyInitParameters `json:"ipAllocationPolicy,omitempty" tf:"ip_allocation_policy,omitempty"` // Machine type on which Airflow web server is running. It has to be one of: composer-n1-webserver-2, // composer-n1-webserver-4 or composer-n1-webserver-8. @@ -799,7 +799,7 @@ type NodeConfigObservation struct { // Configuration for controlling how IPs are allocated in the GKE cluster. // Structure is documented below. // Cannot be updated. - IPAllocationPolicy []IPAllocationPolicyObservation `json:"ipAllocationPolicy,omitempty" tf:"ip_allocation_policy,omitempty"` + IPAllocationPolicy *IPAllocationPolicyObservation `json:"ipAllocationPolicy,omitempty" tf:"ip_allocation_policy,omitempty"` // Machine type on which Airflow web server is running. It has to be one of: composer-n1-webserver-2, // composer-n1-webserver-4 or composer-n1-webserver-8. @@ -863,7 +863,7 @@ type NodeConfigParameters struct { // Structure is documented below. // Cannot be updated. // +kubebuilder:validation:Optional - IPAllocationPolicy []IPAllocationPolicyParameters `json:"ipAllocationPolicy,omitempty" tf:"ip_allocation_policy,omitempty"` + IPAllocationPolicy *IPAllocationPolicyParameters `json:"ipAllocationPolicy,omitempty" tf:"ip_allocation_policy,omitempty"` // Machine type on which Airflow web server is running. It has to be one of: composer-n1-webserver-2, // composer-n1-webserver-4 or composer-n1-webserver-8. diff --git a/apis/composer/v1beta2/zz_generated.deepcopy.go b/apis/composer/v1beta2/zz_generated.deepcopy.go index c8abc108e..e7b087171 100644 --- a/apis/composer/v1beta2/zz_generated.deepcopy.go +++ b/apis/composer/v1beta2/zz_generated.deepcopy.go @@ -1254,10 +1254,8 @@ func (in *NodeConfigInitParameters) DeepCopyInto(out *NodeConfigInitParameters) } if in.IPAllocationPolicy != nil { in, out := &in.IPAllocationPolicy, &out.IPAllocationPolicy - *out = make([]IPAllocationPolicyInitParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(IPAllocationPolicyInitParameters) + (*in).DeepCopyInto(*out) } if in.MachineType != nil { in, out := &in.MachineType, &out.MachineType @@ -1363,10 +1361,8 @@ func (in *NodeConfigObservation) DeepCopyInto(out *NodeConfigObservation) { } if in.IPAllocationPolicy != nil { in, out := &in.IPAllocationPolicy, &out.IPAllocationPolicy - *out = make([]IPAllocationPolicyObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(IPAllocationPolicyObservation) + (*in).DeepCopyInto(*out) } if in.MachineType != nil { in, out := &in.MachineType, &out.MachineType @@ -1442,10 +1438,8 @@ func (in *NodeConfigParameters) DeepCopyInto(out *NodeConfigParameters) { } if in.IPAllocationPolicy != nil { in, out := &in.IPAllocationPolicy, &out.IPAllocationPolicy - *out = make([]IPAllocationPolicyParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(IPAllocationPolicyParameters) + (*in).DeepCopyInto(*out) } if in.MachineType != nil { in, out := &in.MachineType, &out.MachineType diff --git a/apis/compute/v1beta2/zz_generated.deepcopy.go b/apis/compute/v1beta2/zz_generated.deepcopy.go index d1e25ece2..eb59457f9 100644 --- a/apis/compute/v1beta2/zz_generated.deepcopy.go +++ b/apis/compute/v1beta2/zz_generated.deepcopy.go @@ -17193,10 +17193,8 @@ func (in *InstanceFromTemplateInitParameters) DeepCopyInto(out *InstanceFromTemp } if in.ServiceAccount != nil { in, out := &in.ServiceAccount, &out.ServiceAccount - *out = make([]InstanceFromTemplateServiceAccountInitParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(InstanceFromTemplateServiceAccountInitParameters) + (*in).DeepCopyInto(*out) } if in.ShieldedInstanceConfig != nil { in, out := &in.ShieldedInstanceConfig, &out.ShieldedInstanceConfig @@ -17844,10 +17842,8 @@ func (in *InstanceFromTemplateObservation) DeepCopyInto(out *InstanceFromTemplat } if in.ServiceAccount != nil { in, out := &in.ServiceAccount, &out.ServiceAccount - *out = make([]InstanceFromTemplateServiceAccountObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(InstanceFromTemplateServiceAccountObservation) + (*in).DeepCopyInto(*out) } if in.ShieldedInstanceConfig != nil { in, out := &in.ShieldedInstanceConfig, &out.ShieldedInstanceConfig @@ -18070,10 +18066,8 @@ func (in *InstanceFromTemplateParameters) DeepCopyInto(out *InstanceFromTemplate } if in.ServiceAccount != nil { in, out := &in.ServiceAccount, &out.ServiceAccount - *out = make([]InstanceFromTemplateServiceAccountParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(InstanceFromTemplateServiceAccountParameters) + (*in).DeepCopyInto(*out) } if in.ShieldedInstanceConfig != nil { in, out := &in.ShieldedInstanceConfig, &out.ShieldedInstanceConfig diff --git a/apis/compute/v1beta2/zz_instancefromtemplate_types.go b/apis/compute/v1beta2/zz_instancefromtemplate_types.go index ddb1dcf73..15a127edf 100755 --- a/apis/compute/v1beta2/zz_instancefromtemplate_types.go +++ b/apis/compute/v1beta2/zz_instancefromtemplate_types.go @@ -323,7 +323,7 @@ type InstanceFromTemplateInitParameters struct { ScratchDisk []InstanceFromTemplateScratchDiskInitParameters `json:"scratchDisk,omitempty" tf:"scratch_disk,omitempty"` - ServiceAccount []InstanceFromTemplateServiceAccountInitParameters `json:"serviceAccount,omitempty" tf:"service_account,omitempty"` + ServiceAccount *InstanceFromTemplateServiceAccountInitParameters `json:"serviceAccount,omitempty" tf:"service_account,omitempty"` ShieldedInstanceConfig *InstanceFromTemplateShieldedInstanceConfigInitParameters `json:"shieldedInstanceConfig,omitempty" tf:"shielded_instance_config,omitempty"` @@ -573,7 +573,7 @@ type InstanceFromTemplateObservation struct { SelfLink *string `json:"selfLink,omitempty" tf:"self_link,omitempty"` - ServiceAccount []InstanceFromTemplateServiceAccountObservation `json:"serviceAccount,omitempty" tf:"service_account,omitempty"` + ServiceAccount *InstanceFromTemplateServiceAccountObservation `json:"serviceAccount,omitempty" tf:"service_account,omitempty"` ShieldedInstanceConfig *InstanceFromTemplateShieldedInstanceConfigObservation `json:"shieldedInstanceConfig,omitempty" tf:"shielded_instance_config,omitempty"` @@ -682,7 +682,7 @@ type InstanceFromTemplateParameters struct { ScratchDisk []InstanceFromTemplateScratchDiskParameters `json:"scratchDisk,omitempty" tf:"scratch_disk,omitempty"` // +kubebuilder:validation:Optional - ServiceAccount []InstanceFromTemplateServiceAccountParameters `json:"serviceAccount,omitempty" tf:"service_account,omitempty"` + ServiceAccount *InstanceFromTemplateServiceAccountParameters `json:"serviceAccount,omitempty" tf:"service_account,omitempty"` // +kubebuilder:validation:Optional ShieldedInstanceConfig *InstanceFromTemplateShieldedInstanceConfigParameters `json:"shieldedInstanceConfig,omitempty" tf:"shielded_instance_config,omitempty"` diff --git a/apis/container/v1beta2/zz_cluster_types.go b/apis/container/v1beta2/zz_cluster_types.go index 92852fa25..23c36b6b5 100755 --- a/apis/container/v1beta2/zz_cluster_types.go +++ b/apis/container/v1beta2/zz_cluster_types.go @@ -2197,13 +2197,13 @@ type GuestAcceleratorInitParameters struct { Count *float64 `json:"count,omitempty" tf:"count"` // Configuration for auto installation of GPU driver. Structure is documented below. - GpuDriverInstallationConfig []GpuDriverInstallationConfigInitParameters `json:"gpuDriverInstallationConfig,omitempty" tf:"gpu_driver_installation_config"` + GpuDriverInstallationConfig *GpuDriverInstallationConfigInitParameters `json:"gpuDriverInstallationConfig,omitempty" tf:"gpu_driver_installation_config"` // Size of partitions to create on the GPU. Valid values are described in the NVIDIA mig user guide. GpuPartitionSize *string `json:"gpuPartitionSize,omitempty" tf:"gpu_partition_size"` // Configuration for GPU sharing. Structure is documented below. - GpuSharingConfig []GpuSharingConfigInitParameters `json:"gpuSharingConfig,omitempty" tf:"gpu_sharing_config"` + GpuSharingConfig *GpuSharingConfigInitParameters `json:"gpuSharingConfig,omitempty" tf:"gpu_sharing_config"` // The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80. Type *string `json:"type,omitempty" tf:"type"` @@ -2215,13 +2215,13 @@ type GuestAcceleratorObservation struct { Count *float64 `json:"count,omitempty" tf:"count,omitempty"` // Configuration for auto installation of GPU driver. Structure is documented below. - GpuDriverInstallationConfig []GpuDriverInstallationConfigObservation `json:"gpuDriverInstallationConfig,omitempty" tf:"gpu_driver_installation_config,omitempty"` + GpuDriverInstallationConfig *GpuDriverInstallationConfigObservation `json:"gpuDriverInstallationConfig,omitempty" tf:"gpu_driver_installation_config,omitempty"` // Size of partitions to create on the GPU. Valid values are described in the NVIDIA mig user guide. GpuPartitionSize *string `json:"gpuPartitionSize,omitempty" tf:"gpu_partition_size,omitempty"` // Configuration for GPU sharing. Structure is documented below. - GpuSharingConfig []GpuSharingConfigObservation `json:"gpuSharingConfig,omitempty" tf:"gpu_sharing_config,omitempty"` + GpuSharingConfig *GpuSharingConfigObservation `json:"gpuSharingConfig,omitempty" tf:"gpu_sharing_config,omitempty"` // The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80. Type *string `json:"type,omitempty" tf:"type,omitempty"` @@ -2235,7 +2235,7 @@ type GuestAcceleratorParameters struct { // Configuration for auto installation of GPU driver. Structure is documented below. // +kubebuilder:validation:Optional - GpuDriverInstallationConfig []GpuDriverInstallationConfigParameters `json:"gpuDriverInstallationConfig,omitempty" tf:"gpu_driver_installation_config"` + GpuDriverInstallationConfig *GpuDriverInstallationConfigParameters `json:"gpuDriverInstallationConfig,omitempty" tf:"gpu_driver_installation_config"` // Size of partitions to create on the GPU. Valid values are described in the NVIDIA mig user guide. // +kubebuilder:validation:Optional @@ -2243,7 +2243,7 @@ type GuestAcceleratorParameters struct { // Configuration for GPU sharing. Structure is documented below. // +kubebuilder:validation:Optional - GpuSharingConfig []GpuSharingConfigParameters `json:"gpuSharingConfig,omitempty" tf:"gpu_sharing_config"` + GpuSharingConfig *GpuSharingConfigParameters `json:"gpuSharingConfig,omitempty" tf:"gpu_sharing_config"` // The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80. // +kubebuilder:validation:Optional @@ -3177,13 +3177,13 @@ type NodeConfigGuestAcceleratorObservation struct { Count *float64 `json:"count,omitempty" tf:"count,omitempty"` // Configuration for auto installation of GPU driver. Structure is documented below. - GpuDriverInstallationConfig []GuestAcceleratorGpuDriverInstallationConfigObservation `json:"gpuDriverInstallationConfig,omitempty" tf:"gpu_driver_installation_config,omitempty"` + GpuDriverInstallationConfig *GuestAcceleratorGpuDriverInstallationConfigObservation `json:"gpuDriverInstallationConfig,omitempty" tf:"gpu_driver_installation_config,omitempty"` // Size of partitions to create on the GPU. Valid values are described in the NVIDIA mig user guide. GpuPartitionSize *string `json:"gpuPartitionSize,omitempty" tf:"gpu_partition_size,omitempty"` // Configuration for GPU sharing. Structure is documented below. - GpuSharingConfig []GuestAcceleratorGpuSharingConfigObservation `json:"gpuSharingConfig,omitempty" tf:"gpu_sharing_config,omitempty"` + GpuSharingConfig *GuestAcceleratorGpuSharingConfigObservation `json:"gpuSharingConfig,omitempty" tf:"gpu_sharing_config,omitempty"` // The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80. Type *string `json:"type,omitempty" tf:"type,omitempty"` diff --git a/apis/container/v1beta2/zz_generated.deepcopy.go b/apis/container/v1beta2/zz_generated.deepcopy.go index e8aabd3df..cf433199c 100644 --- a/apis/container/v1beta2/zz_generated.deepcopy.go +++ b/apis/container/v1beta2/zz_generated.deepcopy.go @@ -4143,10 +4143,8 @@ func (in *GuestAcceleratorInitParameters) DeepCopyInto(out *GuestAcceleratorInit } if in.GpuDriverInstallationConfig != nil { in, out := &in.GpuDriverInstallationConfig, &out.GpuDriverInstallationConfig - *out = make([]GpuDriverInstallationConfigInitParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(GpuDriverInstallationConfigInitParameters) + (*in).DeepCopyInto(*out) } if in.GpuPartitionSize != nil { in, out := &in.GpuPartitionSize, &out.GpuPartitionSize @@ -4155,10 +4153,8 @@ func (in *GuestAcceleratorInitParameters) DeepCopyInto(out *GuestAcceleratorInit } if in.GpuSharingConfig != nil { in, out := &in.GpuSharingConfig, &out.GpuSharingConfig - *out = make([]GpuSharingConfigInitParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(GpuSharingConfigInitParameters) + (*in).DeepCopyInto(*out) } if in.Type != nil { in, out := &in.Type, &out.Type @@ -4187,10 +4183,8 @@ func (in *GuestAcceleratorObservation) DeepCopyInto(out *GuestAcceleratorObserva } if in.GpuDriverInstallationConfig != nil { in, out := &in.GpuDriverInstallationConfig, &out.GpuDriverInstallationConfig - *out = make([]GpuDriverInstallationConfigObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(GpuDriverInstallationConfigObservation) + (*in).DeepCopyInto(*out) } if in.GpuPartitionSize != nil { in, out := &in.GpuPartitionSize, &out.GpuPartitionSize @@ -4199,10 +4193,8 @@ func (in *GuestAcceleratorObservation) DeepCopyInto(out *GuestAcceleratorObserva } if in.GpuSharingConfig != nil { in, out := &in.GpuSharingConfig, &out.GpuSharingConfig - *out = make([]GpuSharingConfigObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(GpuSharingConfigObservation) + (*in).DeepCopyInto(*out) } if in.Type != nil { in, out := &in.Type, &out.Type @@ -4231,10 +4223,8 @@ func (in *GuestAcceleratorParameters) DeepCopyInto(out *GuestAcceleratorParamete } if in.GpuDriverInstallationConfig != nil { in, out := &in.GpuDriverInstallationConfig, &out.GpuDriverInstallationConfig - *out = make([]GpuDriverInstallationConfigParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(GpuDriverInstallationConfigParameters) + (*in).DeepCopyInto(*out) } if in.GpuPartitionSize != nil { in, out := &in.GpuPartitionSize, &out.GpuPartitionSize @@ -4243,10 +4233,8 @@ func (in *GuestAcceleratorParameters) DeepCopyInto(out *GuestAcceleratorParamete } if in.GpuSharingConfig != nil { in, out := &in.GpuSharingConfig, &out.GpuSharingConfig - *out = make([]GpuSharingConfigParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(GpuSharingConfigParameters) + (*in).DeepCopyInto(*out) } if in.Type != nil { in, out := &in.Type, &out.Type @@ -6884,10 +6872,8 @@ func (in *NodeConfigGuestAcceleratorObservation) DeepCopyInto(out *NodeConfigGue } if in.GpuDriverInstallationConfig != nil { in, out := &in.GpuDriverInstallationConfig, &out.GpuDriverInstallationConfig - *out = make([]GuestAcceleratorGpuDriverInstallationConfigObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(GuestAcceleratorGpuDriverInstallationConfigObservation) + (*in).DeepCopyInto(*out) } if in.GpuPartitionSize != nil { in, out := &in.GpuPartitionSize, &out.GpuPartitionSize @@ -6896,10 +6882,8 @@ func (in *NodeConfigGuestAcceleratorObservation) DeepCopyInto(out *NodeConfigGue } if in.GpuSharingConfig != nil { in, out := &in.GpuSharingConfig, &out.GpuSharingConfig - *out = make([]GuestAcceleratorGpuSharingConfigObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(GuestAcceleratorGpuSharingConfigObservation) + (*in).DeepCopyInto(*out) } if in.Type != nil { in, out := &in.Type, &out.Type @@ -9542,10 +9526,8 @@ func (in *NodePoolNodeConfigGuestAcceleratorInitParameters) DeepCopyInto(out *No } if in.GpuDriverInstallationConfig != nil { in, out := &in.GpuDriverInstallationConfig, &out.GpuDriverInstallationConfig - *out = make([]NodeConfigGuestAcceleratorGpuDriverInstallationConfigInitParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(NodeConfigGuestAcceleratorGpuDriverInstallationConfigInitParameters) + (*in).DeepCopyInto(*out) } if in.GpuPartitionSize != nil { in, out := &in.GpuPartitionSize, &out.GpuPartitionSize @@ -9554,10 +9536,8 @@ func (in *NodePoolNodeConfigGuestAcceleratorInitParameters) DeepCopyInto(out *No } if in.GpuSharingConfig != nil { in, out := &in.GpuSharingConfig, &out.GpuSharingConfig - *out = make([]NodeConfigGuestAcceleratorGpuSharingConfigInitParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(NodeConfigGuestAcceleratorGpuSharingConfigInitParameters) + (*in).DeepCopyInto(*out) } if in.Type != nil { in, out := &in.Type, &out.Type @@ -9586,10 +9566,8 @@ func (in *NodePoolNodeConfigGuestAcceleratorObservation) DeepCopyInto(out *NodeP } if in.GpuDriverInstallationConfig != nil { in, out := &in.GpuDriverInstallationConfig, &out.GpuDriverInstallationConfig - *out = make([]NodeConfigGuestAcceleratorGpuDriverInstallationConfigObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(NodeConfigGuestAcceleratorGpuDriverInstallationConfigObservation) + (*in).DeepCopyInto(*out) } if in.GpuPartitionSize != nil { in, out := &in.GpuPartitionSize, &out.GpuPartitionSize @@ -9598,10 +9576,8 @@ func (in *NodePoolNodeConfigGuestAcceleratorObservation) DeepCopyInto(out *NodeP } if in.GpuSharingConfig != nil { in, out := &in.GpuSharingConfig, &out.GpuSharingConfig - *out = make([]NodeConfigGuestAcceleratorGpuSharingConfigObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(NodeConfigGuestAcceleratorGpuSharingConfigObservation) + (*in).DeepCopyInto(*out) } if in.Type != nil { in, out := &in.Type, &out.Type @@ -9630,10 +9606,8 @@ func (in *NodePoolNodeConfigGuestAcceleratorParameters) DeepCopyInto(out *NodePo } if in.GpuDriverInstallationConfig != nil { in, out := &in.GpuDriverInstallationConfig, &out.GpuDriverInstallationConfig - *out = make([]NodeConfigGuestAcceleratorGpuDriverInstallationConfigParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(NodeConfigGuestAcceleratorGpuDriverInstallationConfigParameters) + (*in).DeepCopyInto(*out) } if in.GpuPartitionSize != nil { in, out := &in.GpuPartitionSize, &out.GpuPartitionSize @@ -9642,10 +9616,8 @@ func (in *NodePoolNodeConfigGuestAcceleratorParameters) DeepCopyInto(out *NodePo } if in.GpuSharingConfig != nil { in, out := &in.GpuSharingConfig, &out.GpuSharingConfig - *out = make([]NodeConfigGuestAcceleratorGpuSharingConfigParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + *out = new(NodeConfigGuestAcceleratorGpuSharingConfigParameters) + (*in).DeepCopyInto(*out) } if in.Type != nil { in, out := &in.Type, &out.Type diff --git a/apis/container/v1beta2/zz_nodepool_types.go b/apis/container/v1beta2/zz_nodepool_types.go index 0c67da53f..42f8928ab 100755 --- a/apis/container/v1beta2/zz_nodepool_types.go +++ b/apis/container/v1beta2/zz_nodepool_types.go @@ -451,11 +451,11 @@ type NodePoolNodeConfigGcfsConfigParameters struct { type NodePoolNodeConfigGuestAcceleratorInitParameters struct { Count *float64 `json:"count,omitempty" tf:"count"` - GpuDriverInstallationConfig []NodeConfigGuestAcceleratorGpuDriverInstallationConfigInitParameters `json:"gpuDriverInstallationConfig,omitempty" tf:"gpu_driver_installation_config"` + GpuDriverInstallationConfig *NodeConfigGuestAcceleratorGpuDriverInstallationConfigInitParameters `json:"gpuDriverInstallationConfig,omitempty" tf:"gpu_driver_installation_config"` GpuPartitionSize *string `json:"gpuPartitionSize,omitempty" tf:"gpu_partition_size"` - GpuSharingConfig []NodeConfigGuestAcceleratorGpuSharingConfigInitParameters `json:"gpuSharingConfig,omitempty" tf:"gpu_sharing_config"` + GpuSharingConfig *NodeConfigGuestAcceleratorGpuSharingConfigInitParameters `json:"gpuSharingConfig,omitempty" tf:"gpu_sharing_config"` // The type of the policy. Supports a single value: COMPACT. // Specifying COMPACT placement policy type places node pool's nodes in a closer @@ -466,11 +466,11 @@ type NodePoolNodeConfigGuestAcceleratorInitParameters struct { type NodePoolNodeConfigGuestAcceleratorObservation struct { Count *float64 `json:"count,omitempty" tf:"count,omitempty"` - GpuDriverInstallationConfig []NodeConfigGuestAcceleratorGpuDriverInstallationConfigObservation `json:"gpuDriverInstallationConfig,omitempty" tf:"gpu_driver_installation_config,omitempty"` + GpuDriverInstallationConfig *NodeConfigGuestAcceleratorGpuDriverInstallationConfigObservation `json:"gpuDriverInstallationConfig,omitempty" tf:"gpu_driver_installation_config,omitempty"` GpuPartitionSize *string `json:"gpuPartitionSize,omitempty" tf:"gpu_partition_size,omitempty"` - GpuSharingConfig []NodeConfigGuestAcceleratorGpuSharingConfigObservation `json:"gpuSharingConfig,omitempty" tf:"gpu_sharing_config,omitempty"` + GpuSharingConfig *NodeConfigGuestAcceleratorGpuSharingConfigObservation `json:"gpuSharingConfig,omitempty" tf:"gpu_sharing_config,omitempty"` // The type of the policy. Supports a single value: COMPACT. // Specifying COMPACT placement policy type places node pool's nodes in a closer @@ -484,13 +484,13 @@ type NodePoolNodeConfigGuestAcceleratorParameters struct { Count *float64 `json:"count,omitempty" tf:"count"` // +kubebuilder:validation:Optional - GpuDriverInstallationConfig []NodeConfigGuestAcceleratorGpuDriverInstallationConfigParameters `json:"gpuDriverInstallationConfig,omitempty" tf:"gpu_driver_installation_config"` + GpuDriverInstallationConfig *NodeConfigGuestAcceleratorGpuDriverInstallationConfigParameters `json:"gpuDriverInstallationConfig,omitempty" tf:"gpu_driver_installation_config"` // +kubebuilder:validation:Optional GpuPartitionSize *string `json:"gpuPartitionSize,omitempty" tf:"gpu_partition_size"` // +kubebuilder:validation:Optional - GpuSharingConfig []NodeConfigGuestAcceleratorGpuSharingConfigParameters `json:"gpuSharingConfig,omitempty" tf:"gpu_sharing_config"` + GpuSharingConfig *NodeConfigGuestAcceleratorGpuSharingConfigParameters `json:"gpuSharingConfig,omitempty" tf:"gpu_sharing_config"` // The type of the policy. Supports a single value: COMPACT. // Specifying COMPACT placement policy type places node pool's nodes in a closer diff --git a/apis/kms/v1beta1/zz_generated.conversion_hubs.go b/apis/kms/v1beta1/zz_generated.conversion_hubs.go index 75338c6dc..072be76ee 100755 --- a/apis/kms/v1beta1/zz_generated.conversion_hubs.go +++ b/apis/kms/v1beta1/zz_generated.conversion_hubs.go @@ -6,9 +6,6 @@ package v1beta1 -// Hub marks this type as a conversion hub. -func (tr *CryptoKeyVersion) Hub() {} - // Hub marks this type as a conversion hub. func (tr *KeyRing) Hub() {} diff --git a/apis/kms/v1beta1/zz_generated.conversion_spokes.go b/apis/kms/v1beta1/zz_generated.conversion_spokes.go index fcf7f47a5..7eb0fabaf 100755 --- a/apis/kms/v1beta1/zz_generated.conversion_spokes.go +++ b/apis/kms/v1beta1/zz_generated.conversion_spokes.go @@ -53,6 +53,26 @@ func (tr *CryptoKeyIAMMember) ConvertFrom(srcRaw conversion.Hub) error { return nil } +// ConvertTo converts this CryptoKeyVersion to the hub type. +func (tr *CryptoKeyVersion) ConvertTo(dstRaw conversion.Hub) error { + spokeVersion := tr.GetObjectKind().GroupVersionKind().Version + hubVersion := dstRaw.GetObjectKind().GroupVersionKind().Version + if err := ujconversion.RoundTrip(dstRaw.(resource.Terraformed), tr); err != nil { + return errors.Wrapf(err, "cannot convert from the spoke version %q to the hub version %q", spokeVersion, hubVersion) + } + return nil +} + +// ConvertFrom converts from the hub type to the CryptoKeyVersion type. +func (tr *CryptoKeyVersion) ConvertFrom(srcRaw conversion.Hub) error { + spokeVersion := tr.GetObjectKind().GroupVersionKind().Version + hubVersion := srcRaw.GetObjectKind().GroupVersionKind().Version + if err := ujconversion.RoundTrip(tr, srcRaw.(resource.Terraformed)); err != nil { + return errors.Wrapf(err, "cannot convert from the hub version %q to the spoke version %q", hubVersion, spokeVersion) + } + return nil +} + // ConvertTo converts this KeyRingIAMMember to the hub type. func (tr *KeyRingIAMMember) ConvertTo(dstRaw conversion.Hub) error { spokeVersion := tr.GetObjectKind().GroupVersionKind().Version diff --git a/apis/kms/v1beta2/zz_cryptokeyversion_terraformed.go b/apis/kms/v1beta2/zz_cryptokeyversion_terraformed.go new file mode 100755 index 000000000..10be26616 --- /dev/null +++ b/apis/kms/v1beta2/zz_cryptokeyversion_terraformed.go @@ -0,0 +1,129 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta2 + +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 CryptoKeyVersion +func (mg *CryptoKeyVersion) GetTerraformResourceType() string { + return "google_kms_crypto_key_version" +} + +// GetConnectionDetailsMapping for this CryptoKeyVersion +func (tr *CryptoKeyVersion) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this CryptoKeyVersion +func (tr *CryptoKeyVersion) 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 CryptoKeyVersion +func (tr *CryptoKeyVersion) 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 CryptoKeyVersion +func (tr *CryptoKeyVersion) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this CryptoKeyVersion +func (tr *CryptoKeyVersion) 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 CryptoKeyVersion +func (tr *CryptoKeyVersion) 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 CryptoKeyVersion +func (tr *CryptoKeyVersion) 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 CryptoKeyVersion +func (tr *CryptoKeyVersion) 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 CryptoKeyVersion using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *CryptoKeyVersion) LateInitialize(attrs []byte) (bool, error) { + params := &CryptoKeyVersionParameters{} + 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 *CryptoKeyVersion) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/kms/v1beta2/zz_cryptokeyversion_types.go b/apis/kms/v1beta2/zz_cryptokeyversion_types.go new file mode 100755 index 000000000..dff4be5f4 --- /dev/null +++ b/apis/kms/v1beta2/zz_cryptokeyversion_types.go @@ -0,0 +1,207 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta2 + +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 AttestationInitParameters struct { +} + +type AttestationObservation struct { + + // The certificate chains needed to validate the attestation + // Structure is documented below. + CertChains *CertChainsObservation `json:"certChains,omitempty" tf:"cert_chains,omitempty"` + + // (Output) + // The attestation data provided by the HSM when the key operation was performed. + Content *string `json:"content,omitempty" tf:"content,omitempty"` + + // ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels. + // Structure is documented below. + ExternalProtectionLevelOptions *ExternalProtectionLevelOptionsObservation `json:"externalProtectionLevelOptions,omitempty" tf:"external_protection_level_options,omitempty"` + + // (Output) + // The format of the attestation data. + Format *string `json:"format,omitempty" tf:"format,omitempty"` +} + +type AttestationParameters struct { +} + +type CertChainsInitParameters struct { +} + +type CertChainsObservation struct { + + // Cavium certificate chain corresponding to the attestation. + CaviumCerts *string `json:"caviumCerts,omitempty" tf:"cavium_certs,omitempty"` + + // Google card certificate chain corresponding to the attestation. + GoogleCardCerts *string `json:"googleCardCerts,omitempty" tf:"google_card_certs,omitempty"` + + // Google partition certificate chain corresponding to the attestation. + GooglePartitionCerts *string `json:"googlePartitionCerts,omitempty" tf:"google_partition_certs,omitempty"` +} + +type CertChainsParameters struct { +} + +type CryptoKeyVersionInitParameters struct { + + // The name of the cryptoKey associated with the CryptoKeyVersions. + // Format: 'projects/{{project}}/locations/{{location}}/keyRings/{{keyring}}/cryptoKeys/{{cryptoKey}}' + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/kms/v1beta2.CryptoKey + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + CryptoKey *string `json:"cryptoKey,omitempty" tf:"crypto_key,omitempty"` + + // Reference to a CryptoKey in kms to populate cryptoKey. + // +kubebuilder:validation:Optional + CryptoKeyRef *v1.Reference `json:"cryptoKeyRef,omitempty" tf:"-"` + + // Selector for a CryptoKey in kms to populate cryptoKey. + // +kubebuilder:validation:Optional + CryptoKeySelector *v1.Selector `json:"cryptoKeySelector,omitempty" tf:"-"` + + // The current state of the CryptoKeyVersion. + // Possible values are: PENDING_GENERATION, ENABLED, DISABLED, DESTROYED, DESTROY_SCHEDULED, PENDING_IMPORT, IMPORT_FAILED. + State *string `json:"state,omitempty" tf:"state,omitempty"` +} + +type CryptoKeyVersionObservation struct { + + // The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports. + Algorithm *string `json:"algorithm,omitempty" tf:"algorithm,omitempty"` + + // Statement that was generated and signed by the HSM at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. + // Only provided for key versions with protectionLevel HSM. + // Structure is documented below. + Attestation []AttestationObservation `json:"attestation,omitempty" tf:"attestation,omitempty"` + + // The name of the cryptoKey associated with the CryptoKeyVersions. + // Format: 'projects/{{project}}/locations/{{location}}/keyRings/{{keyring}}/cryptoKeys/{{cryptoKey}}' + CryptoKey *string `json:"cryptoKey,omitempty" tf:"crypto_key,omitempty"` + + // The time this CryptoKeyVersion key material was generated + GenerateTime *string `json:"generateTime,omitempty" tf:"generate_time,omitempty"` + + // an identifier for the resource with format {{name}} + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The resource name for this CryptoKeyVersion. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // The ProtectionLevel describing how crypto operations are performed with this CryptoKeyVersion. + ProtectionLevel *string `json:"protectionLevel,omitempty" tf:"protection_level,omitempty"` + + // The current state of the CryptoKeyVersion. + // Possible values are: PENDING_GENERATION, ENABLED, DISABLED, DESTROYED, DESTROY_SCHEDULED, PENDING_IMPORT, IMPORT_FAILED. + State *string `json:"state,omitempty" tf:"state,omitempty"` +} + +type CryptoKeyVersionParameters struct { + + // The name of the cryptoKey associated with the CryptoKeyVersions. + // Format: 'projects/{{project}}/locations/{{location}}/keyRings/{{keyring}}/cryptoKeys/{{cryptoKey}}' + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/kms/v1beta2.CryptoKey + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + CryptoKey *string `json:"cryptoKey,omitempty" tf:"crypto_key,omitempty"` + + // Reference to a CryptoKey in kms to populate cryptoKey. + // +kubebuilder:validation:Optional + CryptoKeyRef *v1.Reference `json:"cryptoKeyRef,omitempty" tf:"-"` + + // Selector for a CryptoKey in kms to populate cryptoKey. + // +kubebuilder:validation:Optional + CryptoKeySelector *v1.Selector `json:"cryptoKeySelector,omitempty" tf:"-"` + + // The current state of the CryptoKeyVersion. + // Possible values are: PENDING_GENERATION, ENABLED, DISABLED, DESTROYED, DESTROY_SCHEDULED, PENDING_IMPORT, IMPORT_FAILED. + // +kubebuilder:validation:Optional + State *string `json:"state,omitempty" tf:"state,omitempty"` +} + +type ExternalProtectionLevelOptionsInitParameters struct { +} + +type ExternalProtectionLevelOptionsObservation struct { + + // The path to the external key material on the EKM when using EkmConnection e.g., "v0/my/key". Set this field instead of externalKeyUri when using an EkmConnection. + EkmConnectionKeyPath *string `json:"ekmConnectionKeyPath,omitempty" tf:"ekm_connection_key_path,omitempty"` + + // The URI for an external resource that this CryptoKeyVersion represents. + ExternalKeyURI *string `json:"externalKeyUri,omitempty" tf:"external_key_uri,omitempty"` +} + +type ExternalProtectionLevelOptionsParameters struct { +} + +// CryptoKeyVersionSpec defines the desired state of CryptoKeyVersion +type CryptoKeyVersionSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider CryptoKeyVersionParameters `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 CryptoKeyVersionInitParameters `json:"initProvider,omitempty"` +} + +// CryptoKeyVersionStatus defines the observed state of CryptoKeyVersion. +type CryptoKeyVersionStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider CryptoKeyVersionObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status + +// CryptoKeyVersion is the Schema for the CryptoKeyVersions API. A +// +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,gcp} +type CryptoKeyVersion struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec CryptoKeyVersionSpec `json:"spec"` + Status CryptoKeyVersionStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// CryptoKeyVersionList contains a list of CryptoKeyVersions +type CryptoKeyVersionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []CryptoKeyVersion `json:"items"` +} + +// Repository type metadata. +var ( + CryptoKeyVersion_Kind = "CryptoKeyVersion" + CryptoKeyVersion_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: CryptoKeyVersion_Kind}.String() + CryptoKeyVersion_KindAPIVersion = CryptoKeyVersion_Kind + "." + CRDGroupVersion.String() + CryptoKeyVersion_GroupVersionKind = CRDGroupVersion.WithKind(CryptoKeyVersion_Kind) +) + +func init() { + SchemeBuilder.Register(&CryptoKeyVersion{}, &CryptoKeyVersionList{}) +} diff --git a/apis/kms/v1beta2/zz_generated.conversion_hubs.go b/apis/kms/v1beta2/zz_generated.conversion_hubs.go index a66b7e70c..a33a89098 100755 --- a/apis/kms/v1beta2/zz_generated.conversion_hubs.go +++ b/apis/kms/v1beta2/zz_generated.conversion_hubs.go @@ -12,5 +12,8 @@ func (tr *CryptoKey) Hub() {} // Hub marks this type as a conversion hub. func (tr *CryptoKeyIAMMember) Hub() {} +// Hub marks this type as a conversion hub. +func (tr *CryptoKeyVersion) Hub() {} + // Hub marks this type as a conversion hub. func (tr *KeyRingIAMMember) Hub() {} diff --git a/apis/kms/v1beta2/zz_generated.deepcopy.go b/apis/kms/v1beta2/zz_generated.deepcopy.go index e782d1fca..decaf9bd0 100644 --- a/apis/kms/v1beta2/zz_generated.deepcopy.go +++ b/apis/kms/v1beta2/zz_generated.deepcopy.go @@ -13,6 +13,131 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AttestationInitParameters) DeepCopyInto(out *AttestationInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttestationInitParameters. +func (in *AttestationInitParameters) DeepCopy() *AttestationInitParameters { + if in == nil { + return nil + } + out := new(AttestationInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AttestationObservation) DeepCopyInto(out *AttestationObservation) { + *out = *in + if in.CertChains != nil { + in, out := &in.CertChains, &out.CertChains + *out = new(CertChainsObservation) + (*in).DeepCopyInto(*out) + } + if in.Content != nil { + in, out := &in.Content, &out.Content + *out = new(string) + **out = **in + } + if in.ExternalProtectionLevelOptions != nil { + in, out := &in.ExternalProtectionLevelOptions, &out.ExternalProtectionLevelOptions + *out = new(ExternalProtectionLevelOptionsObservation) + (*in).DeepCopyInto(*out) + } + if in.Format != nil { + in, out := &in.Format, &out.Format + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttestationObservation. +func (in *AttestationObservation) DeepCopy() *AttestationObservation { + if in == nil { + return nil + } + out := new(AttestationObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AttestationParameters) DeepCopyInto(out *AttestationParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttestationParameters. +func (in *AttestationParameters) DeepCopy() *AttestationParameters { + if in == nil { + return nil + } + out := new(AttestationParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertChainsInitParameters) DeepCopyInto(out *CertChainsInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertChainsInitParameters. +func (in *CertChainsInitParameters) DeepCopy() *CertChainsInitParameters { + if in == nil { + return nil + } + out := new(CertChainsInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertChainsObservation) DeepCopyInto(out *CertChainsObservation) { + *out = *in + if in.CaviumCerts != nil { + in, out := &in.CaviumCerts, &out.CaviumCerts + *out = new(string) + **out = **in + } + if in.GoogleCardCerts != nil { + in, out := &in.GoogleCardCerts, &out.GoogleCardCerts + *out = new(string) + **out = **in + } + if in.GooglePartitionCerts != nil { + in, out := &in.GooglePartitionCerts, &out.GooglePartitionCerts + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertChainsObservation. +func (in *CertChainsObservation) DeepCopy() *CertChainsObservation { + if in == nil { + return nil + } + out := new(CertChainsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertChainsParameters) DeepCopyInto(out *CertChainsParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertChainsParameters. +func (in *CertChainsParameters) DeepCopy() *CertChainsParameters { + if in == nil { + return nil + } + out := new(CertChainsParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ConditionInitParameters) DeepCopyInto(out *ConditionInitParameters) { *out = *in @@ -673,6 +798,282 @@ func (in *CryptoKeyStatus) DeepCopy() *CryptoKeyStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CryptoKeyVersion) DeepCopyInto(out *CryptoKeyVersion) { + *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 CryptoKeyVersion. +func (in *CryptoKeyVersion) DeepCopy() *CryptoKeyVersion { + if in == nil { + return nil + } + out := new(CryptoKeyVersion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CryptoKeyVersion) 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 *CryptoKeyVersionInitParameters) DeepCopyInto(out *CryptoKeyVersionInitParameters) { + *out = *in + if in.CryptoKey != nil { + in, out := &in.CryptoKey, &out.CryptoKey + *out = new(string) + **out = **in + } + if in.CryptoKeyRef != nil { + in, out := &in.CryptoKeyRef, &out.CryptoKeyRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.CryptoKeySelector != nil { + in, out := &in.CryptoKeySelector, &out.CryptoKeySelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CryptoKeyVersionInitParameters. +func (in *CryptoKeyVersionInitParameters) DeepCopy() *CryptoKeyVersionInitParameters { + if in == nil { + return nil + } + out := new(CryptoKeyVersionInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CryptoKeyVersionList) DeepCopyInto(out *CryptoKeyVersionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CryptoKeyVersion, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CryptoKeyVersionList. +func (in *CryptoKeyVersionList) DeepCopy() *CryptoKeyVersionList { + if in == nil { + return nil + } + out := new(CryptoKeyVersionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CryptoKeyVersionList) 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 *CryptoKeyVersionObservation) DeepCopyInto(out *CryptoKeyVersionObservation) { + *out = *in + if in.Algorithm != nil { + in, out := &in.Algorithm, &out.Algorithm + *out = new(string) + **out = **in + } + if in.Attestation != nil { + in, out := &in.Attestation, &out.Attestation + *out = make([]AttestationObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.CryptoKey != nil { + in, out := &in.CryptoKey, &out.CryptoKey + *out = new(string) + **out = **in + } + if in.GenerateTime != nil { + in, out := &in.GenerateTime, &out.GenerateTime + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.ProtectionLevel != nil { + in, out := &in.ProtectionLevel, &out.ProtectionLevel + *out = new(string) + **out = **in + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CryptoKeyVersionObservation. +func (in *CryptoKeyVersionObservation) DeepCopy() *CryptoKeyVersionObservation { + if in == nil { + return nil + } + out := new(CryptoKeyVersionObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CryptoKeyVersionParameters) DeepCopyInto(out *CryptoKeyVersionParameters) { + *out = *in + if in.CryptoKey != nil { + in, out := &in.CryptoKey, &out.CryptoKey + *out = new(string) + **out = **in + } + if in.CryptoKeyRef != nil { + in, out := &in.CryptoKeyRef, &out.CryptoKeyRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.CryptoKeySelector != nil { + in, out := &in.CryptoKeySelector, &out.CryptoKeySelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CryptoKeyVersionParameters. +func (in *CryptoKeyVersionParameters) DeepCopy() *CryptoKeyVersionParameters { + if in == nil { + return nil + } + out := new(CryptoKeyVersionParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CryptoKeyVersionSpec) DeepCopyInto(out *CryptoKeyVersionSpec) { + *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 CryptoKeyVersionSpec. +func (in *CryptoKeyVersionSpec) DeepCopy() *CryptoKeyVersionSpec { + if in == nil { + return nil + } + out := new(CryptoKeyVersionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CryptoKeyVersionStatus) DeepCopyInto(out *CryptoKeyVersionStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CryptoKeyVersionStatus. +func (in *CryptoKeyVersionStatus) DeepCopy() *CryptoKeyVersionStatus { + if in == nil { + return nil + } + out := new(CryptoKeyVersionStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalProtectionLevelOptionsInitParameters) DeepCopyInto(out *ExternalProtectionLevelOptionsInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalProtectionLevelOptionsInitParameters. +func (in *ExternalProtectionLevelOptionsInitParameters) DeepCopy() *ExternalProtectionLevelOptionsInitParameters { + if in == nil { + return nil + } + out := new(ExternalProtectionLevelOptionsInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalProtectionLevelOptionsObservation) DeepCopyInto(out *ExternalProtectionLevelOptionsObservation) { + *out = *in + if in.EkmConnectionKeyPath != nil { + in, out := &in.EkmConnectionKeyPath, &out.EkmConnectionKeyPath + *out = new(string) + **out = **in + } + if in.ExternalKeyURI != nil { + in, out := &in.ExternalKeyURI, &out.ExternalKeyURI + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalProtectionLevelOptionsObservation. +func (in *ExternalProtectionLevelOptionsObservation) DeepCopy() *ExternalProtectionLevelOptionsObservation { + if in == nil { + return nil + } + out := new(ExternalProtectionLevelOptionsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalProtectionLevelOptionsParameters) DeepCopyInto(out *ExternalProtectionLevelOptionsParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalProtectionLevelOptionsParameters. +func (in *ExternalProtectionLevelOptionsParameters) DeepCopy() *ExternalProtectionLevelOptionsParameters { + if in == nil { + return nil + } + out := new(ExternalProtectionLevelOptionsParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KeyRingIAMMember) DeepCopyInto(out *KeyRingIAMMember) { *out = *in diff --git a/apis/kms/v1beta2/zz_generated.managed.go b/apis/kms/v1beta2/zz_generated.managed.go index 0c82422ac..1e869c654 100644 --- a/apis/kms/v1beta2/zz_generated.managed.go +++ b/apis/kms/v1beta2/zz_generated.managed.go @@ -127,6 +127,66 @@ func (mg *CryptoKeyIAMMember) SetWriteConnectionSecretToReference(r *xpv1.Secret mg.Spec.WriteConnectionSecretToReference = r } +// GetCondition of this CryptoKeyVersion. +func (mg *CryptoKeyVersion) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this CryptoKeyVersion. +func (mg *CryptoKeyVersion) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this CryptoKeyVersion. +func (mg *CryptoKeyVersion) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this CryptoKeyVersion. +func (mg *CryptoKeyVersion) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this CryptoKeyVersion. +func (mg *CryptoKeyVersion) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this CryptoKeyVersion. +func (mg *CryptoKeyVersion) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this CryptoKeyVersion. +func (mg *CryptoKeyVersion) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this CryptoKeyVersion. +func (mg *CryptoKeyVersion) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this CryptoKeyVersion. +func (mg *CryptoKeyVersion) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this CryptoKeyVersion. +func (mg *CryptoKeyVersion) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this CryptoKeyVersion. +func (mg *CryptoKeyVersion) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this CryptoKeyVersion. +func (mg *CryptoKeyVersion) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + // GetCondition of this KeyRingIAMMember. func (mg *KeyRingIAMMember) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) diff --git a/apis/kms/v1beta2/zz_generated.managedlist.go b/apis/kms/v1beta2/zz_generated.managedlist.go index 6ca0fda42..d51682bba 100644 --- a/apis/kms/v1beta2/zz_generated.managedlist.go +++ b/apis/kms/v1beta2/zz_generated.managedlist.go @@ -25,6 +25,15 @@ func (l *CryptoKeyList) GetItems() []resource.Managed { return items } +// GetItems of this CryptoKeyVersionList. +func (l *CryptoKeyVersionList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + // GetItems of this KeyRingIAMMemberList. func (l *KeyRingIAMMemberList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) diff --git a/apis/kms/v1beta2/zz_generated.resolvers.go b/apis/kms/v1beta2/zz_generated.resolvers.go index 3542d70be..83b620eb8 100644 --- a/apis/kms/v1beta2/zz_generated.resolvers.go +++ b/apis/kms/v1beta2/zz_generated.resolvers.go @@ -99,6 +99,56 @@ func (mg *CryptoKeyIAMMember) ResolveReferences(ctx context.Context, c client.Re return nil } +// ResolveReferences of this CryptoKeyVersion. +func (mg *CryptoKeyVersion) ResolveReferences(ctx context.Context, c client.Reader) error { + var m xpresource.Managed + var l xpresource.ManagedList + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + { + m, l, err = apisresolver.GetManagedResource("kms.gcp.upbound.io", "v1beta2", "CryptoKey", "CryptoKeyList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.CryptoKey), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.CryptoKeyRef, + Selector: mg.Spec.ForProvider.CryptoKeySelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.CryptoKey") + } + mg.Spec.ForProvider.CryptoKey = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.CryptoKeyRef = rsp.ResolvedReference + { + m, l, err = apisresolver.GetManagedResource("kms.gcp.upbound.io", "v1beta2", "CryptoKey", "CryptoKeyList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.CryptoKey), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.CryptoKeyRef, + Selector: mg.Spec.InitProvider.CryptoKeySelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.CryptoKey") + } + mg.Spec.InitProvider.CryptoKey = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.CryptoKeyRef = rsp.ResolvedReference + + return nil +} + // ResolveReferences of this KeyRingIAMMember. func (mg *KeyRingIAMMember) ResolveReferences(ctx context.Context, c client.Reader) error { var m xpresource.Managed diff --git a/config/cloudcomposer/config.go b/config/cloudcomposer/config.go index f24a06b9b..59c03f7ac 100644 --- a/config/cloudcomposer/config.go +++ b/config/cloudcomposer/config.go @@ -5,6 +5,8 @@ package composer import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/crossplane/upjet/pkg/config" ) @@ -27,6 +29,13 @@ func Configure(p *config.Provider) { r.References["private_environment_config.cloud_composer_connection_subnetwork"] = config.Reference{ TerraformName: "google_compute_subnetwork", } + + r.TerraformResource.Schema["config"].Elem.(*schema.Resource). + Schema["node_config"].Elem.(*schema.Resource). + Schema["ip_allocation_policy"].MaxItems = 1 + + r.AddSingletonListConversion("config[*].node_config[*].ip_allocation_policy", "config[*].nodeConfig[*].ipAllocationPolicy") + r.MarkAsRequired("region") }) } diff --git a/config/compute/config.go b/config/compute/config.go index 2a08d0324..041de8420 100644 --- a/config/compute/config.go +++ b/config/compute/config.go @@ -187,6 +187,9 @@ func Configure(p *config.Provider) { //nolint: gocyclo Schema["initialize_params"].Elem.(*schema.Resource). Schema["labels"].Elem = schema.TypeString r.TerraformResource.Schema["metadata"].Elem = schema.TypeString + r.TerraformResource.Schema["service_account"].MaxItems = 1 + + r.AddSingletonListConversion("service_account", "service_account") r.References["network_interface.network"] = config.Reference{ TerraformName: "google_compute_network", diff --git a/config/container/config.go b/config/container/config.go index 11bc1aad9..f17f66142 100644 --- a/config/container/config.go +++ b/config/container/config.go @@ -8,6 +8,7 @@ import ( "encoding/base64" "net/url" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/crossplane/upjet/pkg/config" @@ -125,6 +126,23 @@ func Configure(p *config.Provider) { //nolint:gocyclo TerraformName: "google_compute_subnetwork", Extractor: common.PathSelfLinkExtractor, } + + gaNodePool := r.TerraformResource.Schema["node_pool"].Elem.(*schema.Resource). + Schema["node_config"].Elem.(*schema.Resource). + Schema["guest_accelerator"].Elem.(*schema.Resource) + gaNodePool.Schema["gpu_driver_installation_config"].MaxItems = 1 + gaNodePool.Schema["gpu_sharing_config"].MaxItems = 1 + + gaNodeConfig := r.TerraformResource.Schema["node_config"].Elem.(*schema.Resource). + Schema["guest_accelerator"].Elem.(*schema.Resource) + gaNodeConfig.Schema["gpu_driver_installation_config"].MaxItems = 1 + gaNodeConfig.Schema["gpu_sharing_config"].MaxItems = 1 + + r.AddSingletonListConversion("node_pool[*].node_config[*].guest_accelerator[*].gpu_sharing_config", "nodePool[*].nodeConfig[*].guestAccelerator[*].gpuSharingConfig") + r.AddSingletonListConversion("node_pool[*].node_config[*].guest_accelerator[*].gpu_driver_installation_config", "nodePool[*].nodeConfig[*].guestAccelerator[*].gpuDriverInstallationConfig") + r.AddSingletonListConversion("node_config[*].guest_accelerator[*].gpu_sharing_config", "nodeConfig[*].guestAccelerator[*].gpuSharingConfig") + r.AddSingletonListConversion("node_config[*].guest_accelerator[*].gpu_driver_installation_config", "nodeConfig[*].guestAccelerator[*].gpuDriverInstallationConfig") + config.MarkAsRequired(r.TerraformResource, "location") }) @@ -140,6 +158,14 @@ func Configure(p *config.Provider) { //nolint:gocyclo Extractor: common.ExtractResourceIDFuncPath, } + gaNodeConfig := r.TerraformResource.Schema["node_config"].Elem.(*schema.Resource). + Schema["guest_accelerator"].Elem.(*schema.Resource) + gaNodeConfig.Schema["gpu_driver_installation_config"].MaxItems = 1 + gaNodeConfig.Schema["gpu_sharing_config"].MaxItems = 1 + + r.AddSingletonListConversion("node_config[*].guest_accelerator[*].gpu_sharing_config", "nodeConfig[*].guestAccelerator[*].gpuSharingConfig") + r.AddSingletonListConversion("node_config[*].guest_accelerator[*].gpu_driver_installation_config", "nodeConfig[*].guestAccelerator[*].gpuDriverInstallationConfig") + r.TerraformCustomDiff = func(diff *terraform.InstanceDiff, _ *terraform.InstanceState, _ *terraform.ResourceConfig) (*terraform.InstanceDiff, error) { if diff == nil || diff.Destroy { return diff, nil diff --git a/config/kms/config.go b/config/kms/config.go index 082c08dc3..eebf01cef 100644 --- a/config/kms/config.go +++ b/config/kms/config.go @@ -5,9 +5,12 @@ package kms import ( - "github.com/upbound/provider-gcp/config/common" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/crossplane/upjet/pkg/config" + "github.com/crossplane/upjet/pkg/config/conversion" + + "github.com/upbound/provider-gcp/config/common" ) // Configure configures individual resources by adding custom @@ -40,4 +43,23 @@ func Configure(p *config.Provider) { r.TerraformResource.Schema["plaintext"].Sensitive = false }) + p.AddResourceConfigurator("google_kms_crypto_key_version", func(r *config.Resource) { + attestation := r.TerraformResource.Schema["attestation"].Elem.(*schema.Resource) + attestation.Schema["cert_chains"].MaxItems = 1 + attestation.Schema["external_protection_level_options"].MaxItems = 1 + + r.Version = "v1beta2" + r.PreviousVersions = []string{common.VersionV1Beta1} + // we would like to set the storage version to v1beta1 to facilitate + // downgrades. + r.SetCRDStorageVersion("v1beta1") + r.ControllerReconcileVersion = "v1beta1" + r.Conversions = []conversion.Conversion{ + conversion.NewIdentityConversionExpandPaths(conversion.AllVersions, conversion.AllVersions, conversion.DefaultPathPrefixes(), r.CRDListConversionPaths()...), + conversion.NewSingletonListConversion("v1beta1", "v1beta2", conversion.DefaultPathPrefixes(), r.CRDListConversionPaths(), conversion.ToEmbeddedObject), + conversion.NewSingletonListConversion("v1beta2", "v1beta1", conversion.DefaultPathPrefixes(), r.CRDListConversionPaths(), conversion.ToSingletonList)} + + r.AddSingletonListConversion("attestation[*].cert_chains", "attestation[*].certChains") + r.AddSingletonListConversion("attestation[*].external_protection_level_options", "attestation[*].externalProtectionLevelOptions") + }) } diff --git a/examples-generated/kms/v1beta2/cryptokeyversion.yaml b/examples-generated/kms/v1beta2/cryptokeyversion.yaml new file mode 100644 index 000000000..4718882d9 --- /dev/null +++ b/examples-generated/kms/v1beta2/cryptokeyversion.yaml @@ -0,0 +1,44 @@ +apiVersion: kms.gcp.upbound.io/v1beta2 +kind: CryptoKeyVersion +metadata: + annotations: + meta.upbound.io/example-id: kms/v1beta2/cryptokeyversion + labels: + testing.upbound.io/example-name: example-key + name: example-key +spec: + forProvider: + cryptoKeySelector: + matchLabels: + testing.upbound.io/example-name: cryptokey + +--- + +apiVersion: kms.gcp.upbound.io/v1beta2 +kind: CryptoKey +metadata: + annotations: + meta.upbound.io/example-id: kms/v1beta2/cryptokeyversion + labels: + testing.upbound.io/example-name: cryptokey + name: cryptokey +spec: + forProvider: + keyRingSelector: + matchLabels: + testing.upbound.io/example-name: keyring + rotationPeriod: 7776000s + +--- + +apiVersion: kms.gcp.upbound.io/v1beta1 +kind: KeyRing +metadata: + annotations: + meta.upbound.io/example-id: kms/v1beta2/cryptokeyversion + labels: + testing.upbound.io/example-name: keyring + name: keyring +spec: + forProvider: + location: global diff --git a/examples/composer/v1beta2/environment.yaml b/examples/composer/v1beta2/environment.yaml new file mode 100644 index 000000000..fab3300c5 --- /dev/null +++ b/examples/composer/v1beta2/environment.yaml @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: 2024 The Crossplane Authors +# +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: composer.gcp.upbound.io/v1beta2 +kind: Environment +metadata: + annotations: + meta.upbound.io/example-id: composer/v1beta2/environment + labels: + testing.upbound.io/example-name: composer-environment + name: composer-environment +spec: + forProvider: + region: us-east1 diff --git a/examples/compute/v1beta2/instancefromtemplate.yaml b/examples/compute/v1beta2/instancefromtemplate.yaml new file mode 100644 index 000000000..508afa34b --- /dev/null +++ b/examples/compute/v1beta2/instancefromtemplate.yaml @@ -0,0 +1,52 @@ +# SPDX-FileCopyrightText: 2024 The Crossplane Authors +# +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: compute.gcp.upbound.io/v1beta2 +kind: InstanceFromTemplate +metadata: + annotations: + meta.upbound.io/example-id: compute/v1beta2/instancefromtemplate + labels: + testing.upbound.io/example-name: instance-from-template + name: instance-from-template +spec: + forProvider: + name: instance-from-template + sourceInstanceTemplateSelector: + matchLabels: + testing.upbound.io/example-name: instance-from-template + zone: us-central1-a + +--- + +apiVersion: compute.gcp.upbound.io/v1beta2 +kind: InstanceTemplate +metadata: + annotations: + meta.upbound.io/example-id: compute/v1beta2/instancefromtemplate + labels: + testing.upbound.io/example-name: instance-from-template + name: instance-from-template +spec: + forProvider: + canIpForward: false + description: This template is used to create app server instances. + disk: + - autoDelete: false + boot: true + sourceImage: debian-cloud/debian-11 + instanceDescription: description assigned to instances + labels: + environment: dev + machineType: e2-medium + metadata: + environment: dev + networkInterface: + - network: default + scheduling: + automaticRestart: true + onHostMaintenance: MIGRATE + tags: + - foo + - bar diff --git a/package/crds/composer.gcp.upbound.io_environments.yaml b/package/crds/composer.gcp.upbound.io_environments.yaml index 71bdcbd23..ab75d37a5 100644 --- a/package/crds/composer.gcp.upbound.io_environments.yaml +++ b/package/crds/composer.gcp.upbound.io_environments.yaml @@ -2815,47 +2815,45 @@ spec: Configuration for controlling how IPs are allocated in the GKE cluster. Structure is documented below. Cannot be updated. - items: - properties: - clusterIpv4CidrBlock: - description: |- - The IP address range used to allocate IP addresses to pods in the cluster. - For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. - Set to blank to have GKE choose a range with the default size. - Set to /netmask (e.g. /14) to have GKE choose a range with a specific netmask. - Set to a CIDR notation (e.g. 10.96.0.0/14) from the RFC-1918 private networks - (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. - Specify either cluster_secondary_range_name or cluster_ipv4_cidr_block but not both. - type: string - clusterSecondaryRangeName: - description: |- - The name of the cluster's secondary range used to allocate IP addresses to pods. - Specify either cluster_secondary_range_name or cluster_ipv4_cidr_block but not both. - For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. - type: string - servicesIpv4CidrBlock: - description: |- - The IP address range used to allocate IP addresses in this cluster. - For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. - Set to blank to have GKE choose a range with the default size. - Set to /netmask (e.g. /14) to have GKE choose a range with a specific netmask. - Set to a CIDR notation (e.g. 10.96.0.0/14) from the RFC-1918 private networks - (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. - Specify either services_secondary_range_name or services_ipv4_cidr_block but not both. - type: string - servicesSecondaryRangeName: - description: |- - The name of the services' secondary range used to allocate IP addresses to the cluster. - Specify either services_secondary_range_name or services_ipv4_cidr_block but not both. - For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. - type: string - useIpAliases: - description: |- - Whether or not to enable Alias IPs in the GKE cluster. If true, a VPC-native cluster is created. - Defaults to true if the ip_allocation_policy block is present in config. - type: boolean - type: object - type: array + properties: + clusterIpv4CidrBlock: + description: |- + The IP address range used to allocate IP addresses to pods in the cluster. + For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. + Set to blank to have GKE choose a range with the default size. + Set to /netmask (e.g. /14) to have GKE choose a range with a specific netmask. + Set to a CIDR notation (e.g. 10.96.0.0/14) from the RFC-1918 private networks + (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. + Specify either cluster_secondary_range_name or cluster_ipv4_cidr_block but not both. + type: string + clusterSecondaryRangeName: + description: |- + The name of the cluster's secondary range used to allocate IP addresses to pods. + Specify either cluster_secondary_range_name or cluster_ipv4_cidr_block but not both. + For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. + type: string + servicesIpv4CidrBlock: + description: |- + The IP address range used to allocate IP addresses in this cluster. + For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. + Set to blank to have GKE choose a range with the default size. + Set to /netmask (e.g. /14) to have GKE choose a range with a specific netmask. + Set to a CIDR notation (e.g. 10.96.0.0/14) from the RFC-1918 private networks + (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. + Specify either services_secondary_range_name or services_ipv4_cidr_block but not both. + type: string + servicesSecondaryRangeName: + description: |- + The name of the services' secondary range used to allocate IP addresses to the cluster. + Specify either services_secondary_range_name or services_ipv4_cidr_block but not both. + For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. + type: string + useIpAliases: + description: |- + Whether or not to enable Alias IPs in the GKE cluster. If true, a VPC-native cluster is created. + Defaults to true if the ip_allocation_policy block is present in config. + type: boolean + type: object machineType: description: |- Machine type on which Airflow web server is running. It has to be one of: composer-n1-webserver-2, @@ -3650,47 +3648,45 @@ spec: Configuration for controlling how IPs are allocated in the GKE cluster. Structure is documented below. Cannot be updated. - items: - properties: - clusterIpv4CidrBlock: - description: |- - The IP address range used to allocate IP addresses to pods in the cluster. - For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. - Set to blank to have GKE choose a range with the default size. - Set to /netmask (e.g. /14) to have GKE choose a range with a specific netmask. - Set to a CIDR notation (e.g. 10.96.0.0/14) from the RFC-1918 private networks - (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. - Specify either cluster_secondary_range_name or cluster_ipv4_cidr_block but not both. - type: string - clusterSecondaryRangeName: - description: |- - The name of the cluster's secondary range used to allocate IP addresses to pods. - Specify either cluster_secondary_range_name or cluster_ipv4_cidr_block but not both. - For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. - type: string - servicesIpv4CidrBlock: - description: |- - The IP address range used to allocate IP addresses in this cluster. - For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. - Set to blank to have GKE choose a range with the default size. - Set to /netmask (e.g. /14) to have GKE choose a range with a specific netmask. - Set to a CIDR notation (e.g. 10.96.0.0/14) from the RFC-1918 private networks - (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. - Specify either services_secondary_range_name or services_ipv4_cidr_block but not both. - type: string - servicesSecondaryRangeName: - description: |- - The name of the services' secondary range used to allocate IP addresses to the cluster. - Specify either services_secondary_range_name or services_ipv4_cidr_block but not both. - For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. - type: string - useIpAliases: - description: |- - Whether or not to enable Alias IPs in the GKE cluster. If true, a VPC-native cluster is created. - Defaults to true if the ip_allocation_policy block is present in config. - type: boolean - type: object - type: array + properties: + clusterIpv4CidrBlock: + description: |- + The IP address range used to allocate IP addresses to pods in the cluster. + For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. + Set to blank to have GKE choose a range with the default size. + Set to /netmask (e.g. /14) to have GKE choose a range with a specific netmask. + Set to a CIDR notation (e.g. 10.96.0.0/14) from the RFC-1918 private networks + (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. + Specify either cluster_secondary_range_name or cluster_ipv4_cidr_block but not both. + type: string + clusterSecondaryRangeName: + description: |- + The name of the cluster's secondary range used to allocate IP addresses to pods. + Specify either cluster_secondary_range_name or cluster_ipv4_cidr_block but not both. + For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. + type: string + servicesIpv4CidrBlock: + description: |- + The IP address range used to allocate IP addresses in this cluster. + For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. + Set to blank to have GKE choose a range with the default size. + Set to /netmask (e.g. /14) to have GKE choose a range with a specific netmask. + Set to a CIDR notation (e.g. 10.96.0.0/14) from the RFC-1918 private networks + (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. + Specify either services_secondary_range_name or services_ipv4_cidr_block but not both. + type: string + servicesSecondaryRangeName: + description: |- + The name of the services' secondary range used to allocate IP addresses to the cluster. + Specify either services_secondary_range_name or services_ipv4_cidr_block but not both. + For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. + type: string + useIpAliases: + description: |- + Whether or not to enable Alias IPs in the GKE cluster. If true, a VPC-native cluster is created. + Defaults to true if the ip_allocation_policy block is present in config. + type: boolean + type: object machineType: description: |- Machine type on which Airflow web server is running. It has to be one of: composer-n1-webserver-2, @@ -4656,47 +4652,45 @@ spec: Configuration for controlling how IPs are allocated in the GKE cluster. Structure is documented below. Cannot be updated. - items: - properties: - clusterIpv4CidrBlock: - description: |- - The IP address range used to allocate IP addresses to pods in the cluster. - For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. - Set to blank to have GKE choose a range with the default size. - Set to /netmask (e.g. /14) to have GKE choose a range with a specific netmask. - Set to a CIDR notation (e.g. 10.96.0.0/14) from the RFC-1918 private networks - (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. - Specify either cluster_secondary_range_name or cluster_ipv4_cidr_block but not both. - type: string - clusterSecondaryRangeName: - description: |- - The name of the cluster's secondary range used to allocate IP addresses to pods. - Specify either cluster_secondary_range_name or cluster_ipv4_cidr_block but not both. - For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. - type: string - servicesIpv4CidrBlock: - description: |- - The IP address range used to allocate IP addresses in this cluster. - For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. - Set to blank to have GKE choose a range with the default size. - Set to /netmask (e.g. /14) to have GKE choose a range with a specific netmask. - Set to a CIDR notation (e.g. 10.96.0.0/14) from the RFC-1918 private networks - (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. - Specify either services_secondary_range_name or services_ipv4_cidr_block but not both. - type: string - servicesSecondaryRangeName: - description: |- - The name of the services' secondary range used to allocate IP addresses to the cluster. - Specify either services_secondary_range_name or services_ipv4_cidr_block but not both. - For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. - type: string - useIpAliases: - description: |- - Whether or not to enable Alias IPs in the GKE cluster. If true, a VPC-native cluster is created. - Defaults to true if the ip_allocation_policy block is present in config. - type: boolean - type: object - type: array + properties: + clusterIpv4CidrBlock: + description: |- + The IP address range used to allocate IP addresses to pods in the cluster. + For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. + Set to blank to have GKE choose a range with the default size. + Set to /netmask (e.g. /14) to have GKE choose a range with a specific netmask. + Set to a CIDR notation (e.g. 10.96.0.0/14) from the RFC-1918 private networks + (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. + Specify either cluster_secondary_range_name or cluster_ipv4_cidr_block but not both. + type: string + clusterSecondaryRangeName: + description: |- + The name of the cluster's secondary range used to allocate IP addresses to pods. + Specify either cluster_secondary_range_name or cluster_ipv4_cidr_block but not both. + For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. + type: string + servicesIpv4CidrBlock: + description: |- + The IP address range used to allocate IP addresses in this cluster. + For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. + Set to blank to have GKE choose a range with the default size. + Set to /netmask (e.g. /14) to have GKE choose a range with a specific netmask. + Set to a CIDR notation (e.g. 10.96.0.0/14) from the RFC-1918 private networks + (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. + Specify either services_secondary_range_name or services_ipv4_cidr_block but not both. + type: string + servicesSecondaryRangeName: + description: |- + The name of the services' secondary range used to allocate IP addresses to the cluster. + Specify either services_secondary_range_name or services_ipv4_cidr_block but not both. + For Cloud Composer 1 environments, this field is applicable only when use_ip_aliases is true. + type: string + useIpAliases: + description: |- + Whether or not to enable Alias IPs in the GKE cluster. If true, a VPC-native cluster is created. + Defaults to true if the ip_allocation_policy block is present in config. + type: boolean + type: object machineType: description: |- Machine type on which Airflow web server is running. It has to be one of: composer-n1-webserver-2, diff --git a/package/crds/compute.gcp.upbound.io_instancefromtemplates.yaml b/package/crds/compute.gcp.upbound.io_instancefromtemplates.yaml index ef3d88eda..a4ec90053 100644 --- a/package/crds/compute.gcp.upbound.io_instancefromtemplates.yaml +++ b/package/crds/compute.gcp.upbound.io_instancefromtemplates.yaml @@ -2340,17 +2340,15 @@ spec: type: object type: array serviceAccount: - items: - properties: - email: + properties: + email: + type: string + scopes: + items: type: string - scopes: - items: - type: string - type: array - x-kubernetes-list-type: set - type: object - type: array + type: array + x-kubernetes-list-type: set + type: object shieldedInstanceConfig: properties: enableIntegrityMonitoring: @@ -2894,17 +2892,15 @@ spec: type: object type: array serviceAccount: - items: - properties: - email: + properties: + email: + type: string + scopes: + items: type: string - scopes: - items: - type: string - type: array - x-kubernetes-list-type: set - type: object - type: array + type: array + x-kubernetes-list-type: set + type: object shieldedInstanceConfig: properties: enableIntegrityMonitoring: @@ -3489,17 +3485,15 @@ spec: selfLink: type: string serviceAccount: - items: - properties: - email: + properties: + email: + type: string + scopes: + items: type: string - scopes: - items: - type: string - type: array - x-kubernetes-list-type: set - type: object - type: array + type: array + x-kubernetes-list-type: set + type: object shieldedInstanceConfig: properties: enableIntegrityMonitoring: diff --git a/package/crds/container.gcp.upbound.io_clusters.yaml b/package/crds/container.gcp.upbound.io_clusters.yaml index 1409db33a..ea8bb7231 100644 --- a/package/crds/container.gcp.upbound.io_clusters.yaml +++ b/package/crds/container.gcp.upbound.io_clusters.yaml @@ -7374,15 +7374,13 @@ spec: gpuDriverInstallationConfig: description: Configuration for auto installation of GPU driver. Structure is documented below. - items: - properties: - gpuDriverVersion: - description: |- - Mode for how the GPU driver is installed. - Accepted values are: - type: string - type: object - type: array + properties: + gpuDriverVersion: + description: |- + Mode for how the GPU driver is installed. + Accepted values are: + type: string + type: object gpuPartitionSize: description: Size of partitions to create on the GPU. Valid values are described in the NVIDIA mig user @@ -7391,19 +7389,17 @@ spec: gpuSharingConfig: description: Configuration for GPU sharing. Structure is documented below. - items: - properties: - gpuSharingStrategy: - description: |- - The type of GPU sharing strategy to enable on the GPU node. - Accepted values are: - type: string - maxSharedClientsPerGpu: - description: The maximum number of containers - that can share a GPU. - type: number - type: object - type: array + properties: + gpuSharingStrategy: + description: |- + The type of GPU sharing strategy to enable on the GPU node. + Accepted values are: + type: string + maxSharedClientsPerGpu: + description: The maximum number of containers that + can share a GPU. + type: number + type: object type: description: The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80. @@ -9042,15 +9038,13 @@ spec: gpuDriverInstallationConfig: description: Configuration for auto installation of GPU driver. Structure is documented below. - items: - properties: - gpuDriverVersion: - description: |- - Mode for how the GPU driver is installed. - Accepted values are: - type: string - type: object - type: array + properties: + gpuDriverVersion: + description: |- + Mode for how the GPU driver is installed. + Accepted values are: + type: string + type: object gpuPartitionSize: description: Size of partitions to create on the GPU. Valid values are described in the NVIDIA mig user @@ -9059,19 +9053,17 @@ spec: gpuSharingConfig: description: Configuration for GPU sharing. Structure is documented below. - items: - properties: - gpuSharingStrategy: - description: |- - The type of GPU sharing strategy to enable on the GPU node. - Accepted values are: - type: string - maxSharedClientsPerGpu: - description: The maximum number of containers - that can share a GPU. - type: number - type: object - type: array + properties: + gpuSharingStrategy: + description: |- + The type of GPU sharing strategy to enable on the GPU node. + Accepted values are: + type: string + maxSharedClientsPerGpu: + description: The maximum number of containers that + can share a GPU. + type: number + type: object type: description: The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80. @@ -10879,15 +10871,13 @@ spec: gpuDriverInstallationConfig: description: Configuration for auto installation of GPU driver. Structure is documented below. - items: - properties: - gpuDriverVersion: - description: |- - Mode for how the GPU driver is installed. - Accepted values are: - type: string - type: object - type: array + properties: + gpuDriverVersion: + description: |- + Mode for how the GPU driver is installed. + Accepted values are: + type: string + type: object gpuPartitionSize: description: Size of partitions to create on the GPU. Valid values are described in the NVIDIA mig user @@ -10896,19 +10886,17 @@ spec: gpuSharingConfig: description: Configuration for GPU sharing. Structure is documented below. - items: - properties: - gpuSharingStrategy: - description: |- - The type of GPU sharing strategy to enable on the GPU node. - Accepted values are: - type: string - maxSharedClientsPerGpu: - description: The maximum number of containers - that can share a GPU. - type: number - type: object - type: array + properties: + gpuSharingStrategy: + description: |- + The type of GPU sharing strategy to enable on the GPU node. + Accepted values are: + type: string + maxSharedClientsPerGpu: + description: The maximum number of containers that + can share a GPU. + type: number + type: object type: description: The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80. @@ -11404,15 +11392,13 @@ spec: gpuDriverInstallationConfig: description: Configuration for auto installation of GPU driver. Structure is documented below. - items: - properties: - gpuDriverVersion: - description: |- - Mode for how the GPU driver is installed. - Accepted values are: - type: string - type: object - type: array + properties: + gpuDriverVersion: + description: |- + Mode for how the GPU driver is installed. + Accepted values are: + type: string + type: object gpuPartitionSize: description: Size of partitions to create on the GPU. Valid values are described in the NVIDIA @@ -11421,19 +11407,17 @@ spec: gpuSharingConfig: description: Configuration for GPU sharing. Structure is documented below. - items: - properties: - gpuSharingStrategy: - description: |- - The type of GPU sharing strategy to enable on the GPU node. - Accepted values are: - type: string - maxSharedClientsPerGpu: - description: The maximum number of containers - that can share a GPU. - type: number - type: object - type: array + properties: + gpuSharingStrategy: + description: |- + The type of GPU sharing strategy to enable on the GPU node. + Accepted values are: + type: string + maxSharedClientsPerGpu: + description: The maximum number of containers + that can share a GPU. + type: number + type: object type: description: The accelerator type resource to expose to this instance. E.g. nvidia-tesla-k80. diff --git a/package/crds/container.gcp.upbound.io_nodepools.yaml b/package/crds/container.gcp.upbound.io_nodepools.yaml index 342557feb..c5325169c 100644 --- a/package/crds/container.gcp.upbound.io_nodepools.yaml +++ b/package/crds/container.gcp.upbound.io_nodepools.yaml @@ -2317,27 +2317,23 @@ spec: count: type: number gpuDriverInstallationConfig: - items: - properties: - gpuDriverVersion: - description: |- - The Kubernetes version for the nodes in this pool. Note that if this field - and auto_upgrade are both specified, they will fight each other for what the node version should - be, so setting both is highly discouraged. - type: string - type: object - type: array + properties: + gpuDriverVersion: + description: |- + The Kubernetes version for the nodes in this pool. Note that if this field + and auto_upgrade are both specified, they will fight each other for what the node version should + be, so setting both is highly discouraged. + type: string + type: object gpuPartitionSize: type: string gpuSharingConfig: - items: - properties: - gpuSharingStrategy: - type: string - maxSharedClientsPerGpu: - type: number - type: object - type: array + properties: + gpuSharingStrategy: + type: string + maxSharedClientsPerGpu: + type: number + type: object type: description: |- The type of the policy. Supports a single value: COMPACT. @@ -2827,27 +2823,23 @@ spec: count: type: number gpuDriverInstallationConfig: - items: - properties: - gpuDriverVersion: - description: |- - The Kubernetes version for the nodes in this pool. Note that if this field - and auto_upgrade are both specified, they will fight each other for what the node version should - be, so setting both is highly discouraged. - type: string - type: object - type: array + properties: + gpuDriverVersion: + description: |- + The Kubernetes version for the nodes in this pool. Note that if this field + and auto_upgrade are both specified, they will fight each other for what the node version should + be, so setting both is highly discouraged. + type: string + type: object gpuPartitionSize: type: string gpuSharingConfig: - items: - properties: - gpuSharingStrategy: - type: string - maxSharedClientsPerGpu: - type: number - type: object - type: array + properties: + gpuSharingStrategy: + type: string + maxSharedClientsPerGpu: + type: number + type: object type: description: |- The type of the policy. Supports a single value: COMPACT. @@ -3531,27 +3523,23 @@ spec: count: type: number gpuDriverInstallationConfig: - items: - properties: - gpuDriverVersion: - description: |- - The Kubernetes version for the nodes in this pool. Note that if this field - and auto_upgrade are both specified, they will fight each other for what the node version should - be, so setting both is highly discouraged. - type: string - type: object - type: array + properties: + gpuDriverVersion: + description: |- + The Kubernetes version for the nodes in this pool. Note that if this field + and auto_upgrade are both specified, they will fight each other for what the node version should + be, so setting both is highly discouraged. + type: string + type: object gpuPartitionSize: type: string gpuSharingConfig: - items: - properties: - gpuSharingStrategy: - type: string - maxSharedClientsPerGpu: - type: number - type: object - type: array + properties: + gpuSharingStrategy: + type: string + maxSharedClientsPerGpu: + type: number + type: object type: description: |- The type of the policy. Supports a single value: COMPACT. diff --git a/package/crds/kms.gcp.upbound.io_cryptokeyversions.yaml b/package/crds/kms.gcp.upbound.io_cryptokeyversions.yaml index f025c59d2..5a02e2ef1 100644 --- a/package/crds/kms.gcp.upbound.io_cryptokeyversions.yaml +++ b/package/crds/kms.gcp.upbound.io_cryptokeyversions.yaml @@ -574,3 +574,555 @@ spec: storage: true subresources: status: {} + - 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: v1beta2 + schema: + openAPIV3Schema: + description: CryptoKeyVersion is the Schema for the CryptoKeyVersions API. + A + 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: CryptoKeyVersionSpec defines the desired state of CryptoKeyVersion + 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: + cryptoKey: + description: |- + The name of the cryptoKey associated with the CryptoKeyVersions. + Format: 'projects/{{project}}/locations/{{location}}/keyRings/{{keyring}}/cryptoKeys/{{cryptoKey}}' + type: string + cryptoKeyRef: + description: Reference to a CryptoKey in kms to populate cryptoKey. + 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 + cryptoKeySelector: + description: Selector for a CryptoKey in kms to populate cryptoKey. + 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 + state: + description: |- + The current state of the CryptoKeyVersion. + Possible values are: PENDING_GENERATION, ENABLED, DISABLED, DESTROYED, DESTROY_SCHEDULED, PENDING_IMPORT, IMPORT_FAILED. + type: string + 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: + cryptoKey: + description: |- + The name of the cryptoKey associated with the CryptoKeyVersions. + Format: 'projects/{{project}}/locations/{{location}}/keyRings/{{keyring}}/cryptoKeys/{{cryptoKey}}' + type: string + cryptoKeyRef: + description: Reference to a CryptoKey in kms to populate cryptoKey. + 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 + cryptoKeySelector: + description: Selector for a CryptoKey in kms to populate cryptoKey. + 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 + state: + description: |- + The current state of the CryptoKeyVersion. + Possible values are: PENDING_GENERATION, ENABLED, DISABLED, DESTROYED, DESTROY_SCHEDULED, PENDING_IMPORT, IMPORT_FAILED. + type: string + 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 + status: + description: CryptoKeyVersionStatus defines the observed state of CryptoKeyVersion. + properties: + atProvider: + properties: + algorithm: + description: The CryptoKeyVersionAlgorithm that this CryptoKeyVersion + supports. + type: string + attestation: + description: |- + Statement that was generated and signed by the HSM at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. + Only provided for key versions with protectionLevel HSM. + Structure is documented below. + items: + properties: + certChains: + description: |- + The certificate chains needed to validate the attestation + Structure is documented below. + properties: + caviumCerts: + description: Cavium certificate chain corresponding + to the attestation. + type: string + googleCardCerts: + description: Google card certificate chain corresponding + to the attestation. + type: string + googlePartitionCerts: + description: Google partition certificate chain corresponding + to the attestation. + type: string + type: object + content: + description: |- + (Output) + The attestation data provided by the HSM when the key operation was performed. + type: string + externalProtectionLevelOptions: + description: |- + ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels. + Structure is documented below. + properties: + ekmConnectionKeyPath: + description: The path to the external key material on + the EKM when using EkmConnection e.g., "v0/my/key". + Set this field instead of externalKeyUri when using + an EkmConnection. + type: string + externalKeyUri: + description: The URI for an external resource that this + CryptoKeyVersion represents. + type: string + type: object + format: + description: |- + (Output) + The format of the attestation data. + type: string + type: object + type: array + cryptoKey: + description: |- + The name of the cryptoKey associated with the CryptoKeyVersions. + Format: 'projects/{{project}}/locations/{{location}}/keyRings/{{keyring}}/cryptoKeys/{{cryptoKey}}' + type: string + generateTime: + description: The time this CryptoKeyVersion key material was generated + type: string + id: + description: an identifier for the resource with format {{name}} + type: string + name: + description: The resource name for this CryptoKeyVersion. + type: string + protectionLevel: + description: The ProtectionLevel describing how crypto operations + are performed with this CryptoKeyVersion. + type: string + state: + description: |- + The current state of the CryptoKeyVersion. + Possible values are: PENDING_GENERATION, ENABLED, DISABLED, DESTROYED, DESTROY_SCHEDULED, PENDING_IMPORT, IMPORT_FAILED. + type: string + 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: false + subresources: + status: {}