Skip to content

OCPBUGS-3440: Restart authentication operator if console capability is enabled - #589

Merged
openshift-merge-robot merged 1 commit into
openshift:masterfrom
bparees:restart
Nov 23, 2022
Merged

OCPBUGS-3440: Restart authentication operator if console capability is enabled#589
openshift-merge-robot merged 1 commit into
openshift:masterfrom
bparees:restart

Conversation

@bparees

@bparees bparees commented Nov 9, 2022

Copy link
Copy Markdown
Contributor

No description provided.

@bparees bparees added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 9, 2022
@openshift-ci
openshift-ci Bot requested review from deads2k and stlaz November 9, 2022 14:09
@bparees bparees changed the title Restart authentication operator if console capability is enabled [OCPBUGS-3440] Restart authentication operator if console capability is enabled Nov 9, 2022
@bparees bparees changed the title [OCPBUGS-3440] Restart authentication operator if console capability is enabled OCPBUGS-3440: Restart authentication operator if console capability is enabled Nov 9, 2022
@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Nov 9, 2022
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@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
  • bug is open, matching expected state (open)
  • bug target version (4.13.0) matches configured target version for branch (4.13.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @xingxingxia

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In 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.

@openshift-ci
openshift-ci Bot requested a review from xingxingxia November 9, 2022 14:26
@bparees
bparees force-pushed the restart branch 2 times, most recently from 0bfa6fd to ea9b424 Compare November 10, 2022 18:46
@jhadvig

jhadvig commented Nov 11, 2022

Copy link
Copy Markdown
Member

/assign @stlaz

@bparees

bparees commented Nov 14, 2022

Copy link
Copy Markdown
Contributor Author

/cherry-pick release-4.12

@openshift-cherrypick-robot

Copy link
Copy Markdown

@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.

Details

In response to this:

/cherry-pick release-4.12

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redone and pushed

Comment thread manifests/07_deployment.yaml Outdated
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)

@stlaz stlaz Nov 14, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's an interesting pattern. Basically we're working around not being able to cancel() the global context from the inside of the operator 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bparees
bparees force-pushed the restart branch 3 times, most recently from 4a4d3d1 to f28143a Compare November 14, 2022 20:22
@bparees

bparees commented Nov 14, 2022

Copy link
Copy Markdown
Contributor Author

/hold cancel

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 14, 2022
@bparees

bparees commented Nov 14, 2022

Copy link
Copy Markdown
Contributor Author

/retest-required

2 similar comments
@bparees

bparees commented Nov 15, 2022

Copy link
Copy Markdown
Contributor Author

/retest-required

@bparees

bparees commented Nov 17, 2022

Copy link
Copy Markdown
Contributor Author

/retest-required

@stlaz stlaz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

godoc please


for i := range errs {
if strings.Contains(tt.expectedErrs[i], errs[i].Error()) {
if !strings.Contains(errs[i].Error(), tt.expectedErrs[i]) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@openshift-ci

openshift-ci Bot commented Nov 21, 2022

Copy link
Copy Markdown
Contributor

@bparees: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-single-node fa9cd61 link false /test e2e-aws-single-node

Full PR test history. Your PR dashboard.

Details

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.

@bparees

bparees commented Nov 22, 2022

Copy link
Copy Markdown
Contributor Author

/retest-required

@stlaz

stlaz commented Nov 23, 2022

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Nov 23, 2022
@openshift-ci

openshift-ci Bot commented Nov 23, 2022

Copy link
Copy Markdown
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 23, 2022
@openshift-merge-robot
openshift-merge-robot merged commit 0ce0bcc into openshift:master Nov 23, 2022
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@bparees: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-3440 has been moved to the MODIFIED state.

Details

In 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.

@openshift-cherrypick-robot

Copy link
Copy Markdown

@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

Details

In response to this:

/cherry-pick release-4.12

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

bparees commented Nov 23, 2022

Copy link
Copy Markdown
Contributor Author

/cherry-pick release-4.12

@openshift-cherrypick-robot

Copy link
Copy Markdown

@bparees: new pull request created: #593

Details

In response to this:

/cherry-pick release-4.12

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants