Improvement. Automatic synchronization of changes from 'linked' secrets #160
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a long-requested and missing feature: automatically updating all secrets when there are changes in secrets referenced by 'secretKeyRef'. A kopf decorator is used to send all secret update events to a new function called 'on_secret_update'. In this function, I parse all ClusterSecrets from the in-memory cache (it's very fast) and check whether they have a 'valueFrom' field in their data. Next, for those ClusterSecrets that have a 'valueFrom' field, I simply compare the name and namespace of the updated secret with the corresponding values in 'valueFrom'. If they match, a resync is initiated for each previously synced namespace.
It will solve 36