-
Notifications
You must be signed in to change notification settings - Fork 115
OCPBUGS-65896: controllers: Prevent Progressing=True when scaling only #836
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
base: master
Are you sure you want to change the base?
Conversation
|
Skipping CI for Draft Pull Request. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds scaling guardrail logic that annotates Deployments on replica changes and emits OperatorConditionApplyConfiguration overwrites; wires those overwrites through workload and controller call chains by extending several function signatures; adds a go.mod replace pointing Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: tchap The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
2c5caf5 to
d8b074a
Compare
93c17d5 to
40dbc69
Compare
2e340f0 to
5fa520e
Compare
|
/retitle OCPBUGS-65896: controllers: Prevent Progressing=True when scaling only We can only merge this after the library-go changes are merged. /hold |
|
@tchap: This pull request references Jira Issue OCPBUGS-65896, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
/jira refresh |
|
@tchap: This pull request references Jira Issue OCPBUGS-65896, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (ksiddiqu@redhat.com), skipping review request. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
@tchap: This pull request references Jira Issue OCPBUGS-65896, which is valid. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (ksiddiqu@redhat.com), skipping review request. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
5fa520e to
ab1ed0f
Compare
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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@pkg/controllers/deployment/deployment_controller.go`:
- Around line 269-283: setRollingUpdateParameters mutates RollingUpdate fields
so scaling.ProcessDeployment sees non‑scaling diffs; to fix, normalize
RollingUpdate parameters before the scaling-only comparison by making a copy of
expectedDeployment (or a temp deployment) and setting its
Spec.Strategy.RollingUpdate to match
existingDeployment.Spec.Strategy.RollingUpdate (or nil) so only Replicas differ,
then call scaling.ProcessDeployment(existingDeployment, normalizedExpected,
...). Ensure you still use the original expectedDeployment for applying changes
but use the normalized copy for the conditionOverwrites call involving
setRollingUpdateParameters and scaling.ProcessDeployment.
ab1ed0f to
966cb2c
Compare
| } | ||
|
|
||
| actualDeployment, err := target.syncDeployment(context.TODO(), &scenario.operator.Spec.OperatorSpec, &scenario.operator.Status.OperatorStatus, eventRecorder) | ||
| actualDeployment, _, err := target.syncDeployment(context.TODO(), &scenario.operator.Spec.OperatorSpec, &scenario.operator.Status.OperatorStatus, eventRecorder) |
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 should add some tests here to also check the condition overwrites, I guess?
966cb2c to
229cba5
Compare
| conditionOverwrites, err := scaling.ProcessDeployment(existingDeployment, expectedDeployment, clock.RealClock{}, "OAuthServer") | ||
| if err != nil { | ||
| return nil, false, nil, append(errs, err) | ||
| } |
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.
There are no tests for this package really, so I can't extend them really to make sure this works properly. For now only the scaling package is being tested properly.
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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@pkg/operator/workload/sync_openshift_oauth_apiserver.go`:
- Around line 287-297: Add a short comment above the call to
encryptionkms.AddKMSPluginVolumeAndMountToPodSpec explaining why the KMS
volume/mount is applied before calling scaling.ProcessDeployment (e.g., "KMS
volumes must be added before scaling detection so ProcessDeployment sees the
final podSpec and does not misattribute changes" or note that this ordering is
intentional to ensure KMS config is present when comparing specs), mirroring the
explanatory style used in deployment_controller.go; reference the functions
AddKMSPluginVolumeAndMountToPodSpec and scaling.ProcessDeployment in the comment
so future readers understand the rationale.
229cba5 to
cd9e42a
Compare
Assisted-by: Claude Code
cd9e42a to
933f489
Compare
|
@tchap: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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-sigs/prow repository. I understand the commands that are listed here. |
Before we start, the idea basically is to extend
Syncto return conditions that would overwrite the conditions generated by thelibrary-gomachinery. The interface change is not yet implemented inlibrary-go, but it should be OK as this operator is the only operator using the package.To handle scaling properly, We need to keep some context regarding the state of the Deployment, so I decided to propose a few Deployment annotations. The names are not final, not sure about what the proper prefix is actually. Not sure whether there is a better way to store state, feel free to propose another way.
The main idea is summarized in the doc comment for
ProcessDeployment:The annotation machinery is there to account for eventual consistency between creating/updating the deployment and the deployment controller picking the change up and actually updating the conditions there.