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

Failure to automatically recover from "secret already exists" state #356

Open
kavishdahekar opened this issue Nov 4, 2024 · 3 comments
Open
Labels

Comments

@kavishdahekar
Copy link

Describe the bug
If a secret already exists at a target that the replicator was planning to replicate to, the replication task is skipped with error

Replicated test-source/test-secret-1 to 299 out of 300 namespaces: 1 error occurred:
\t* Failed to replicate Secret test-source/test-secret-1 -> test-destination-299: Failed to update secret test-destination-299/test-secret-1: secrets \"test-secret-1\" already exists: Failed to update secret test-destination-299/test-secret-1: secrets \"test-secret-1\" already exists

Deleting the existing secret (test-destination-299/test-secret-1 in above example) however does not trigger the replicator to create a proper copy. In above case, if test-destination-299/test-secret-1 is deleted, replicator never recreates it (unless the source secret is modified or the replicator pods are restarted).

To Reproduce

  1. create a secret in ns 'destination`.
  2. create the exact same secret with replicator.v1.mittwald.de/replicate-to=destaination annotation
  3. replicator fails with error "already exists"
  4. delete secret from destination ns.
  5. note that replicator does not create the secret in the destination ns.

Expected behavior
Replicator should observe that the conflicting secret no longer exists and should create the secret in the destination ns.

Environment:

  • Kubernetes version: v1.30.5
  • kubernetes-replicator version: v2.10.2

Additional context
n/a

@kavishdahekar
Copy link
Author

Possible mitigation for this bug could be introduction of a new annotation replicator.v1.mittwald.de/force-replicate=true but this would need more though.

@roderik
Copy link

roderik commented Nov 15, 2024

For me it never updates existing secrets, not sure why...

@roderik
Copy link

roderik commented Nov 15, 2024

I think part of the reason is we deploy with pulumi which replaces the secrets, so the resource version might always be the same?
The check contents flag in the last release doesn't work for me either

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants