Bug 1973450 - operator-lifecycle-manager ClusterOperator does not set reason for some conditions
Summary: operator-lifecycle-manager ClusterOperator does not set reason for some condi...
Keywords:
Status: CLOSED DUPLICATE of bug 1973451
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.8
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: 4.8.0
Assignee: Kevin Rizza
QA Contact: Jian Zhang
URL:
Whiteboard:
Depends On: 1955761
Blocks: 1962302
TreeView+ depends on / blocked
 
Reported: 2021-06-17 20:57 UTC by W. Trevor King
Modified: 2021-06-18 20:19 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1955761
Environment:
[bz-OLM] clusteroperator/operator-lifecycle-manager-packageserver should not change condition/Available
Last Closed: 2021-06-18 15:55:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description W. Trevor King 2021-06-17 20:57:49 UTC
+++ This bug was initially created as a clone of Bug #1955761 +++

+++ This bug was initially created as a clone of Bug #1945443 +++

Like bug 1945443, which was for the packageserver ClusterOperator, the operator-lifecycle-manager ClusterOperator does not seem to set reasons, and mostly does not set messages either.  From 4.8.0-rc.0 CI [1]:

$ curl -s https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/logs/release-openshift-origin-installer-e2e-aws-upgrade/1404846426944442368/artifacts/e2e-aws-upgrade/clusteroperators.json | jq -r '.items[] | select(.metadata.name == "operator-lifecycle-manager").status.conditions[]'
{
  "lastTransitionTime": "2021-06-15T18:21:20Z",
  "status": "False",
  "type": "Degraded"
}
{
  "lastTransitionTime": "2021-06-15T19:36:59Z",
  "message": "Deployed 0.17.0",
  "status": "False",
  "type": "Progressing"
}
{
  "lastTransitionTime": "2021-06-15T18:21:20Z",
  "status": "True",
  "type": "Available"
}
{
  "lastTransitionTime": "2021-06-15T18:21:20Z",
  "status": "True",
  "type": "Upgradeable"
}

Looking in a master checkout, I see a few things that might be attempts to set Reason on ClusterOperator:

$ git --no-pager log --oneline -1
b374b245 (HEAD -> master, origin/master, origin/HEAD) Merge pull request #2205 from benluddy/resurrect-metrics-service-templates
$ git --no-pager grep '\([.]\|\t\)Reason\(:\| = \)' pkg
pkg/controller/bundle/bundle_unpacker.go:                       pendingCond.Reason = CatalogSourceMissingReason
pkg/controller/bundle/bundle_unpacker.go:               failedCond.Reason = jobCond.Reason
pkg/controller/bundle/bundle_unpacker.go:                       pendingCond.Reason = JobIncompleteReason
pkg/controller/install/status_viewer.go:const TimedOutReason = "ProgressDeadlineExceeded"
pkg/controller/operators/catalog/subscription/state.go:         cond.Reason = v1alpha1.UnhealthyCatalogSourceFound
pkg/controller/operators/catalog/subscription/state.go:         cond.Reason = v1alpha1.AllCatalogSourcesHealthy
pkg/controller/operators/catalog/subscription/state.go:         cond.Reason = v1alpha1.CatalogSourcesAdded
pkg/controller/operators/catalog/subscription/state.go:         cond.Reason = v1alpha1.CatalogSourcesDeleted
pkg/controller/operators/catalog/subscription/state.go:         cond.Reason = v1alpha1.NoCatalogSourcesFound
pkg/controller/operators/catalog/subscription/state.go:                         cond.Reason = v1alpha1.CatalogSourcesUpdated
pkg/controller/operators/catalog/subscription/state.go:         cond.Reason = v1alpha1.ReferencedInstallPlanNotFound
pkg/controller/operators/catalog/subscription/state.go:         cond.Reason = v1alpha1.InstallPlanNotYetReconciled
pkg/controller/operators/catalog/subscription/state.go:                 cond.Reason = string(phase)
pkg/controller/operators/catalog/subscription/state.go:                 cond.Reason = string(installedCond.Reason)
pkg/controller/operators/catalog/subscription/state.go:                 cond.Reason = v1alpha1.InstallPlanFailed
pkg/controller/operators/decorators/operator_test.go:                                           csv.Status.Reason = operatorsv1alpha1.CSVReasonInstallSuccessful
pkg/controller/operators/olm/operator_test.go:  out.Status.Reason = reason
pkg/controller/operators/olm/operator_test.go:  csv.Status.Reason = reason
pkg/controller/operators/olm/operator_test.go:  operatorCSVFinal.Status.Reason = v1alpha1.CSVReasonInstallSuccessful
pkg/controller/operators/olm/operator_test.go:  operatorCSVFailedNoTargetNS.Status.Reason = v1alpha1.CSVReasonNoTargetNamespaces
pkg/controller/operators/olm/operator_test.go:  targetCSV.Status.Reason = v1alpha1.CSVReasonCopied
pkg/controller/operators/olm/operatorgroup.go:          newCSV.Status.Reason = v1alpha1.CSVReasonCopied
pkg/controller/operators/olm/operatorgroup.go:          createdCSV.Status.Reason = v1alpha1.CSVReasonCopied
pkg/controller/operators/openshift/clusteroperator_controller.go:                       desired.Reason = IncompatibleOperatorsInstalled
pkg/lib/operatorstatus/builder.go:      existing.Reason = condition.Reason
pkg/lib/operatorstatus/status.go:       existingCondition.Reason = newCondition.Reason

But obviously there are some gaps.  For example Upgradeable has no reason or message in the happy case [2], but is setting a reason and message in the sad case [3].

[1]: https://prow.ci.openshift.org/view/gs/origin-ci-test/logs/release-openshift-origin-installer-e2e-aws-upgrade/1404846426944442368
[2]: https://github.com/operator-framework/operator-lifecycle-manager/blob/b374b2456335e191ba53ff0eca8c488205ed1ee2/pkg/controller/operators/openshift/clusteroperator_controller.go#L216-L220
[3]: https://github.com/operator-framework/operator-lifecycle-manager/blob/b374b2456335e191ba53ff0eca8c488205ed1ee2/pkg/controller/operators/openshift/clusteroperator_controller.go#L235-L240

Comment 2 W. Trevor King 2021-06-18 20:19:21 UTC
Oops, yeah, looks like I just double-tapped or something.  Closing as a dup of 1973451 makes sense; thanks :)


Note You need to log in before you can comment on or make changes to this bug.