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] Custom annotations and labels on secret is cleared on update #648

Open
theggelund opened this issue Dec 11, 2023 · 1 comment
Open
Labels
bug Something isn't working

Comments

@theggelund
Copy link

Note: Make sure to check out known issues (https://akv2k8s.io/troubleshooting/known-issues/) before submitting

Components and versions
Select which component(s) the bug relates to with [X].

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

Describe the bug
When akv2k8s updates an existing k8s secret that has annotations and labels, the annotations and labels are removed.

Looks like annotations and labels are taken from the AzureKeyVaultSecret object instead of from the existing secret.

To Reproduce

  1. Create a kubernetes secret with labels and annotations
apiVersion: v1
kind: Secret
metadata:
  name: repo-github
  namespace: argocd
  labels:
    argocd.argoproj.io/secret-type: repository
  annotations:
    managed-by: argocd.argoproj.io
data:
  dummy: YWJjCg==
type: Opaque
  1. Create AzureKeyVaultSecret
apiVersion: spv.no/v2beta1
kind: AzureKeyVaultSecret
metadata:
  name: dummy-secret
  namespace: argocd
spec:
  output:
    secret:
      dataKey: dummy
      name: repo-github
  vault:
    name: myvault
    object:
      name: dummy
      type: secret
  1. Inspect the updated secret object and see that there are no annotations and labels

Expected behavior
Akv2k8s should only update the secret data, not any other information on the object.

Workaround
Set annotations and labels on AzureKeyVaultSecret object.

@theggelund theggelund added the bug Something isn't working label Dec 11, 2023
@quazeeee
Copy link

faced the same problem

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