-
Bug
-
Resolution: Done
-
Major
-
None
-
ACM 2.7.0
-
None
-
1
-
False
-
-
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:
- Created automation using the playbook named grc_policy_context.yml here https://github.com/gparvin/ansible-tower-samples
- The definition of the job template only contained the slack token. The other values are coming from the provided context.
- 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