-
Bug
-
Resolution: Done-Errata
-
Undefined
-
4.13.z
-
None
-
No
-
CNF RAN Sprint 245, CNF RAN Sprint 247
-
2
-
False
-
-
Feature
-
Proposed
-
Description of problem:
When trying to create a CGU targetting a policy that uses object-templates-raw the talm operator marks the CGU as invalid due to a validation error. ERROR controllers.ClusterGroupUpgrade Policy is invalid {"error": "leaf-hubs-deploy-ztp-pipeline: policy is missing its spec.policy-templates.objectDefinition.spec.object-templates"} The validation should include object-templates-raw as well.
Version-Release number of selected component (if applicable):
4.13.X
How reproducible:
Always
Steps to Reproduce:
Use this policy: apiVersion: policy.open-cluster-management.io/v1 kind: Policy metadata: annotations: policy.open-cluster-management.io/categories: CM Configuration Management policy.open-cluster-management.io/controls: CM-2 Baseline Configuration policy.open-cluster-management.io/standards: NIST SP 800-53 ran.openshift.io/ztp-deploy-wave: "15" name: leaf-hubs-apply-vendor-label namespace: ztp-policies spec: disabled: false policy-templates: - objectDefinition: apiVersion: policy.open-cluster-management.io/v1 kind: ConfigurationPolicy metadata: name: apply-vendor-label-to-leaf-hubs spec: evaluationInterval: compliant: 10m noncompliant: 10s namespaceselector: exclude: - kube-* include: - '*' object-templates-raw: | {{- range (lookup "cluster.open-cluster-management.io/v1" "ManagedCluster" "" "").items }} {{- if eq (index .metadata.labels "leaf-hub") "true" }} - complianceType: musthave objectDefinition: apiVersion: cluster.open-cluster-management.io/v1 kind: ManagedCluster metadata: name: {{ .metadata.name }} labels: vendor: "OpenShift" {{- end }} {{- end }} remediationAction: inform severity: low remediationAction: inform
Actual results:
CGU reads the policy and validation fails.
Expected results:
CGU reads the policy and creates the enforce version.
Additional info:
https://redhat-internal.slack.com/archives/C02EG99MR9C/p1699288532177459
- blocks
-
OCPBUGS-25433 TALM doesn's support policies with object-templates-raw only
- Closed
- is cloned by
-
OCPBUGS-25433 TALM doesn's support policies with object-templates-raw only
- Closed
- links to
-
RHEA-2023:123645 OpenShift Container Platform 4.15.0 CNF vRAN extras update
- mentioned on
(1 mentioned on)