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

[BUG] Updating spec.vault.object.name doesn't result in updating an existing target secret #607

Open
joyrex2001 opened this issue Sep 18, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@joyrex2001
Copy link

Components and versions

[X] Controller, version: 1.5.0 (docker image tag)
[ ] Env-Injector (webhook), version: x.x.x (docker image tag)
[ ] Other

Describe the bug
Updating the AzureKeyVaultSecret by changing spec.vault.object.name doesn't result in updating an existing target secret.

To Reproduce
Steps to reproduce the behavior:

Consider following AzureKeyValutSecret:

apiVersion: spv.no/v1
kind: AzureKeyVaultSecret
metadata:
  name: my-secret 
spec:
  output:
    secret:
      name: my-secret 
      dataKey: itsasecret
  vault:
    name: my-keyvault-dev
    object:
      name: version-de-secret
      type: secret

After applying the secret, a k8s secret my-secret will appear.

When patching the spec.vault.object.name with a different name, the target secret is not updated with the new values.

Patch command: kubectl patch akvs my-secret --type merge -p '{"spec":{"vault":{"object":{"name":"version-de-secret"}}}}'.

Expected behavior

When patching the spec.vault.object.name with a different name, the target secret should contain the values of the newly targetted keyvault secret.

Additional context
It looks like the md5 doesn't take spec.vault.object.name into account, making it seem the AzureKeyVautSecret is not changed and nothing needs to be done.

@joyrex2001 joyrex2001 added the bug Something isn't working label Sep 18, 2023
@181192
Copy link
Collaborator

181192 commented Oct 1, 2023

Hi @joyrex2001 good observation. Yes the hashing logic only takes the secrets related to one akvs resource. Need to look into how to handle, multiple akvs resources can also write to the same k8s secret

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

2 participants