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

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
    • CNF RAN Sprint 234, CNF RAN Sprint 235
    • 2
    • False
    • Hide

      None

      Show
      None

      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:

      
      

            angwang@redhat.com Angie Wang
            jche@redhat.com Jun Chen
            Bonnie Block Bonnie Block
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: