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

Allow to disable secret overwrite. Use annotation to protect original values of existing secret in target namespace #312

Open
francardoso93 opened this issue Nov 9, 2023 · 2 comments

Comments

@francardoso93
Copy link

francardoso93 commented Nov 9, 2023

My team is using kubernetes-replicator in the Initium project to do a push based secret replication. We're facing issues to avoid that existing secrets get overwritten. That's what happens: When the source secret has the same name of an existing secret in target, the target one gets replaced. Source is always the source of true.
I understand that to be the default behavior, but I'd like to propose to make this configurable, as it's currently a blocker for us.

Suggested solution:
Replicator checks an annotation at target secret, that can disable the default behavior. Then, it doesn't replicate values from source to that specific annotated secret.
eg: replicator.v1.mittwald.de/protect-from-overwrite: true

We're available to collaborate by doing this implementation if you agree.

@francardoso93
Copy link
Author

cc @LucaLanziani

@francardoso93 francardoso93 changed the title Allow to configure secret overwrite exception. Use annotation to protect original values of existing secret in target namespace Allow to disable secret overwrite. Use annotation to protect original values of existing secret in target namespace Nov 9, 2023
@daniel-ciaglia
Copy link

daniel-ciaglia commented Aug 26, 2024

I would introduce a global option as well eg. overwrite-mode with multiple options

  • always - always overwrite targets old default
  • if-not-exists - new default
  • if-allowed - check annotation on target

I would also change the semantics of the proposed target annotation to replicator.v1.mittwald.de/overwrite-allowed. This follows the current annotations (https://github.com/mittwald/kubernetes-replicator/blob/master/replicate/common/consts.go)

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

No branches or pull requests

2 participants