-
Notifications
You must be signed in to change notification settings - Fork 56
fix: ignore setting sdkUpdate output into DBInstance spec #221
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: ignore setting sdkUpdate output into DBInstance spec #221
Conversation
apis/v1alpha1/generator.yaml
Outdated
# sdk_delete_post_request: | ||
# code: return r, fmt.Errorf("wait for delete") |
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.
should we do something like this instead? ignoring sdkUpdate output? https://github.com/aws-controllers-k8s/efs-controller/blob/af06340fb3246dc107feac45136b465ade226d3c/generator.yaml#L59-L60
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.
Just to make sure I understand the two approaches.
In this PR you selectively ignored certain fields for the DBInstance which were receiving out of date values from the Update response. The alternative you're asking about is to completely ignore the update response for every field as a way of ensuring that no other fields are erroneously updated with out of date values from the Update response. Is that correct?
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.
Just left a few clarifying questions.
apis/v1alpha1/generator.yaml
Outdated
# sdk_delete_post_request: | ||
# code: return r, fmt.Errorf("wait for delete") |
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.
Just to make sure I understand the two approaches.
In this PR you selectively ignored certain fields for the DBInstance which were receiving out of date values from the Update response. The alternative you're asking about is to completely ignore the update response for every field as a way of ensuring that no other fields are erroneously updated with out of date values from the Update response. Is that correct?
@michaelhtm: Would it be possible to create a test that reproduces the bug? Having that test would both make us a bit more confident in this fix and make sure that we don't accidentally have a regression in future changes. |
7a87712
to
ed1a046
Compare
/lgtm Just adding the hold in case we want a second reviewer on this one. |
f470a3d
to
2434b87
Compare
2434b87
to
509dc82
Compare
36a7261
to
710c85b
Compare
710c85b
to
f980ff5
Compare
f980ff5
to
05da18d
Compare
a.ko.Spec.PerformanceInsightsKMSKeyID = b.ko.Spec.PerformanceInsightsKMSKeyID | ||
if a.ko.Spec.PerformanceInsightsEnabled == nil && | ||
b.ko.Spec.PerformanceInsightsEnabled != nil { | ||
a.ko.Spec.PerformanceInsightsEnabled = func() *bool { a := false; return &a }() |
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.
Q: Is this mutating PerformanceInsightEnabled to false?
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.
If that's the case it seems odd to mutate the resource in the delta. I wouldn't expect the delta comparison to have any side effects.
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.
We do this in a lot of controllers. The expected outcome if the field is missing is disabling it
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.
Okay if this is an existing pattern I won't block the PR.
@@ -0,0 +1,6 @@ | |||
ko.Status = latest.ko.Status | |||
setLastAppliedSecretReferenceAnnotation(&resource{ko}) |
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.
Q: Any reason this has been moved to out of the sdk_update_post_set_output
hook?
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.
because we no longer reach post_set_output
. We return here: https://github.com/aws-controllers-k8s/rds-controller/pull/221/files#diff-20a6e390c0105317eb581bd5f0bf409c375bbd090d162881ed810952ca8aef93R1998
When we make a ModifyDBInstance call, the output returned is outdated. Currently we've been relying on `pendingModifiedValues` to return the desired field values, but based on the longs, pendingModifiedValues is not a reliable source. These changes specifically ignore setting the fields after ModifyDBInstance is called. A better approach can be to ignore setting anything after Update is called. Just in case we're missing some values that we should ignore instead!!!
05da18d
to
a3d1bd7
Compare
@michaelhtm: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: knottnt, michaelhtm 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 |
/unhold |
Issue #2086, #2123
Description of changes:
When we make a ModifyDBInstance call, the output returned is outdated.
Currently we've been relying on
pendingModifiedValues
to return thedesired field values, but based on the logs, pendingModifiedValues is not
a reliable source.
These changes ignore the sdkUpdate output spec completely, and only patch the status.
One more change here is adding support of late initializing PerformanceInsightsKMSKeyID and PerformanceInsightsRetentionPeriod fields only when PerformanceInsights is enabled.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.