-
Notifications
You must be signed in to change notification settings - Fork 89
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
Fix for 'avoidNamespaces' field updates #157
Conversation
@@ -50,8 +50,9 @@ def on_delete( | |||
logger.debug(f'csec {uid} deleted from memory ok') | |||
|
|||
|
|||
@kopf.on.field('clustersecret.io', 'v1', 'clustersecrets', field='avoidNamespaces') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we could have a conformance test ensuring this change work as expected ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we could have a conformance test ensuring this change work as expected ?
Yes, we can have some test. I will check current tests and try to add something there.
While writing test for 'avoidNamespaces' I found a big bug. If the 'ClusterSecret' object previously did not contain 'matchNamespace' or 'avoidNamespaces' fields, the 'on_fields_avoid_or_match_namespace' function would ignore the event. It was the same before my changes, but I will rewrite the logic and then will update this PR |
01c0bb0
to
e4489b4
Compare
Code updated. |
…mespaces' was missing before they updates Removed unnecessary cache checking - it always will be empty for 'resume' and 'create' events
e4489b4
to
3e1fadc
Compare
Another update to last changes in master and bumped helm chart version to pass the tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, clean code, waiting for the tests to be ✅
All tests are ✅ merging |
This is simple fix for issue 93. It adds an additional '@kopf.on.field' decorator for update events on 'avoidNamespaces' field. After this PR all tests are passed successfully.