From c0c5b357a50e9964c6012448a591ff86ca7c6bf4 Mon Sep 17 00:00:00 2001 From: Rutvik Date: Mon, 9 Dec 2024 13:04:41 +0530 Subject: [PATCH] Fixing rule checks for CMP-3034 --- .../confinement/security_profiles_operator_exists/rule.yml | 6 +++--- .../tests/ocp4/e2e-remediation.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/applications/openshift/confinement/security_profiles_operator_exists/rule.yml b/applications/openshift/confinement/security_profiles_operator_exists/rule.yml index f478f20a3ca..9a78fa5509e 100644 --- a/applications/openshift/confinement/security_profiles_operator_exists/rule.yml +++ b/applications/openshift/confinement/security_profiles_operator_exists/rule.yml @@ -20,20 +20,20 @@ ocil_clause: 'the security profiles operator is not installed' ocil: |- To check if the Security Profiles Operator is installed, run the following command: -
oc get sub -nopenshift-security-profiles security-profiles-operator-sub -ojsonpath='{.status.installedCSV}'
+
oc get sub -nopenshift-security-profiles security-profiles-operator -ojsonpath='{.status.installedCSV}'
the output should return the version of the CSV that represents the installed operator. severity: medium warnings: - general: |- - {{{ openshift_cluster_setting("/apis/operators.coreos.com/v1alpha1/namespaces/openshift-security-profiles/subscriptions/security-profiles-operator-sub") | indent(4) }}} + {{{ openshift_cluster_setting("/apis/operators.coreos.com/v1alpha1/namespaces/openshift-security-profiles/subscriptions/security-profiles-operator") | indent(4) }}} template: name: yamlfile_value vars: ocp_data: 'true' - filepath: /apis/operators.coreos.com/v1alpha1/namespaces/openshift-security-profiles/subscriptions/security-profiles-operator-sub + filepath: /apis/operators.coreos.com/v1alpha1/namespaces/openshift-security-profiles/subscriptions/security-profiles-operator yamlpath: .status.installedCSV values: - value: security-profiles-operator\.v.* diff --git a/applications/openshift/confinement/security_profiles_operator_exists/tests/ocp4/e2e-remediation.sh b/applications/openshift/confinement/security_profiles_operator_exists/tests/ocp4/e2e-remediation.sh index 2745e9d29c4..22bf0d608a0 100755 --- a/applications/openshift/confinement/security_profiles_operator_exists/tests/ocp4/e2e-remediation.sh +++ b/applications/openshift/confinement/security_profiles_operator_exists/tests/ocp4/e2e-remediation.sh @@ -16,6 +16,6 @@ oc wait -n openshift-security-profiles --for=condition=Available --timeout=300s deployment/security-profiles-operator echo "waiting the subscription to have .status.installedCSV" -while [ -z "$(oc get subscription security-profiles-operator-sub -nopenshift-security-profiles -o jsonpath='{.status.installedCSV}')" ]; do +while [ -z "$(oc get subscription security-profiles-operator -nopenshift-security-profiles -o jsonpath='{.status.installedCSV}')" ]; do sleep 3 done