-
Notifications
You must be signed in to change notification settings - Fork 85
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
base: master
Are you sure you want to change the base?
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 |
…mespaces' was missing before they updates Removed unnecessary cache checking - it always will be empty for 'resume' and 'create' events
01c0bb0
to
e4489b4
Compare
Code updated. |
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.