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

SecretManagerSecret automatic replication no longer working #1081

Open
3 tasks done
sthomson-wyn opened this issue Dec 27, 2023 · 5 comments
Open
3 tasks done

SecretManagerSecret automatic replication no longer working #1081

sthomson-wyn opened this issue Dec 27, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@sthomson-wyn
Copy link

sthomson-wyn commented Dec 27, 2023

Checklist

Bug Description

A SecretManagerSecret resource with .spec.replication.auto = {} yields

Update call failed: cannot make changes to immutable field(s): [Field Name: replication.0.auto.#, Got: 0, Wanted: 1];

Additional Diagnostic Information

Unclear if this happens on a brand new resource, but this is happening for an existing resource

Kubernetes Cluster Version

v1.27.4-gke.900

Config Connector Version

1.112.0

Config Connector Mode

cluster mode

Log Output

No response

Steps to reproduce the issue

Create yaml below, for an existing secret in GSM

YAML snippets

apiVersion: secretmanager.cnrm.cloud.google.com/v1beta1
kind: SecretManagerSecret
metadata:
  name: my-secret
  labels:
    dev-access : "false"
spec:
  resourceID: my_secret
  replication:
    auto: {}
@sthomson-wyn sthomson-wyn added the bug Something isn't working label Dec 27, 2023
@diviner524
Copy link
Collaborator

Have you tried removing the whole replication section and see if the resource can be acquired successfully?

automatic is a deprecated field and it might have been converted to auto in the underlying TF provider.

@sthomson-wyn
Copy link
Author

Sorry, I meant to include the new non-deprecated field "auto" rather than "automatic". yaml update to reflect.

@diviner524
Copy link
Collaborator

@sthomson-wyn Are you able to determine the actual configurations of the existing resource? For example does the existing resource have replication.userManaged configured instead of replication.auto?

@sthomson-wyn
Copy link
Author

gcloud secrets describe projects/<id>/secrets/my_secret

yielded

createTime: '2020-07-17T17:41:50.468650Z'
etag: '""'
labels:
  label: 'value'
name: projects/<id>/secrets/my_secret
replication:
  automatic: {}

@WTPascoe
Copy link

WTPascoe commented Jan 15, 2024

I have the same issue when attempting to create a new SecretManagerSecret using the following YAML

apiVersion: secretmanager.cnrm.cloud.google.com/v1beta1
kind: SecretManagerSecret
metadata:
  name: my-secret
  namespace: backend
  annotations:
    cnrm.cloud.google.com/project-id: my_gcp_project_id
spec:
  replication:
    auto:
      customerManagedEncryption:
      kmsKeyRef:
        external: projects/my_gcp_project_id/locations/global/keyRings/my_keyring/cryptoKeys/my_key

Attempting to apply fails with Error from server (BadRequest): error when creating "secret.yaml": SecretManagerSecret in version "v1beta1" cannot be handled as a SecretManagerSecret: strict decoding error: unknown field "spec.replication.auto"

The SecretManagerSecret docs states that replication.auto.customerManagedEncryption should be valid.

Screenshot 2024-01-15 at 13 56 27

I can repro this on a new cluster built on Friday last week using a cnrm image gcr.io/gke-release/cnrm/controller:fc8237b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants