-
Notifications
You must be signed in to change notification settings - Fork 43
fix update of maintenance window #43
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 update of maintenance window #43
Conversation
d8f0acc to
8b3fd06
Compare
| delta.Differences = differences | ||
| } | ||
| } |
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.
nit: This method may return boolean indicating if there was a removal.
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.
ACK, not sure how we would use that return value but we can add it on later if there is a use for it
| func filterDelta( | ||
| delta *ackcompare.Delta, | ||
| desired *resource, | ||
| latest *resource, | ||
| ) { |
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.
Nice.
Not related to this PR but mentioning it here due to its context: I think this is where Server defaults can be handled: Remove differences from delta when corresponding spec field is nil if last applied spec also had that field nil.
- This will require access to "last applied spec" which needs to be kept somewhere for reference.
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.
Yep this should enable us to (at least temporarily) handle defaults before the framework-level solution is ready
| //TODO: for all the fields here, reevaluate if the latest observed state should always be populated, | ||
| // even if the corresponding field was not specified in desired | ||
|
|
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.
I think it should be fine to populate observed state fields here, the filterDelta() should determine if the diff is to be ignored.
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.
Agreed
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: echen-98, kumargauravsharma The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
It can be merged after successful e2e tests |
Issue #, if available:
Update of maintenance window was being "blocked" by custom code: multiple differences were triggering an update, and the custom update code considered the engine versions different even if
desiredhad6.xand latest had6.0.5.Since this takes precedence over the generated code, the generated code was never reached (and the maintenance window was therefore never updated).
Description of changes:
RemoveFromDeltato be common to all resourcesengineVersionsDiffer(+ tests) and replace it with calls todelta.DifferentAtpost_set_outputhook inReadOneto retrieve the latest maintenance windowBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.