HIVE-2871 - Always show the upgradeable annotation.#2705
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2705 +/- ##
=========================================
Coverage ? 50.29%
=========================================
Files ? 287
Lines ? 33976
Branches ? 0
=========================================
Hits ? 17087
Misses ? 15540
Partials ? 1349
🚀 New features to boost your workflow:
|
2uasimojo
left a comment
There was a problem hiding this comment.
I agree with Trevor at least that the label=>annotation change should be made, but since that's just in unit tests, I'm happy to let this land as is and see that change in a fup.
/lgtm
...but I'll
/hold
so you can control that cadence however you want (re-push and I'll re-stamp; or unhold and fup).
| }), | ||
| validate: func(t *testing.T, cd *hivev1.ClusterDeployment) { | ||
| assert.Equal(t, "", cd.Annotations[constants.MinorVersionUpgradeUnavailable], "unexpected version major-minor-patch label") | ||
| assert.Equal(t, "", cd.Annotations[constants.MinorVersionUpgradeUnavailable], "Unexpected value for label hive.openshift.io/minor-version-upgrade-unavailable") |
There was a problem hiding this comment.
Would have to dig into why this test was working before (as opposed to having to assert that there was no such key) but it seems accurate in its new form 🤷
There was a problem hiding this comment.
The cd.Annotations map gets set to a non-nil value in the functional part of the code. In Go, trying to pull a map entry by a key that doesn't exist will return the 0 value of that map's value type. For example:
myMap := map[string]string{}
foo := myMap["foo"]
in this case, foo will be an empty string.
The old test probably should've been asserting instead that the key didn't exist instead of looking at the value.
…he annotation is present with an empty string, this means that the cluster is upgradeable.
9892ef1 to
8e15858
Compare
|
@AlexVulaj: all tests passed! 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. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 2uasimojo, AlexVulaj 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 |
|
/unhold |
|
/retest |
1 similar comment
|
/retest |
|
/retest hive-mce-29-on-pull-request |
|
/retest hive-on-pull-request |
|
@2uasimojo: The Use 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-sigs/prow repository. |
|
@2uasimojo: The Use 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-sigs/prow repository. |
|
/override "Red Hat Konflux" |
|
@2uasimojo: /override requires failed status contexts, check run or a prowjob name to operate on.
Only the following failed contexts/checkruns were expected:
If you are trying to override a checkrun that has a space in it, you must put a double quote on the context. 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-sigs/prow repository. |
Follow up to HIVE-2819 - always show the upgradeable annotation. If the annotation is present with an empty string, this means that the cluster is upgradeable.