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

CFE-1065: Add range validation for placementGroupPartition #1265

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

chiragkyal
Copy link
Member

As per openshift/api#1897 (comment), we need to add webhook validation to check placementGroupPartition must be between 1 and 7

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 1, 2024
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jul 1, 2024

@chiragkyal: This pull request references CFE-1065 which is a valid jira issue.

In response to this:

As per openshift/api#1897 (comment), we need to add webhook validation to check placementGroupPartition must be between 1 and 7

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.

@chiragkyal
Copy link
Member Author

/assign @JoelSpeed

Comment on lines 750 to 751
if providerSpec.PlacementGroupPartition != 0 {
if providerSpec.PlacementGroupPartition < 1 || providerSpec.PlacementGroupPartition > 7 {
Copy link
Contributor

Choose a reason for hiding this comment

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

So, actually, the valid range here is < 0 || > 7 right? I think we can trim thing and bring it into one line. Leaving the comments to explain why it is that way

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, right. The actual validation (including defaulting) is < 0 || > 7. I earlier thought it would be easier to read if we kept them in separate lines.

I've updated it now to bring it into one line.

Signed-off-by: chiragkyal <ckyal@redhat.com>
Copy link
Contributor

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 2, 2024
Copy link
Contributor

openshift-ci bot commented Jul 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoelSpeed

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 2, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit e959540 into openshift:master Jul 2, 2024
23 of 26 checks passed
Copy link
Contributor

openshift-ci bot commented Jul 2, 2024

@chiragkyal: The following test 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/e2e-vsphere-operator 5e77ccd link false /test e2e-vsphere-operator

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.

@chiragkyal chiragkyal deleted the add-validation branch July 2, 2024 11:46
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-machine-api-operator-container-v4.17.0-202407021157.p0.ge959540.assembly.stream.el9 for distgit ose-machine-api-operator.
All builds following this will include this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants