Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCPBUGS-34535: Ignore case when compare platform #525

Merged
merged 2 commits into from
May 31, 2024

Conversation

Vincent056
Copy link

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.

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.
@Vincent056 Vincent056 changed the title Ignore case when compare platform OCPBUGS-34535: Ignore case when compare platform May 29, 2024
@openshift-ci-robot
Copy link
Collaborator

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

  • expected the bug to target the "4.17.0" version, but no target version was set

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:

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. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@BhargaviGudi
Copy link
Collaborator

/hold for test

@xiaojiey
Copy link
Collaborator

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
Copy link
Author

/retest

@Vincent056 Vincent056 force-pushed the node_profile branch 2 times, most recently from 2172152 to ffbdb60 Compare May 29, 2024 16:29
@rhmdnd
Copy link

rhmdnd commented May 29, 2024

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

@rhmdnd
Copy link

rhmdnd commented May 29, 2024

/retest-required

@Vincent056
Copy link
Author

/retest

@xiaojiey
Copy link
Collaborator

xiaojiey commented May 30, 2024

@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
Copy link

rhmdnd commented May 30, 2024

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

pkg/utils/platform.go Outdated Show resolved Hide resolved
We should ensure that we do not skip platform profile on ROSA classic, we do that by looking at cluster Infrastructure resource, checking the ControlPlaneTopology is External
Copy link

@rhmdnd rhmdnd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Waiting on CI results from rosa e2e tests, but this looks good.

Copy link

openshift-ci bot commented May 30, 2024

[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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@xiaojiey
Copy link
Collaborator

/label qe-approved

@xiaojiey
Copy link
Collaborator

/unhold

@xiaojiey
Copy link
Collaborator

/jira refresh

@openshift-ci-robot
Copy link
Collaborator

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

  • expected the bug to target the "4.17.0" version, but no target version was set

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:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@xiaojiey
Copy link
Collaborator

/jira refresh

@openshift-ci-robot
Copy link
Collaborator

@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:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested a review from xiaojiey May 31, 2024 06:41
@xiaojiey
Copy link
Collaborator

/lgtm

@openshift-merge-bot openshift-merge-bot bot merged commit 71cd27f into ComplianceAsCode:master May 31, 2024
14 checks passed
@openshift-ci-robot
Copy link
Collaborator

@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:

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. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants