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

Policy automation context details uses the wrong hub name

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • ACM 2.7.0
    • GRC
    • None
    • 1
    • False
    • Hide

      None

      Show
      None
    • False
    • ACM Sprint 25
    • Moderate
    • No

      Description of problem:

      I created automation that takes advantage of the context information provided to the job.  In particular I wanted to use the hub_cluster value so I can post a link in a slack message that points back to the policy in the console.  Unfortunately the hub_cluster value was set to:

      kubernetes.default.svc.cluster.local.

      Generated slack message is here: https://coreos.slack.com/archives/C027D98DCF7/p1670986435700909

       

      Full content of slack message:
      Policy backup-restore-enabled in namespace open-cluster-management-backup is NonCompliant
      Advanced Cluster Management Hub Policies and backup-restore-enabled Policy Details
      NonCompliant Managed Clusters
       ['local-cluster']

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

      How reproducible:

      Only tried once but it should be recreatable every time.

      Steps to Reproduce:

      1. Created automation using the playbook named grc_policy_context.yml here https://github.com/gparvin/ansible-tower-samples
      2. The definition of the job template only contained the slack token.  The other values are coming from the provided context.
      3. In the job that runs, the value provided for hub_cluster is wrong

      Actual results:

      Content in the AnsibleJob spec:

      spec:
        extra_vars:
          hub_cluster: kubernetes.default.svc.cluster.local.
          namespace: open-cluster-management-backup
          policy_name: backup-restore-enabled
          policy_set: []
          policy_violation_context:
            local-cluster:
              compliant: NonCompliant

      ...

      Expected results:

      The hub_cluster value above needs to be: ocp-411-release-t869h.dev08.red-chesterfield.com for this cluster

      It's part of the API server name in the Infrastructure resource: apiServerURL: https://api.ocp-411-release-t869h.dev08.red-chesterfield.com:6443 and probably can be obtained other ways too

      Additional info:

              mprahl Matthew Prahl
              gparvin-redhat Gus Parvin
              Derek Ho Derek Ho
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: