diff --git a/apis/v1alpha1/ack-generate-metadata.yaml b/apis/v1alpha1/ack-generate-metadata.yaml index 199579b..87a6c4d 100755 --- a/apis/v1alpha1/ack-generate-metadata.yaml +++ b/apis/v1alpha1/ack-generate-metadata.yaml @@ -1,9 +1,9 @@ ack_generate_info: - build_date: "2025-02-18T00:56:12Z" - build_hash: 66c0f840b0bcf6f552be46cf5ee0fb95ad57053e - go_version: go1.23.6 - version: v0.43.0 -api_directory_checksum: 18165abafc250811cc4812b82dd8d5c2e906cb9e + build_date: "2025-02-20T18:32:15Z" + build_hash: a326346bd3a6973254d247c9ab2dc76790c36241 + go_version: go1.24.0 + version: v0.43.2 +api_directory_checksum: b4eb4c1d6104667453456af5144ca269b1af8965 api_version: v1alpha1 aws_sdk_go_version: v1.32.6 generator_config_info: diff --git a/apis/v1alpha1/secret.go b/apis/v1alpha1/secret.go index e9f48f8..b39d38d 100644 --- a/apis/v1alpha1/secret.go +++ b/apis/v1alpha1/secret.go @@ -52,6 +52,7 @@ type SecretSpec struct { // you do so, you risk confusion and unexpected results when searching for a // secret by partial ARN. Secrets Manager automatically adds a hyphen and six // random characters after the secret name at the end of the ARN. + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable once set" // +kubebuilder:validation:Required Name *string `json:"name"` // A list of Regions and KMS keys to replicate secrets. @@ -103,7 +104,7 @@ type SecretStatus struct { // constructed ARN for the resource // +kubebuilder:validation:Optional ACKResourceMetadata *ackv1alpha1.ResourceMetadata `json:"ackResourceMetadata"` - // All CRS managed by ACK have a common `Status.Conditions` member that + // All CRs managed by ACK have a common `Status.Conditions` member that // contains a collection of `ackv1alpha1.Condition` objects that describe // the various terminal states of the CR and its backend AWS service API // resource diff --git a/config/controller/kustomization.yaml b/config/controller/kustomization.yaml index 03b24b0..0d0724a 100644 --- a/config/controller/kustomization.yaml +++ b/config/controller/kustomization.yaml @@ -6,4 +6,4 @@ kind: Kustomization images: - name: controller newName: public.ecr.aws/aws-controllers-k8s/secretsmanager-controller - newTag: 1.0.3 + newTag: 1.0.4 diff --git a/config/crd/bases/secretsmanager.services.k8s.aws_secrets.yaml b/config/crd/bases/secretsmanager.services.k8s.aws_secrets.yaml index 1b081bd..a5e234a 100644 --- a/config/crd/bases/secretsmanager.services.k8s.aws_secrets.yaml +++ b/config/crd/bases/secretsmanager.services.k8s.aws_secrets.yaml @@ -76,6 +76,9 @@ spec: secret by partial ARN. Secrets Manager automatically adds a hyphen and six random characters after the secret name at the end of the ARN. type: string + x-kubernetes-validations: + - message: Value is immutable once set + rule: self == oldSelf replicaRegions: description: A list of Regions and KMS keys to replicate secrets. items: @@ -190,7 +193,7 @@ spec: type: object conditions: description: |- - All CRS managed by ACK have a common `Status.Conditions` member that + All CRs managed by ACK have a common `Status.Conditions` member that contains a collection of `ackv1alpha1.Condition` objects that describe the various terminal states of the CR and its backend AWS service API resource diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 7992998..b91c7ee 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 name: secretsmanager-chart description: A Helm chart for the ACK service controller for AWS Secrets Manager (SecretsManager) -version: 1.0.3 -appVersion: 1.0.3 +version: 1.0.4 +appVersion: 1.0.4 home: https://github.com/aws-controllers-k8s/secretsmanager-controller icon: https://raw.githubusercontent.com/aws/eks-charts/master/docs/logo/aws.png sources: diff --git a/helm/crds/secretsmanager.services.k8s.aws_secrets.yaml b/helm/crds/secretsmanager.services.k8s.aws_secrets.yaml index 1b081bd..a5e234a 100644 --- a/helm/crds/secretsmanager.services.k8s.aws_secrets.yaml +++ b/helm/crds/secretsmanager.services.k8s.aws_secrets.yaml @@ -76,6 +76,9 @@ spec: secret by partial ARN. Secrets Manager automatically adds a hyphen and six random characters after the secret name at the end of the ARN. type: string + x-kubernetes-validations: + - message: Value is immutable once set + rule: self == oldSelf replicaRegions: description: A list of Regions and KMS keys to replicate secrets. items: @@ -190,7 +193,7 @@ spec: type: object conditions: description: |- - All CRS managed by ACK have a common `Status.Conditions` member that + All CRs managed by ACK have a common `Status.Conditions` member that contains a collection of `ackv1alpha1.Condition` objects that describe the various terminal states of the CR and its backend AWS service API resource diff --git a/helm/templates/NOTES.txt b/helm/templates/NOTES.txt index fada06c..2155938 100644 --- a/helm/templates/NOTES.txt +++ b/helm/templates/NOTES.txt @@ -1,5 +1,5 @@ {{ .Chart.Name }} has been installed. -This chart deploys "public.ecr.aws/aws-controllers-k8s/secretsmanager-controller:1.0.3". +This chart deploys "public.ecr.aws/aws-controllers-k8s/secretsmanager-controller:1.0.4". Check its status by running: kubectl --namespace {{ .Release.Namespace }} get pods -l "app.kubernetes.io/instance={{ .Release.Name }}" diff --git a/helm/values.yaml b/helm/values.yaml index 173a78f..9a8ad73 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -4,7 +4,7 @@ image: repository: public.ecr.aws/aws-controllers-k8s/secretsmanager-controller - tag: 1.0.3 + tag: 1.0.4 pullPolicy: IfNotPresent pullSecrets: [] diff --git a/pkg/resource/secret/sdk.go b/pkg/resource/secret/sdk.go index 38e847c..eda97e9 100644 --- a/pkg/resource/secret/sdk.go +++ b/pkg/resource/secret/sdk.go @@ -337,10 +337,6 @@ func (rm *resourceManager) sdkUpdate( defer func() { exit(err) }() - if immutableFieldChanges := rm.getImmutableFieldChanges(delta); len(immutableFieldChanges) > 0 { - msg := fmt.Sprintf("Immutable Spec fields have been modified: %s", strings.Join(immutableFieldChanges, ",")) - return nil, ackerr.NewTerminalError(fmt.Errorf(msg)) - } input, err := rm.newUpdateRequestPayload(ctx, desired, delta) if err != nil { return nil, err @@ -547,15 +543,3 @@ func (rm *resourceManager) terminalAWSError(err error) bool { // No terminal_errors specified for this resource in generator config return false } - -// getImmutableFieldChanges returns list of immutable fields from the -func (rm *resourceManager) getImmutableFieldChanges( - delta *ackcompare.Delta, -) []string { - var fields []string - if delta.DifferentAt("Spec.Name") { - fields = append(fields, "Name") - } - - return fields -}