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
Bug 1767156: Fix "Multipleavailable" reason in the code #248
Bug 1767156: Fix "Multipleavailable" reason in the code #248
Conversation
df82f16
to
aa07d70
Compare
| actualReasons := strings.Split(condition.Reason, "\n") | ||
| a := make([]string, len(tc.expectedReasons)) | ||
| b := make([]string, len(actualReasons)) | ||
| copy(a, tc.expectedReasons) | ||
| copy(b, actualReasons) | ||
| sort.Strings(a) | ||
| sort.Strings(b) | ||
| if !equality.Semantic.DeepEqual(a, b) { | ||
| t.Error("\n" + diff.ObjectDiff(a, b)) | ||
| } |
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.
Why not to compare this as strings instead? You know what those should look like
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 think I understood what's missing here. I should have used sort function only expectedReasons array because the actualReasons array would already be in sorted order.
| expectedReason: "Multiple", | ||
| name: "MultipleAPIServiceNotAvailable", | ||
| expectedStatus: operatorv1.ConditionFalse, | ||
| expectedReasons: []string{"APIServiceNotAvailable1", "APIServiceNotAvailable2"}, |
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.
These don't get indexed in the code so this will never pass. Omit the numbers.
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.
Fixed.
4b4f1cc
to
b777247
Compare
|
/test e2e-aws-operator |
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.
The changes lgtm, but please squash your commits to a single one.
b777247
to
bd5a10e
Compare
Done!. Thanks for reviewing. |
|
/retitle Bug 1767156: Fix "Multipleavailable" reason in the code |
|
@sohankunkerkar: This pull request references Bugzilla bug 1767156, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 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. |
pkg/operator/workloadcontroller/workload_controller_openshiftapiserver_v311_00_test.go
Outdated
Show resolved
Hide resolved
bd5a10e
to
2802fa7
Compare
|
/lgtm |
| var availableConditionMessages []string | ||
|
|
||
| switch { | ||
| case actualDaemonSet == nil: | ||
| availableConditionReason = "NoDaemon" | ||
| availableConditionReasons = append(availableConditionReasons, "NoDaemon") |
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.
messy. We should have a condition for each one. I think this good enough to backport, but in 4.3, they should be individual and we should clear the existing "Available".
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, sohankunkerkar, soltysh, stlaz 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 |
|
@sohankunkerkar: All pull requests linked via external trackers have merged. Bugzilla bug 1767156 has been moved to the MODIFIED state. 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. |
|
/cherrypick release-4.2 |
|
@stlaz: new pull request created: #254 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. |
|
/cherrypick release-4.1 |
|
@stlaz: new pull request created: #255 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. |
| switch { | ||
| case len(availableConditionMessages) == 1: | ||
| v1helpers.SetOperatorCondition(&operatorConfig.Status.Conditions, operatorv1.OperatorCondition{ | ||
| Type: operatorv1.OperatorStatusTypeAvailable, | ||
| Status: operatorv1.ConditionFalse, | ||
| Reason: availableConditionReason, | ||
| Reason: availableConditionReasons[0], |
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.
this panics
I have come up with this change after having some discussion around the Bugzilla with @stlaz.