Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make ResourceID field "mutable" #3434

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions apis/bigquerydatatransfer/v1alpha1/config_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ type BigQueryDataTransferConfigSpec struct {

Parent `json:",inline"`

// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable"
// Immutable.
// The BigQueryDataTransferConfig name. If not given, the metadata.name will be used.
// Cannot be changed after create, except for updating from empty string to the actual resource ID.
ResourceID *string `json:"resourceID,omitempty"`

// Data transfer schedule.
Expand Down
3 changes: 1 addition & 2 deletions apis/bigquerydatatransfer/v1beta1/transferconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ type BigQueryDataTransferConfigSpec struct {

Parent `json:",inline"`

// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable"
// Immutable.
// The BigQueryDataTransferConfig name. If not given, the metadata.name will be used.
// Cannot be changed after create, except for updating from empty string to the actual resource ID.
ResourceID *string `json:"resourceID,omitempty"`

// Data transfer schedule.
Expand Down
4 changes: 2 additions & 2 deletions apis/certificatemanager/v1alpha1/dnsauthorization_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ type CertificateManagerDNSAuthorizationSpec struct {
// +required
ProjectRef refs.ProjectRef `json:"projectRef"`

// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable"
/* Immutable. Optional. The name of the resource. Used for creation and acquisition. When unset, the value of `metadata.name` is used as the default. */
/* Optional. The name of the resource. Used for creation and acquisition. When unset, the value of `metadata.name` is used as the default. */
// Cannot be changed after create, except for updating from empty string to the actual resource ID.
// +optional
ResourceID *string `json:"resourceID,omitempty"`
}
Expand Down
4 changes: 2 additions & 2 deletions apis/certificatemanager/v1beta1/dnsauthorization_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ type CertificateManagerDNSAuthorizationSpec struct {
// +optional
Location string `json:"location"`

// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable"
/* Immutable. Optional. The name of the resource. Used for creation and acquisition. When unset, the value of `metadata.name` is used as the default. */
/* Optional. The name of the resource. Used for creation and acquisition. When unset, the value of `metadata.name` is used as the default. */
// Cannot be changed after create, except for updating from empty string to the actual resource ID.
// +optional
ResourceID *string `json:"resourceID,omitempty"`
}
Expand Down
4 changes: 2 additions & 2 deletions apis/compute/v1beta1/targettcpproxy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ type ComputeTargetTCPProxySpec struct {
// the backend. Default value: "NONE" Possible values: ["NONE", "PROXY_V1"].
ProxyHeader *string `json:"proxyHeader,omitempty"`

// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID is immutable"
// Immutable. The ComputeTargetTCPProxy name. If not given, the metadata.name will be used.
// The ComputeTargetTCPProxy name. If not given, the metadata.name will be used.
// Cannot be changed after create, except for updating from empty string to the actual resource ID.
ResourceID *string `json:"resourceID,omitempty"`
}

Expand Down
4 changes: 2 additions & 2 deletions apis/containerattached/v1beta1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ type ContainerAttachedClusterSpec struct {
/* The ID of the project in which the resource belongs.*/
ProjectRef *refs.ProjectRef `json:"projectRef"`

// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable"
// Immutable, Optional.
// Optional.
// The ContainerAttachedCluster name. If not given, the metadata.name will be used.
// Cannot be changed after create, except for updating from empty string to the actual resource ID.
ResourceID *string `json:"resourceID,omitempty"`

// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Location field is immutable"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ var DiscoveryEngineDataStoreGVK = GroupVersion.WithKind("DiscoveryEngineDataStor
// DiscoveryEngineDataStoreSpec defines the desired state of DiscoveryEngineDataStore
// +kcc:proto=google.cloud.discoveryengine.v1.DataStore
type DiscoveryEngineDataStoreSpec struct {
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable"
// Immutable.
// The DiscoveryEngineDataStore name. If not given, the metadata.name will be used.
// Cannot be changed after create, except for updating from empty string to the actual resource ID.
ResourceID *string `json:"resourceID,omitempty"`

// Required. The data store display name.
Expand Down
3 changes: 1 addition & 2 deletions apis/kms/v1alpha1/keyhandle_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ var KMSKeyHandleGVK = GroupVersion.WithKind("KMSKeyHandle")
// KMSKeyHandleSpec defines the desired state of KMSKeyHandle
// +kcc:proto=google.cloud.kms.v1.KeyHandle
type KMSKeyHandleSpec struct {
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable"
// Immutable.
// The KMS Key Handle ID used for resource creation or acquisition.
// For creation: If specified, this value is used as the key handle ID. If not provided, a UUID will be generated and assigned as the key handle ID.
// For acquisition: This field must be provided to identify the key handle resource to acquire.
// Cannot be changed after create, except for updating from empty string to the actual resource ID.
ResourceID *string `json:"resourceID,omitempty"`

// Project hosting KMSKeyHandle
Expand Down
3 changes: 1 addition & 2 deletions apis/kms/v1beta1/keyhandle_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ var KMSKeyHandleGVK = SchemeGroupVersion.WithKind("KMSKeyHandle")
// KMSKeyHandleSpec defines the desired state of KMSKeyHandle
// +kcc:proto=google.cloud.kms.v1.KeyHandle
type KMSKeyHandleSpec struct {
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable"
// Immutable.
// The KMS Key Handle ID used for resource creation or acquisition.
// For creation: If specified, this value is used as the key handle ID. If not provided, a UUID will be generated and assigned as the key handle ID.
// For acquisition: This field must be provided to identify the key handle resource to acquire.
// Cannot be changed after create, except for updating from empty string to the actual resource ID.
ResourceID *string `json:"resourceID,omitempty"`

// Project hosting KMSKeyHandle
Expand Down
3 changes: 1 addition & 2 deletions apis/privilegedaccessmanager/v1alpha1/entitlement_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ type PrivilegedAccessManagerEntitlementSpec struct {
// +required
Location *string `json:"location"`

// Immutable.
// The PrivilegedAccessManagerEntitlement name. If not given, the
// 'metadata.name' will be used.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable"
// Cannot be changed after create, except for updating from empty string to the actual resource ID.
// +optional
ResourceID *string `json:"resourceID,omitempty"`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type PrivilegedAccessManagerEntitlementSpec struct {
// Immutable.
// The PrivilegedAccessManagerEntitlement name. If not given, the
// 'metadata.name' will be used.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable"
// Cannot be changed after create, except for updating from empty string to the actual resource ID.
// +optional
ResourceID *string `json:"resourceID,omitempty"`

Expand Down
3 changes: 1 addition & 2 deletions apis/secretmanager/v1beta1/secret_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ var SecretManagerSecretGVK = GroupVersion.WithKind("SecretManagerSecret")
// SecretManagerSecretSpec defines the desired state of SecretManagerSecret
// +kcc:proto=google.cloud.secretmanager.v1.Secret
type SecretManagerSecretSpec struct {
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable"
// Immutable.
// The SecretManagerSecret name. If not given, the metadata.name will be used.
// Cannot be changed after create, except for updating from empty string to the actual resource ID.
ResourceID *string `json:"resourceID,omitempty"`

// Optional. Immutable. The replication policy of the secret data attached to
Expand Down
3 changes: 1 addition & 2 deletions apis/securesourcemanager/v1alpha1/repository_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ type SecureSourceManagerRepositorySpec struct {
// +required
Location string `json:"location"`

// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable"
// Immutable.
// The SecureSourceManagerRepository name. If not given, the metadata.name will be used.
// Cannot be changed after create, except for updating from empty string to the actual resource ID.
ResourceID *string `json:"resourceID,omitempty"`

// The name of the instance in which the repository is hosted, formatted as
Expand Down
3 changes: 1 addition & 2 deletions apis/spanner/v1beta1/instance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ type SpannerInstanceSpec struct {
// +optional
ProcessingUnits *int32 `json:"processingUnits,omitempty"`

// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable"
// Immutable.
// The SpannerInstance name. If not given, the metadata.name will be used.
// Cannot be changed after create, except for updating from empty string to the actual resource ID.
ResourceID *string `json:"resourceID,omitempty"`
}

Expand Down
3 changes: 1 addition & 2 deletions apis/workstations/v1alpha1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ type WorkstationClusterSpec struct {
// The location of the cluster.
Location string `json:"location,omitempty"`

// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable"
// Immutable.
// The WorkstationCluster name. If not given, the metadata.name will be used.
// Cannot be changed after create, except for updating from empty string to the actual resource ID.
ResourceID *string `json:"resourceID,omitempty"`

// Optional. Human-readable name for this workstation cluster.
Expand Down
3 changes: 1 addition & 2 deletions apis/workstations/v1alpha1/config_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,8 @@ type WorkstationConfigSpec struct {
// Parent is a reference to the parent WorkstationCluster for this WorkstationConfig.
Parent *WorkstationClusterRef `json:"parentRef"`

// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable"
// Immutable.
// The WorkstationConfig name. If not given, the metadata.name will be used.
// Cannot be changed after create, except for updating from empty string to the actual resource ID.
ResourceID *string `json:"resourceID,omitempty"`

// Optional. Human-readable name for this workstation configuration.
Expand Down
3 changes: 1 addition & 2 deletions apis/workstations/v1alpha1/workstation_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ type WorkstationSpec struct {
// Parent is a reference to the parent WorkstationConfig for this Workstation.
Parent *WorkstationConfigRef `json:"parentRef"`

// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable"
// Immutable.
// The Workstation name. If not given, the metadata.name will be used.
// Cannot be changed after create, except for updating from empty string to the actual resource ID.
ResourceID *string `json:"resourceID,omitempty"`

// Optional. Human-readable name for this workstation.
Expand Down
3 changes: 1 addition & 2 deletions apis/workstations/v1beta1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ type WorkstationClusterSpec struct {
// The location of the cluster.
Location string `json:"location,omitempty"`

// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable"
// Immutable.
// The WorkstationCluster name. If not given, the metadata.name will be used.
// Cannot be changed after create, except for updating from empty string to the actual resource ID.
ResourceID *string `json:"resourceID,omitempty"`

// Optional. Human-readable name for this workstation cluster.
Expand Down
3 changes: 1 addition & 2 deletions apis/workstations/v1beta1/config_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,8 @@ type WorkstationConfigSpec struct {
// Parent is a reference to the parent WorkstationCluster for this WorkstationConfig.
Parent *WorkstationClusterRef `json:"parentRef"`

// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable"
// Immutable.
// The WorkstationConfig name. If not given, the metadata.name will be used.
// Cannot be changed after create, except for updating from empty string to the actual resource ID.
ResourceID *string `json:"resourceID,omitempty"`

// Optional. Human-readable name for this workstation configuration.
Expand Down
3 changes: 1 addition & 2 deletions apis/workstations/v1beta1/workstation_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ type WorkstationSpec struct {
// Parent is a reference to the parent WorkstationConfig for this Workstation.
Parent *WorkstationConfigRef `json:"parentRef"`

// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable"
// Immutable.
// The Workstation name. If not given, the metadata.name will be used.
// Cannot be changed after create, except for updating from empty string to the actual resource ID.
ResourceID *string `json:"resourceID,omitempty"`

// Optional. Human-readable name for this workstation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,10 @@ spec:
type: string
type: object
resourceID:
description: Immutable. The BigQueryDataTransferConfig name. If not
given, the metadata.name will be used.
description: The BigQueryDataTransferConfig name. If not given, the
metadata.name will be used. Cannot be changed after create, except
for updating from empty string to the actual resource ID.
type: string
x-kubernetes-validations:
- message: ResourceID field is immutable
rule: self == oldSelf
schedule:
description: |-
Data transfer schedule.
Expand Down Expand Up @@ -621,12 +619,10 @@ spec:
type: string
type: object
resourceID:
description: Immutable. The BigQueryDataTransferConfig name. If not
given, the metadata.name will be used.
description: The BigQueryDataTransferConfig name. If not given, the
metadata.name will be used. Cannot be changed after create, except
for updating from empty string to the actual resource ID.
type: string
x-kubernetes-validations:
- message: ResourceID field is immutable
rule: self == oldSelf
schedule:
description: |-
Data transfer schedule.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,11 @@ spec:
type: string
type: object
resourceID:
description: Immutable. Optional. The name of the resource. Used for
creation and acquisition. When unset, the value of `metadata.name`
is used as the default.
description: Optional. The name of the resource. Used for creation
and acquisition. When unset, the value of `metadata.name` is used
as the default. Cannot be changed after create, except for updating
from empty string to the actual resource ID.
type: string
x-kubernetes-validations:
- message: ResourceID field is immutable
rule: self == oldSelf
required:
- domain
- projectRef
Expand Down Expand Up @@ -270,13 +268,11 @@ spec:
type: string
type: object
resourceID:
description: Immutable. Optional. The name of the resource. Used for
creation and acquisition. When unset, the value of `metadata.name`
is used as the default.
description: Optional. The name of the resource. Used for creation
and acquisition. When unset, the value of `metadata.name` is used
as the default. Cannot be changed after create, except for updating
from empty string to the actual resource ID.
type: string
x-kubernetes-validations:
- message: ResourceID field is immutable
rule: self == oldSelf
required:
- domain
- projectRef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,10 @@ spec:
["NONE", "PROXY_V1"].'
type: string
resourceID:
description: Immutable. The ComputeTargetTCPProxy name. If not given,
the metadata.name will be used.
description: The ComputeTargetTCPProxy name. If not given, the metadata.name
will be used. Cannot be changed after create, except for updating
from empty string to the actual resource ID.
type: string
x-kubernetes-validations:
- message: ResourceID is immutable
rule: self == oldSelf
required:
- backendServiceRef
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,10 @@ spec:
type: string
type: object
resourceID:
description: Immutable, Optional. The ContainerAttachedCluster name.
If not given, the metadata.name will be used.
description: Optional. The ContainerAttachedCluster name. If not given,
the metadata.name will be used. Cannot be changed after create,
except for updating from empty string to the actual resource ID.
type: string
x-kubernetes-validations:
- message: ResourceID field is immutable
rule: self == oldSelf
required:
- distribution
- fleet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,10 @@ spec:
type: string
type: object
resourceID:
description: Immutable. The DiscoveryEngineDataStore name. If not
given, the metadata.name will be used.
description: The DiscoveryEngineDataStore name. If not given, the
metadata.name will be used. Cannot be changed after create, except
for updating from empty string to the actual resource ID.
type: string
x-kubernetes-validations:
- message: ResourceID field is immutable
rule: self == oldSelf
solutionTypes:
description: |-
The solutions that the data store enrolls. Available solutions for each
Expand Down
Loading
Loading