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

WIP: NO-JIRA: Validate the CPU architectures set by users in the CRs #7224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aleskandro
Copy link
Member

@aleskandro aleskandro commented Jan 24, 2025

There is an inconsistency about the name of the architecture to use in the InfraEnv and other CRDs using the OSImage object. Users can easily provide a "wrong" value for the CPUArchitecture fields in such CRs and no error would arise at creation time as they are not validated, making it harder for the user to debug and understand how to proceed with their deployment.

This commit adds validation for the architecture field among the values in the set {arm64, ppc64le, s390x, x86_64}

Related to #4441 openshift/release#60815

There is an inconsistency about the name of the architecture to use in the InfraEnv and other CRDs using the OSImage object.
Users can easily provide a different string for the CPUArchitecture fields in such CRs and no error would arise from them as they are not validated, making it harder for the user to debug and understand how to proceed with their deployment.

This commit adds validation for the architecture field among the values in the set {arm64, ppc64le, s390x, x86_64}

Related to openshift#4441
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 24, 2025
@openshift-ci-robot
Copy link

@aleskandro: This pull request explicitly references no jira issue.

In response to this:

There is an inconsistency about the name of the architecture to use in the InfraEnv and other CRDs using the OSImage object. Users can easily provide a different string for the CPUArchitecture fields in such CRs and no error would arise from them as they are not validated, making it harder for the user to debug and understand how to proceed with their deployment.

This commit adds validation for the architecture field among the values in the set {arm64, ppc64le, s390x, x86_64}

Related to #4441

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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 added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 24, 2025
@openshift-ci openshift-ci bot added the api-review Categorizes an issue or PR as actively needing an API review. label Jan 24, 2025
Copy link

openshift-ci bot commented Jan 24, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: aleskandro
Once this PR has been reviewed and has the lgtm label, please assign paul-maidment for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@aleskandro
Copy link
Member Author

/cc @jeffdyoung

i'm not sure these are the expected values, but having at least some validation would mitigate the incosistencies in the architecture naming

@openshift-ci openshift-ci bot requested a review from jeffdyoung January 24, 2025 11:07
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.89%. Comparing base (dd3c75d) to head (904a104).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7224      +/-   ##
==========================================
- Coverage   67.90%   67.89%   -0.01%     
==========================================
  Files         298      298              
  Lines       40710    40710              
==========================================
- Hits        27643    27640       -3     
- Misses      10590    10592       +2     
- Partials     2477     2478       +1     

see 2 files with indirect coverage changes

Copy link

openshift-ci bot commented Jan 24, 2025

@aleskandro: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-e2e-aws-ovn 904a104 link false /test okd-scos-e2e-aws-ovn
ci/prow/edge-verify-generated-code 904a104 link true /test edge-verify-generated-code

Full PR test history. Your PR dashboard.

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review Categorizes an issue or PR as actively needing an API review. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants