Skip to content

Conversation

@RadekManak
Copy link
Contributor

@RadekManak RadekManak commented Nov 4, 2025

This PR adds validating webhook for new ProvisioningModel field.

These two validations are added:

  • Only "" and 'Spot' are allowed.
  • Preemptible cannot be true when ProvisioningModel == 'Spot'

Note: This is using my fork of the API PR, but the contents are the same as the API PR.

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

openshift-ci-robot commented Nov 4, 2025

@RadekManak: This pull request references OCPCLOUD-3173 which is a valid jira issue.

In response to this:

This PR adds validating webhook for new ProvisioningModel field.

These two validations are added:

  • Only "" and 'Spot' are allowed.
  • Preemptible cannot be true when ProvisioningModel == 'Spot'

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.

Copy link
Member

@damdo damdo left a comment

Choose a reason for hiding this comment

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

/approve

/assign @JoelSpeed

go.mod Outdated
// an API yet we can leverage so that I do not have to copy what openshift/kubernetes/openshift-hack/cmd/k8s-tests-ext did to initialize.
replace (
github.com/onsi/ginkgo/v2 => github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20241205171354-8006f302fd12
github.com/openshift/api => github.com/radekmanak/api v0.0.0-20251104154716-52bc7547ff1d
Copy link
Member

@damdo damdo Nov 5, 2025

Choose a reason for hiding this comment

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

TODO: this will need changing once the API has merged.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 5, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: damdo

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 Nov 5, 2025
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Nov 5, 2025

@RadekManak: This pull request references OCPCLOUD-3173 which is a valid jira issue.

In response to this:

This PR adds validating webhook for new ProvisioningModel field.

These two validations are added:

  • Only "" and 'Spot' are allowed.
  • Preemptible cannot be true when ProvisioningModel == 'Spot'

Note: This is using my fork of the rebase PR, but the contents are the same as the API PR.

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-robot
Copy link
Contributor

openshift-ci-robot commented Nov 5, 2025

@RadekManak: This pull request references OCPCLOUD-3173 which is a valid jira issue.

In response to this:

This PR adds validating webhook for new ProvisioningModel field.

These two validations are added:

  • Only "" and 'Spot' are allowed.
  • Preemptible cannot be true when ProvisioningModel == 'Spot'

Note: This is using my fork of the API PR, but the contents are the same as the API PR.

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.

errs = append(errs, field.Invalid(field.NewPath("providerSpec", "restartPolicy"), providerSpec.RestartPolicy, fmt.Sprintf("restartPolicy must be either %s or %s.", machinev1beta1.RestartPolicyNever, machinev1beta1.RestartPolicyAlways)))
}

if providerSpec.ProvisioningModel != "" && providerSpec.ProvisioningModel != machinev1beta1.GCPSpotInstance {
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't actually want to allow "", which means this field needs to be a pointer. Only valid choices should be nil and "Spot"

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 6, 2025

@RadekManak: 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/regression-clusterinfra-aws-ipi-mapi 56d66ac link false /test regression-clusterinfra-aws-ipi-mapi

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

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants