Uploaded image for project: 'Red Hat Advanced Cluster Management'
  1. Red Hat Advanced Cluster Management
  2. ACM-12565

[RFE] Expose root policy metadata as hub template context variable

XMLWordPrintable

    • Icon: Epic Epic
    • Resolution: Duplicate
    • Icon: Undefined Undefined
    • None
    • None
    • GRC
    • None
    • [RFE] Expose root policy metadata as hub template context variable
    • False
    • None
    • False
    • Not Selected
    • To Do

      As a user managing Policies in a GitOps process the same Policy will end up in multiple namespaces as determined by a release/change process.

      Look up functions are limited in hub policies such that they can only gather data from the namespace where the root policy exists. In the above scenario the namespace is not known.

      Leaving the namespace blank currently works, but this is not documented behavior and could change in the future.

      data: '{{hub copySecretData "" "collector-tls" hub}}'
      

      Creating a context variable "rootPolicyMetadata" which contains the namespace and name would allow for explicit notation of the namespace.

      data: '{{hub copySecretData .rootPolicyMetadata.namespace "collector-tls" hub}}'
      

      or

      data: '{{hub (lookup "policy.open-cluster-management.io/v1" "Policy" .rootPolicyMetadata.namespace .rootPolicyMetadata.name).status.compliant hub}}'
      

            Unassigned Unassigned
            mprahl Matthew Prahl
            Derek Ho Derek Ho
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: