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

hub side lookup function on managed cluster itself for policy templating should be allowed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Major Major
    • None
    • 4.10.z
    • TALM Operator
    • No
    • False
    • Hide

      None

      Show
      None

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

      Description of problem:

      TALM rejects policies with any lookup functions. However, lookup on resources in the cluster namespace should work:
      
                  data:
                    test: |
                      key1: value1
                      key2:
                        testing: {{hub (lookup "cluster.open-cluster-management.io/v1" "ManagedCluster" "" .ManagedClusterName).metadata.labels.iantest hub}}
      
      
      If this is allowed, it will enable many cluster specific templating to be done on the hub side for customers who would have to do spoke side templating instead (which is strongly discouraged)
      
      

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

      
      

      How reproducible:

      
      

      Steps to Reproduce:

      1. Create a policy with templatized fields with lookup functions like the above
      2. Create a CGU to roll it out
      3.
      

      Actual results:

      Rejected as lookup function in general is not allowed:
      1.6806157862255638e+09	ERROR	controllers.ClusterGroupUpgrade	Failed to resolve hub template	{"error": "lookup: template function is not supported in TALM"}
      
      
      

      Expected results:

      Policy remediated properly
      

      Additional info:

      
      

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

              Created:
              Updated:
              Resolved: