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

[TALM] ClusterVersion policy fails when using templates

XMLWordPrintable

    • Low
    • No
    • False
    • Hide

      None

      Show
      None

      This is a clone of issue OCPBUGS-17384. The following is the description of the original issue:

      This is a clone of issue OCPBUGS-16742. The following is the description of the original issue:

      Description of problem:

      
      Using the policy ClusterVersion with Templates does not work.
      
      Policy configured:
      
          - fileName: ClusterVersion.yaml 
            policyName: "config-policy"
            metadata:
              name: version
              annotations:
                ran.openshift.io/ztp-deploy-wave: "100"
            spec:
              channel: '{{hub fromConfigMap "" "site-data" (printf "%s-ocp-channel" .ManagedClusterName) hub}}'
              desiredUpdate:
                version: '{{hub fromConfigMap "" "site-data" (printf "%s-ocp-version" .ManagedClusterName) hub}}'
            status:
              history:
              - version: '{{hub fromConfigMap "" "site-data" (printf "%s-ocp-version" .ManagedClusterName) hub}}'
                state: "Completed"
      
      
      With the config-map:
      
        cloudransno-site8-ocp-channel: "stable-4.10"
        cloudransno-site8-ocp-version: "4.10.54"
      
      The CGU fails with the following message:
      
      oc get cgu -A
      NAMESPACE     NAME                AGE     STATE                  DETAILS
      ztp-install   cloudransno-site8   3m34s   InvalidPlatformImage   error response from update graph url https://api.openshift.com/api/upgrades_info/v1/graph?channel={{hub fromConfigMap "" "site-data" (printf "%s-ocp-channel" .ManagedClusterName) hub}}: 400
      
      

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

      
      ZTP rhel generator image:4.12
      
      

      How reproducible:

      
      100%
      
      

      Steps to Reproduce:

      1. Create the describe ClusterVersion policy using templates to set the OCP version and channel
      2. Deploy SNO cluster
      3. CGU created automatically during installation applies the policy
      

      Actual results:

      
      Policy not applied
      
      

      Expected results:

      
      Policy applied or error message more clear
      
      

      Additional info:

      
      System impact: Low, the value cannot be templates and must be hardcoded into the policy. It can affect production deployments when using group policies.
      
      

              jche@redhat.com Jun Chen
              openshift-crt-jira-prow OpenShift Prow Bot
              Joshua Clark Joshua Clark
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: