Skip to content
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

OCPBUGS-22476: Explicitly degrade the cluster when conditions are not met #183

Merged

Conversation

gnufied
Copy link
Member

@gnufied gnufied commented Oct 30, 2023

Previously we used to rely on return values from sync function, but this creates a problem, when no checks are performed - we simply return nil in that case. This causes degraded condition to be removed from the cluster. But in-truth cluster should remain degraded.

@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Oct 30, 2023
@openshift-ci-robot
Copy link
Contributor

@gnufied: This pull request references Jira Issue OCPBUGS-22476, which is invalid:

  • expected the bug to target the "4.15.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

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

In response to this:

Previously we used to rely on return values from sync function, but this creates a problem, when no checks are performed - we simply return nil in that case. This causes degraded condition to be removed from the cluster. But in-truth cluster should remain degraded.

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
Copy link
Contributor

openshift-ci bot commented Oct 30, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gnufied

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 /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 Oct 30, 2023
Previously we used to rely on return values from sync function, but
this creates a problem, when no checks are performed - we simply
return nil in that case. This causes degraded condition to be removed
from the cluster. But in-truth cluster should remain degraded.
@@ -449,7 +450,26 @@ func (c *VSphereController) updateConditions(
}

updateFuncs := []v1helpers.UpdateStatusFunc{}

degradeCond := operatorapi.OperatorCondition{
Type: "VMwareVSphereOperatorController" + operatorapi.OperatorStatusTypeDegraded,
Copy link
Member Author

Choose a reason for hiding this comment

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

Note to reviewers - I am using different name than default name + xxxxDegraded because it appears that, that name gets clobbered by library-go sync function and defaults to false, if no error is thrown during the sync.

I made the decision to explicitly degrade the cluster (even though I had to use a different name), because otherwise we will have to store the last check result in cache somewhere (because we don't perform full checks everytime sync gets called). But in past - caching of previous check results have caused problems and I wanted code to not rely on unwanted state, if we can help it.

Copy link
Contributor

@jsafrane jsafrane Nov 7, 2023

Choose a reason for hiding this comment

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

Please note about this as a huge comment into the code.

I think it's OK to add a separate Degraded condition that capture the check result, however, it's very hard for me to actually check if updateConditions is called with the right arguments in all code paths, so the condition is not accidentally cleared. IMO the operator's complexity has reached state where some refactoring / simplification is necessary (as a separate PR / techdebt epic).

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a comment. Usually this is the only function that updates the conditions in this controller and hence we should be okay.

@@ -449,7 +450,26 @@ func (c *VSphereController) updateConditions(
}

updateFuncs := []v1helpers.UpdateStatusFunc{}

degradeCond := operatorapi.OperatorCondition{
Type: "VMwareVSphereOperatorController" + operatorapi.OperatorStatusTypeDegraded,
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe VMwareVSphere(Operator?)CheckDegraded would be better, to clearly distinguish it from VMwareVSphereControllerDegraded

Copy link
Member Author

Choose a reason for hiding this comment

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

ack

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed.

@gnufied
Copy link
Member Author

gnufied commented Nov 9, 2023

/jira refresh

@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. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Nov 9, 2023
@openshift-ci-robot
Copy link
Contributor

@gnufied: This pull request references Jira Issue OCPBUGS-22476, 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.15.0) matches configured target version for branch (4.15.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (wduan@redhat.com), skipping review request.

In response to this:

/jira refresh

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.

@gnufied
Copy link
Member Author

gnufied commented Nov 9, 2023

/retest

@jsafrane
Copy link
Contributor

/lgtm

@jsafrane
Copy link
Contributor

/retest-required

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 10, 2023
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD c7ab8b3 and 2 for PR HEAD 572b465 in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD a530a82 and 1 for PR HEAD 572b465 in total

@jsafrane
Copy link
Contributor

/retest-required

@jsafrane
Copy link
Contributor

/retest

Copy link
Contributor

openshift-ci bot commented Nov 24, 2023

@gnufied: 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-vsphere-csi-extended 572b465 link false /test e2e-vsphere-csi-extended

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.

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 65ae93a and 2 for PR HEAD 572b465 in total

@openshift-merge-bot openshift-merge-bot bot merged commit 1a09062 into openshift:master Nov 27, 2023
8 of 9 checks passed
@openshift-ci-robot
Copy link
Contributor

@gnufied: Jira Issue OCPBUGS-22476: All pull requests linked via external trackers have merged:

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

In response to this:

Previously we used to rely on return values from sync function, but this creates a problem, when no checks are performed - we simply return nil in that case. This causes degraded condition to be removed from the cluster. But in-truth cluster should remain degraded.

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-bot
Copy link

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-vmware-vsphere-csi-driver-operator-container-v4.15.0-202311272131.p0.g1a09062.assembly.stream for distgit ose-vmware-vsphere-csi-driver-operator.
All builds following this will include this PR.

@openshift-merge-robot
Copy link
Contributor

Fix included in accepted release 4.15.0-0.nightly-2023-11-28-101923

@gnufied
Copy link
Member Author

gnufied commented Nov 29, 2023

/cherry-pick release-4.14
/cherry-pick release-4.13

@openshift-cherrypick-robot

@gnufied: new pull request created: #194

In response to this:

/cherry-pick release-4.14
/cherry-pick release-4.13

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. jira/severity-important Referenced Jira bug's severity is important 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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants