Skip to content

Commit

Permalink
test/extended/operators: Require Upgradeable=True or unset for "start…
Browse files Browse the repository at this point in the history
… all core operators"

E.g. [1] has users who are confused by Upgradeable=Unknown, of which
we currently have a few [2]:

  $ curl -s https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/logs/release-openshift-ocp-installer-e2e-aws-4.8/1375324509623554048/artifacts/e2e-aws/clusteroperators.json | jq -r '.items[] | .metadata.name as $n | .status.conditions[] | select(.status == "Unknown") | $n + " " + .type + " " + .reason'
  kube-storage-version-migrator Upgradeable NoData
  openshift-controller-manager Upgradeable NoData
  service-ca Upgradeable NoData

This commit adds a post-install guard to reject as surprising any
Upgradeable!=True conditions.  We should be upgradeable immediately
post-install.  Not setting an Upgradeable condition is still fine, and
is equivalent to explicitly setting Upgradeable=True.

It's possible that we could guard against surprising Upgradeable
conditions during the test run, but it's acceptable for components to
go Upgradeable=False during updates (e.g. "while I am in this state, I
don't want you bumping the minor version again"), so I'm not touching
the stuff from 29598e6 (update e2e tests to use intervals,
2021-03-22, #26034).

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=1928141
[2]: https://prow.ci.openshift.org/view/gs/origin-ci-test/logs/release-openshift-ocp-installer-e2e-aws-4.8/1375324509623554048
  • Loading branch information
wking committed Apr 9, 2021
1 parent 0b4ab1c commit 82542ba
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/extended/operators/operators.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,21 +200,30 @@ func condition(cv objx.Map, condition string) objx.Map {
// It also returns a slice of types for which a condition entry was
// expected but not supplied on the ClusterOperator.
func surprisingConditions(co objx.Map) ([]configv1.ClusterOperatorStatusCondition, []configv1.ClusterStatusConditionType) {
name := co.Get("metadata.name").String()
var badConditions []configv1.ClusterOperatorStatusCondition
var missingTypes []configv1.ClusterStatusConditionType
for _, conditionType := range []configv1.ClusterStatusConditionType{
configv1.OperatorAvailable,
configv1.OperatorDegraded,
configv1.OperatorUpgradeable,
} {
cond := condition(co, string(conditionType))
if len(cond) == 0 {
missingTypes = append(missingTypes, conditionType)
if conditionType != configv1.OperatorUpgradeable {
missingTypes = append(missingTypes, conditionType)
}
} else {
expected := configv1.ConditionFalse
if conditionType == configv1.OperatorAvailable {
if conditionType == configv1.OperatorAvailable || conditionType == configv1.OperatorUpgradeable {
expected = configv1.ConditionTrue
}
if cond.Get("status").String() != string(expected) {
if conditionType == configv1.OperatorUpgradeable && (name == "kube-storage-version-migrator" || // https://bugzilla.redhat.com/show_bug.cgi?id=1928141
name == "openshift-controller-manager" || // https://bugzilla.redhat.com/show_bug.cgi?id=1948011
name == "service-ca") { // https://bugzilla.redhat.com/show_bug.cgi?id=1948012
continue
}
badConditions = append(badConditions, configv1.ClusterOperatorStatusCondition{
Type: conditionType,
Status: configv1.ConditionStatus(cond.Get("status").String()),
Expand Down

0 comments on commit 82542ba

Please sign in to comment.