OCPBUGS-3440: Restart authentication operator if console capability is enabled - #589
Conversation
|
@bparees: This pull request references Jira Issue OCPBUGS-3440, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: 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 kubernetes/test-infra repository. |
0bfa6fd to
ea9b424
Compare
|
/assign @stlaz |
|
/cherry-pick release-4.12 |
|
@bparees: once the present PR merges, I will cherry-pick it on top of release-4.12 in a new PR and assign it to you. 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 kubernetes/test-infra repository. |
| "github.com/openshift/cluster-authentication-operator/pkg/controllers/configobservation" | ||
| ) | ||
|
|
||
| func ObserveClusterCapabilities(genericlisters configobserver.Listers, recorder events.Recorder, existingConfig map[string]interface{}) (ret map[string]interface{}, _ []error) { |
There was a problem hiding this comment.
I understand it's tempting to use an observer for this but I'd rather have this as a separate controller.
The observers are supposed to change the observed config in a way.
Please create a "TerminationController" (or something like that) using the lib-go controller factory (other controllers in this repo are using that, too).
| if capability == configv1.ClusterVersionCapabilityConsole { | ||
| recorder.Eventf("ObserveClusterCapabilities", "Console capability enabled, restarting cluster authentication operator") | ||
| klog.Infof("Console capability enabled, restarting cluster authentication operator") | ||
| f, err := os.OpenFile("/tmp/terminate", os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0600) |
There was a problem hiding this comment.
That's an interesting pattern. Basically we're working around not being able to cancel() the global context from the inside of the operator 🤔
There was a problem hiding this comment.
yeah, the global context/cancel function created in the library isn't exposed to the operator itself so i couldn't just cancel it, at least i didn't see a way...i'd certainly have preferred to have just done that. But i also didn't want to go refactoring openshift-library to make it possible.
4a4d3d1 to
f28143a
Compare
|
/hold cancel |
|
/retest-required |
2 similar comments
|
/retest-required |
|
/retest-required |
stlaz
left a comment
There was a problem hiding this comment.
LGTM, if you could only document the controller a bit. I think it might even be worth removing the observer-internal logic on determining whether the cap is allowed now that we don't let it run in case the capability is just not there.
| recorder events.Recorder | ||
| } | ||
|
|
||
| func NewTerminationController(configInformer configinformers.SharedInformerFactory, recorder events.Recorder) factory.Controller { |
…pability is enabled
|
|
||
| for i := range errs { | ||
| if strings.Contains(tt.expectedErrs[i], errs[i].Error()) { | ||
| if !strings.Contains(errs[i].Error(), tt.expectedErrs[i]) { |
There was a problem hiding this comment.
this logic was wrong in two ways.
as the tests are written, the expected error string is a subset of the actual error string.
and of course the test should fail if an error occurs that was not in the expected list, not fail when an expected error occurs.
|
@bparees: The following test 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/test-infra repository. I understand the commands that are listed here. |
|
/retest-required |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bparees, stlaz The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@bparees: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-3440 has been moved to the MODIFIED state. 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 kubernetes/test-infra repository. |
|
@bparees: failed to push cherry-picked changes in GitHub: pushing failed, output: "fatal: unable to access 'https://github.com/openshift-cherrypick-robot/cluster-authentication-operator/': Could not resolve host: github.com\n", error: exit status 128 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 kubernetes/test-infra repository. |
|
/cherry-pick release-4.12 |
|
@bparees: new pull request created: #593 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 kubernetes/test-infra repository. |
No description provided.