Skip to content
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

Surface information about installed version in Operator CR #270

Closed
anik120 opened this issue Jun 21, 2023 · 3 comments · Fixed by #679
Closed

Surface information about installed version in Operator CR #270

anik120 opened this issue Jun 21, 2023 · 3 comments · Fixed by #679

Comments

@anik120
Copy link
Contributor

anik120 commented Jun 21, 2023

When an operator is installed, there is no information about which version of the operator was installed:

$ $  kubectl get operator argocd-operator -o yaml 
apiVersion: operators.operatorframework.io/v1alpha1
kind: Operator
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"operators.operatorframework.io/v1alpha1","kind":"Operator","metadata":{"annotations":{},"name":"argocd-operator"},"spec":{"packageName":"argocd-operator"}}
  creationTimestamp: "2023-06-21T14:57:50Z"
  generation: 1
  name: argocd-operator
  resourceVersion: "10690"
  uid: 6e0c67a5-eb9c-41c6-a455-140b28714d34
spec:
  packageName: argocd-operator
status:
  conditions:
  - lastTransitionTime: "2023-06-21T14:57:51Z"
    message: resolved to "quay.io/operatorhubio/argocd-operator@sha256:1a9b3c8072f2d7f4d6528fa32905634d97b7b4c239ef9887e3fb821ff033fef6"
    observedGeneration: 1
    reason: Success
    status: "True"
    type: Resolved
  - lastTransitionTime: "2023-06-21T14:57:57Z"
    message: installed from "quay.io/operatorhubio/argocd-operator@sha256:1a9b3c8072f2d7f4d6528fa32905634d97b7b4c239ef9887e3fb821ff033fef6"
    observedGeneration: 1
    reason: Success
    status: "True"
    type: Installed
  installedBundleResource: quay.io/operatorhubio/argocd-operator@sha256:1a9b3c8072f2d7f4d6528fa32905634d97b7b4c239ef9887e3fb821ff033fef6
  resolvedBundleResource: quay.io/operatorhubio/argocd-operator@sha256:1a9b3c8072f2d7f4d6528fa32905634d97b7b4c239ef9887e3fb821ff033fef6

One has to confirm the version installed by cross referencing the image reference in the installedBundleResource field with a matching image reference for a BundleMetadata

$  kubectl get bundlemetadata operatorhubio-argocd-operator.v0.6.0 -o yaml | grep image 
  image: quay.io/operatorhubio/argocd-operator@sha256:1a9b3c8072f2d7f4d6528fa32905634d97b7b4c239ef9887e3fb821ff033fef6
  - image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
  - image: quay.io/argoprojlabs/argocd-operator@sha256:99aeec24cc406d06d18822347d9ac3ed053a702d8419191e4e681075fed7b9bb
  - image: quay.io/operatorhubio/argocd-operator@sha256:1a9b3c8072f2d7f4d6528fa32905634d97b7b4c239ef9887e3fb821ff033fef6

The output above confirms that the latest version of the argocd operator, v0.6.0, was installed, but one can land on that information only if one is aware of the the fact that deppy currently chooses the latest version of the operator regardless of any other constraints. This information about which version is installed should be surfaced in the Operator status, instead of requiring the user to hunt down information to confirm the installed version, which in turns requires knowledge of the inner workings of sub-components that operator-controller relies on.

@tlwu2013
Copy link
Contributor

FYI, @pgodowski, this is the issue @m1kola shared in today's upstream meeting for tracking how to better surface the "installed version" to users. (cc @kevinrizza, @joelanford, @dmesser)

@joelanford
Copy link
Member

It should be fairly trivial to get some of this metadata into the Operator status. There are a few nuances to consider though. Right now, all of this metadata is derived only from the catalog. So there are some scenarios to think about:

  1. What if the installed operator disappears from the catalog?
  2. What if the catalog changes in a way that the existing installed bundle gets new metadata? This would definitely be something we'd recommend against, but as things stand today, there's no mechanism to enforce that bundle metadata doesn't change in a catalog.
  3. If/when we get to the point of making the Operator API support installation without dereferencing from a catalog, do we expect to pull this metadata from the bundle? (I think absolutely yes, and this plays into item (2). Ideally the catalog contains just a pointer to a bundle, and its really the bundle that carries the metadata, not the catalog).

@ncdc
Copy link
Member

ncdc commented Nov 29, 2023

  1. That must not negatively affect an installed Operator
  2. That must not affect an installed Operator
  3. Yes, the metadata needs to come from the bundle. It's probably ok for the catalog to have a copy of the metadata, but the bundle should be the final source of truth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants