Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-22838

Specifying Operator version for Cluster managed through TALM broken

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Undefined Undefined
    • None
    • 4.12
    • TALM Operator
    • None
    • No
    • False
    • Hide

      None

      Show
      None

      Description of problem:
      On our managed clusters, we are deploying a number of Operators and we need to specify the version of each Operator through the `status.installedCSV` field as described in the documentation.

       

      This does however not work, as shown below

          - fileName: Subscription.yaml
            policyName: "subscription-policy"
            metadata:
              name: sriov-network-operator-subscription
              namespace: openshift-sriov-network-operator
            spec:
              name: sriov-network-operator
              channel: "4.12"
              startingCSV: "sriov-network-operator.v4.12.0-202306031829"
            status:
              installedCSV: "sriov-network-operator.v4.12.0-202306031829"

      And my Subscription.yaml [1]:

      apiVersion: operators.coreos.com/v1alpha1
      kind: Subscription
      metadata:
        annotations:
          ran.openshift.io/ztp-deploy-wave: "2"
      spec:
        source: redhat-operators
        sourceNamespace: openshift-marketplace
        installPlanApproval: Manual

      Creates the rendered policy:

              - complianceType: musthave
                objectDefinition:
                  apiVersion: operators.coreos.com/v1alpha1
                  kind: Subscription
                  metadata:
                    name: local-storage-operator
                    namespace: openshift-local-storage
                  spec:
                    channel: stable
                    installPlanApproval: Manual
                    name: local-storage-operator
                    source: redhat-operators
                    sourceNamespace: openshift-marketplace
                    startingCSV: local-storage-operator.v4.12.0-202305262042
                  status:
                    installedCSV: local-storage-operator.v4.12.0-202305262042

      And end result:

      $ sno0 get subs -n openshift-local-storage local-storage-operator -o yaml
      apiVersion: operators.coreos.com/v1alpha1
      kind: Subscription
      metadata:
        creationTimestamp: "2023-10-30T21:33:40Z"
        generation: 1
        labels:
          operators.coreos.com/local-storage-operator.openshift-local-storage: ""
        name: local-storage-operator
        namespace: openshift-local-storage
        resourceVersion: "22397"
        uid: 94759565-a9a3-490b-8982-3dc07f9b2bca
      spec:
        channel: stable
        installPlanApproval: Manual
        name: local-storage-operator
        source: redhat-operators
        sourceNamespace: openshift-marketplace
        startingCSV: local-storage-operator.v4.12.0-202305262042
      status:
        catalogHealth:
      <...snip...>
        currentCSV: local-storage-operator.v4.12.0-202310170157
        installPlanGeneration: 2
        installPlanRef:
          apiVersion: operators.coreos.com/v1alpha1
          kind: InstallPlan
          name: install-f75rb
          namespace: openshift-local-storage
          resourceVersion: "20879"
          uid: 2b28e46a-7d9c-49ad-8719-134b1e31b8b4
        installedCSV: local-storage-operator.v4.12.0-202310170157
        installplan:
          apiVersion: operators.coreos.com/v1alpha1
          kind: InstallPlan
          name: install-f75rb
          uuid: 2b28e46a-7d9c-49ad-8719-134b1e31b8b4
        lastUpdated: "2023-10-30T21:37:34Z"
        state: AtLatestKnown

      $ sno0 get ip -n openshift-local-storage
      NAME            CSV                                           APPROVAL   APPROVED
      install-f75rb   local-storage-operator.v4.12.0-202310170157   Manual     true
      install-jhj8z   local-storage-operator.v4.12.0-202305262042   Manual     true

       

      Version-Release number of selected component (if applicable):
      4.12.4

       

      TALM operator seems to be approving InstallPlans to reach the latest version, no matter how you configure your Policy for a subscription with a concrete version.

            jche@redhat.com Jun Chen
            rhn-gps-djuran David Juran
            Yang Liu Yang Liu
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: