ComplianceAsCode / compliance-operator

Operator providing Kubernetes cluster compliance checks
Apache License 2.0
36 stars 22 forks source link

OCPBUGS-34535: Ignore case when compare platform #525

Closed Vincent056 closed 2 months ago

Vincent056 commented 2 months ago

Let's ignore the case when comparing the case here, this should avoid issue if someone sets Platform environment to lower cased value. Such as rosa instead of ROSA.

openshift-ci-robot commented 2 months ago

@Vincent056: This pull request references Jira Issue OCPBUGS-34535, which is invalid:

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to [this](https://github.com/ComplianceAsCode/compliance-operator/pull/525): >Let's ignore the case when comparing the case here, this should avoid issue if someone sets Platform environment to lower cased value. Such as rosa instead of ROSA. Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=ComplianceAsCode%2Fcompliance-operator). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
BhargaviGudi commented 2 months ago

/hold for test

xiaojiey commented 2 months ago

Sorry, the test partially finished today.

  1. ROSA+CO from this PR: all profiles are good.
  2. Rosa hcp + CO from this PR: to be tested
Vincent056 commented 2 months ago

/retest

rhmdnd commented 2 months ago

All e2e tests failed with the same error - which looks unrelated to this change.

rhmdnd commented 2 months ago

/retest-required

Vincent056 commented 2 months ago

/retest

xiaojiey commented 2 months ago

@Vincent056 Could you please help to double check? On rosa hcp, I can see all profiles listed. Thanks.

1. Check profiles on rosa hcp(no matter PLATFORM env added in sub or not):
% oc get csv
NAME                         DISPLAY               VERSION   REPLACES   PHASE
compliance-operator.v1.4.1   Compliance Operator   1.4.1                Succeeded
% oc get ss
NAME      AGE
default   6m52s
% oc get sub compliance-operator-sub -o=jsonpath={.spec.config}                      
{"nodeSelector":{"node-role.kubernetes.io/worker":""}}% 
% oc get clusterclaims/product.open-cluster-management.io -o jsonpath='{.spec.value}'          
ROSA%                                                                                                                                                                % oc get infrastructures.config.openshift.io cluster -o=jsonpath={.status.controlPlaneTopology}
External%                                                                                                                                                            xiyuan@xiyuan- % oc get profile
NAME                             AGE     VERSION
ocp4-bsi                         6m58s   2022
ocp4-bsi-2022                    6m59s   2022
ocp4-bsi-node                    6m58s   2022
ocp4-bsi-node-2022               6m59s   2022
ocp4-cis                         6m58s   1.5.0
ocp4-cis-1-4                     6m58s   1.4.0
ocp4-cis-1-5                     6m58s   1.5.0
ocp4-cis-node                    6m58s   1.5.0
ocp4-cis-node-1-4                6m58s   1.4.0
ocp4-cis-node-1-5                6m58s   1.5.0
ocp4-e8                          6m58s   
ocp4-high                        6m57s   Revision 4
ocp4-high-node                   6m57s   Revision 4
ocp4-high-node-rev-4             6m57s   Revision 4
ocp4-high-rev-4                  6m57s   Revision 4
ocp4-moderate                    6m57s   Revision 4
ocp4-moderate-node               6m57s   Revision 4
ocp4-moderate-node-rev-4         6m57s   Revision 4
ocp4-moderate-rev-4              6m57s   Revision 4
ocp4-nerc-cip                    6m57s   
ocp4-nerc-cip-node               6m57s   
ocp4-pci-dss                     6m57s   3.2.1
ocp4-pci-dss-3-2                 6m57s   3.2.1
ocp4-pci-dss-4-0                 6m57s   4.0.0
ocp4-pci-dss-node                6m57s   3.2.1
ocp4-pci-dss-node-3-2            6m57s   3.2.1
ocp4-pci-dss-node-4-0            6m57s   4.0.0
ocp4-stig                        6m57s   V1R1
ocp4-stig-node                   6m57s   V1R1
ocp4-stig-node-v1r1              6m57s   V1R1
ocp4-stig-v1r1                   6m57s   V1R1
rhcos4-anssi-bp28-enhanced       6m54s   
rhcos4-anssi-bp28-high           6m54s   
rhcos4-anssi-bp28-intermediary   6m53s   
rhcos4-anssi-bp28-minimal        6m53s   
rhcos4-bsi                       6m53s   2022
rhcos4-bsi-2022                  6m53s   2022
rhcos4-e8                        6m53s   
rhcos4-high                      6m53s   Revision 4
rhcos4-high-rev-4                6m53s   Revision 4
rhcos4-moderate                  6m53s   Revision 4
rhcos4-moderate-rev-4            6m53s   Revision 4
rhcos4-nerc-cip                  6m53s   
rhcos4-stig                      6m52s   V1R1
rhcos4-stig-v1r1                 6m52s   V1R1
==================================
2. Check profiles on ROSA
% oc get csv compliance-operator.v1.4.1
NAME                         DISPLAY               VERSION   REPLACES   PHASE
compliance-operator.v1.4.1   Compliance Operator   1.4.1                Succeeded
% oc get ss
NAME                 AGE
default              9m56s
default-auto-apply   9m56s
% oc get profile.compliance --no-headers | wc -l
      45
rhmdnd commented 2 months ago

Looks like we're seeing the same issue reported in e2e:

main_test.go:50: found an unexpected profile type: ocp4-bsi of type Platform
openshift-ci[bot] commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhmdnd, Vincent056

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/ComplianceAsCode/compliance-operator/blob/master/OWNERS)~~ [Vincent056,rhmdnd] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
xiaojiey commented 2 months ago

/label qe-approved

xiaojiey commented 2 months ago

/unhold

xiaojiey commented 2 months ago

/jira refresh

openshift-ci-robot commented 2 months ago

@xiaojiey: This pull request references Jira Issue OCPBUGS-34535, which is invalid:

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

In response to [this](https://github.com/ComplianceAsCode/compliance-operator/pull/525#issuecomment-2141199338): >/jira refresh Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=ComplianceAsCode%2Fcompliance-operator). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
xiaojiey commented 2 months ago

/jira refresh

openshift-ci-robot commented 2 months ago

@xiaojiey: This pull request references Jira Issue OCPBUGS-34535, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug * bug is open, matching expected state (open) * bug target version (4.17.0) matches configured target version for branch (4.17.0) * bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact: /cc @xiaojiey

In response to [this](https://github.com/ComplianceAsCode/compliance-operator/pull/525#issuecomment-2141329374): >/jira refresh Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=ComplianceAsCode%2Fcompliance-operator). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
xiaojiey commented 2 months ago

/lgtm

openshift-ci-robot commented 2 months ago

@Vincent056: Jira Issue OCPBUGS-34535: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-34535 has been moved to the MODIFIED state.

In response to [this](https://github.com/ComplianceAsCode/compliance-operator/pull/525): >Let's ignore the case when comparing the case here, this should avoid issue if someone sets Platform environment to lower cased value. Such as rosa instead of ROSA. Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=ComplianceAsCode%2Fcompliance-operator). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.