operator-controller
operator-controller copied to clipboard
`installedBundleResource` and `resolvedBundleResource` are being removed from `Operator`'s status
It seems like we remove installedBundleResource and resolvedBundleResource from Operator's status in case of errors.
Steps to reproduce
- Run the operators from master:
make run - Create a catalog:
kubectl apply -f config/samples/catalogd_operatorcatalog.yaml - Create an operator
kubectl apply -f - <<EOF apiVersion: operators.operatorframework.io/v1alpha1 kind: Operator metadata: labels: app.kubernetes.io/name: operator app.kubernetes.io/instance: operator-sample app.kubernetes.io/part-of: operator-controller app.kubernetes.io/managed-by: kustomize app.kubernetes.io/created-by: operator-controller name: operator-sample spec: packageName: project-quay channel: stable-3.8 version: 3.8.1 EOF - Wait for the operator to be installed:
kubectl wait operators operator-sample --for condition=Installed - Observe presense of
.status.installedBundleResourceand.status.resolvedBundleResource
Output:kubectl get operator operator-sample -o json | jq ".status | {installedBundleResource, resolvedBundleResource}"{ "installedBundleResource": "quay.io/operatorhubio/project-quay@sha256:acc366f665ee728e18941e55d28d2c70f1a8848e183abc1ca3202cb00a75370f", "resolvedBundleResource": "quay.io/operatorhubio/project-quay@sha256:acc366f665ee728e18941e55d28d2c70f1a8848e183abc1ca3202cb00a75370f" } - Edit operator to have invalid version:
kubectl patch operator operator-sample --type json -p '[{"op": "replace", "path": "/spec/version", "value": "123123.0.0"}]' - Observe that these fields are now gone:
Output:kubectl get operator operator-sample -o json | jq "{installedBundleResource: .status.installedBundleResource, resolvedBundleResource: .status.resolvedBundleResource}"{ "installedBundleResource": null, "resolvedBundleResource": null }
Expected result
Not sure about resolvedBundleResource, but I think installedBundleResource should still be present becuase it indicates what is currently installed.