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

When using hub side templates the policy on the spoke cluster doesn't become compliant due to missing ConfigMap on the hub cluster

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Undefined
    • None
    • 4.12
    • GitOps ZTP
    • False
    • Hide

      None

      Show
      None

    Description

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

      Description of problem:

      When using hub side templates the policy on the spoke cluster doesn't become compliant due to missing ConfigMap on the hub cluster.

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

      4.12

      How reproducible:

      100%

      Steps to Reproduce:

      1. Configure the spoke cluster using the following template PGTs:
      
      http://registry.kni-qe-0.lab.eng.rdu2.redhat.com:3000/kni-qe/ztp-site-configs/src/sealusa2-4.11/policygentemplates/group-du-sno-ranGen.yaml
      
      2. Check spoke cluster policies status
      
      3. oc -n spoke-1 get policies ztp-install.spoke-1-group-du-sno-config-policy-9r49m -o yaml 

      Actual results:

      NonCompliant because it cannot find the ConfigMap expected by the template
      
        - compliant: NonCompliant
          history:
          - eventName: ztp-install.spoke-1-group-du-sno-config-policy-9r49m.17199a792c5cf820
            lastTimestamp: "2022-09-30T09:49:42Z"
            message: 'NonCompliant; violation - failed to resolve the template {"apiVersion":"policy.open-cluster-management.io/v1","kind":"ConfigurationPolicy","metadata":{"name":"spoke-1-group-du-sno-config-policy-config-m2frx"},"spec":{"evaluationInterval":{"compliant":"10m","noncompliant":"10s"},"namespaceselector":{"exclude":["kube-*"],"include":["*"]},"object-templates":[{"complianceType":"musthave","objectDefinition":{"apiVersion":"operator.openshift.io/v1","kind":"Console","metadata":{"annotations":{"include.release.openshift.io/ibm-cloud-managed":"false","include.release.openshift.io/self-managed-high-availability":"false","include.release.openshift.io/single-node-developer":"false","release.openshift.io/create-only":"true"},"name":"cluster"},"spec":{"logLevel":"Normal","managementState":"Removed","operatorLogLevel":"Normal"}}},{"complianceType":"musthave","objectDefinition":{"apiVersion":"sriovnetwork.openshift.io/v1","kind":"SriovOperatorConfig","metadata":{"name":"default","namespace":"openshift-sriov-network-operator"},"spec":{"configDaemonNodeSelector":{"node-role.kubernetes.io/master":""},"disableDrain":true,"enableInjector":false,"enableOperatorWebhook":false}}},{"complianceType":"musthave","objectDefinition":{"apiVersion":"operator.openshift.io/v1","kind":"Network","metadata":{"labels":{"machineconfiguration.openshift.io/role":"master"},"name":"cluster"},"spec":{"disableNetworkDiagnostics":true}}},{"complianceType":"musthave","objectDefinition":{"apiVersion":"sriovnetwork.openshift.io/v1","kind":"SriovNetwork","metadata":{"name":"sriov-nw-du-fh","namespace":"openshift-sriov-network-operator"},"spec":{"networkNamespace":"openshift-sriov-network-operator","resourceName":"du_fh","vlan":"{{hub
              fromConfigMap \"ztp-install\" \"ztp-group.sriovdata\" (printf \"%s-du_fh-vlan\"
              .ManagedClusterName) | toInt hub}}"}}},{"complianceType":"musthave","objectDefinition":{"apiVersion":"sriovnetwork.openshift.io/v1","kind":"SriovNetworkNodePolicy","metadata":{"name":"sriov-nnp-du-fh","namespace":"openshift-sriov-network-operator"},"spec":{"deviceType":"netdevice","isRdma":true,"nicSelector":{"pfNames":["{{hub
              fromConfigMap \"ztp-install\" \"ztp-group.sriovdata\" (printf \"%s-du_fh-pf\"
              .ManagedClusterName) | autoindent hub}}"]},"nodeSelector":{"node-role.kubernetes.io/master":""},"numVfs":"{{hub
              fromConfigMap \"ztp-install\" \"ztp-group.sriovdata\" (printf \"%s-du_fh-numVfs\"
              .ManagedClusterName) | toInt hub}}","priority":"{{hub fromConfigMap \"ztp-install\"
              \"ztp-group.sriovdata\" (printf \"%s-du_fh-priority\" .ManagedClusterName)
              | toInt hub}}","resourceName":"du_fh"}}},{"complianceType":"musthave","objectDefinition":{"apiVersion":"sriovnetwork.openshift.io/v1","kind":"SriovNetwork","metadata":{"name":"sriov-nw-du-mh","namespace":"openshift-sriov-network-operator"},"spec":{"networkNamespace":"openshift-sriov-network-operator","resourceName":"du_mh","vlan":"{{hub
              fromConfigMap \"ztp-install\" \"ztp-group.sriovdata\" (printf \"%s-du_mh-vlan\"
              .ManagedClusterName) | toInt hub}}"}}},{"complianceType":"musthave","objectDefinition":{"apiVersion":"sriovnetwork.openshift.io/v1","kind":"SriovNetworkNodePolicy","metadata":{"name":"sriov-nnp-du-mh","namespace":"openshift-sriov-network-operator"},"spec":{"deviceType":"vfio-pci","isRdma":false,"nicSelector":{"pfNames":["{{hub
              fromConfigMap \"ztp-install\" \"ztp-group.sriovdata\" (printf \"%s-du_mh-pf\"
              .ManagedClusterName)  hub}}"]},"nodeSelector":{"node-role.kubernetes.io/master":""},"numVfs":"{{hub
              fromConfigMap \"ztp-install\" \"ztp-group.sriovdata\" (printf \"%s-du_mh-numVfs\"
              .ManagedClusterName) | toInt hub}}","priority":"{{hub fromConfigMap \"ztp-install\"
              \"ztp-group.sriovdata\" (printf \"%s-du_mh-priority\" .ManagedClusterName)
              | toInt hub}}","resourceName":"du_mh"}}}],"remediationAction":"inform","severity":"low"}}:
              template: tmpl:63:22: executing "tmpl" at <fromConfigMap "ztp-install" "ztp-group.sriovdata"
              (printf "%s-du_fh-vlan" .ManagedClusterName)>: error calling fromConfigMap:
              failed getting the ConfigMap ztp-group.sriovdata from ztp-install: configmaps
              "ztp-group.sriovdata" not found'

      Expected results:

       

      Additional info:

       

      Attachments

        Issue Links

          Activity

            People

              rhn-support-imiller Ian Miller
              openshift-crt-jira-prow OpenShift Prow Bot
              Marius Cornea Marius Cornea
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: