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-41184: GCP Validate Disk and Instance Type #9043

Merged

Conversation

barbacbd
Copy link
Contributor

** Update the error text and the way that disks and instances are validated. Before, the error message was backwards on indicating if the instance type or the disk type was the problem. Now, the disk type is validated against the instance type (rather than the opposite).

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Sep 19, 2024
@openshift-ci-robot
Copy link
Contributor

@barbacbd: This pull request references Jira Issue OCPBUGS-41184, 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.18.0) matches configured target version for branch (4.18.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @jianli-wei

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

In response to this:

** Update the error text and the way that disks and instances are validated. Before, the error message was backwards on indicating if the instance type or the disk type was the problem. Now, the disk type is validated against the instance type (rather than the opposite).

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.

@barbacbd
Copy link
Contributor Author

/label platform/google

@barbacbd
Copy link
Contributor Author

/cc @bfournie
/cc @patrickdillon

@bfournie
Copy link
Contributor

/lgtm

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

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Sep 23, 2024
@openshift-ci-robot
Copy link
Contributor

@barbacbd: This pull request references Jira Issue OCPBUGS-41184, which is valid.

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

Requesting review from QA contact:
/cc @jianli-wei

In response to this:

** Update the error text and the way that disks and instances are validated. Before, the error message was backwards on indicating if the instance type or the disk type was the problem. Now, the disk type is validated against the instance type (rather than the opposite).

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 removed the lgtm Indicates that a PR is ready to be merged. label Sep 23, 2024
pkg/types/gcp/machinepools.go Outdated Show resolved Hide resolved
@jianli-wei
Copy link
Contributor

@barbacbd Is it possible to merge the PR and then back-port to 4.17 as soon? Thanks!

@barbacbd
Copy link
Contributor Author

@barbacbd Is it possible to merge the PR and then back-port to 4.17 as soon? Thanks!

This is the plan. I am waiting on reviews and labels from the team.

Comment on lines 77 to 79
diskTypes := []string{}
ok := false
if instanceType != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

What about inverting this if?

Suggested change
diskTypes := []string{}
ok := false
if instanceType != "" {
if instanceType == "" {
// nothing to validate, our defaults are already valid
return nil
}

acceptedInstanceTypes := sets.New(validInstanceTypes...)
if !acceptedInstanceTypes.Has(family) {
return field.NotSupported(fldPath.Child("type"), family, sets.List(acceptedInstanceTypes))
diskTypes, ok = gcp.DiskTypeToInstanceTypeMap[family]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
diskTypes, ok = gcp.DiskTypeToInstanceTypeMap[family]
diskTypes, ok := gcp.DiskTypeToInstanceTypeMap[family]

}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
}


if arch == types.ArchitectureARM64 && family != "t2a" {
return field.InternalError(fldPath, fmt.Errorf("instance type %s requires %s architecture", instanceType, types.ArchitectureARM64))
if len(diskTypes) > 0 && diskType != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if len(diskTypes) > 0 && diskType != "" {
if diskType != "" {

// DiskTypeToInstanceTypeMap contains a map where the key is the Disk Type, and the values are a list of
// instance types that are supported by the installer and correlate to the Disk Type.
// DiskTypeToInstanceTypeMap contains a map where the key is the Instance Type, and the
// values are a list of disk types that are supported by the installer and correlate to the Instance Type.
DiskTypeToInstanceTypeMap = map[string][]string{
Copy link
Contributor

Choose a reason for hiding this comment

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

This name is now backwards, but I understand not wanting to rename it.

** Update the error text and the way that disks and instances are validated. Before, the
error message was backwards on indicating if the instance type or the disk type was the problem.
Now, the disk type is validated against the instance type (rather than the opposite).
Copy link
Contributor

@r4f4 r4f4 left a comment

Choose a reason for hiding this comment

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

/lgtm

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

barbacbd commented Oct 1, 2024

/test e2e-gcp-ovn

Copy link
Contributor

openshift-ci bot commented Oct 1, 2024

@barbacbd: 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/e2e-gcp-ovn-byo-vpc 582e5be link false /test e2e-gcp-ovn-byo-vpc
ci/prow/e2e-gcp-ovn-xpn 582e5be link false /test e2e-gcp-ovn-xpn
ci/prow/e2e-gcp-secureboot 582e5be link false /test e2e-gcp-secureboot

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.

@patrickdillon
Copy link
Contributor

/approve

Copy link
Contributor

openshift-ci bot commented Oct 1, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: patrickdillon

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 Oct 1, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 577855c into openshift:master Oct 1, 2024
19 of 22 checks passed
@openshift-ci-robot
Copy link
Contributor

@barbacbd: Jira Issue OCPBUGS-41184: All pull requests linked via external trackers have merged:

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

In response to this:

** Update the error text and the way that disks and instances are validated. Before, the error message was backwards on indicating if the instance type or the disk type was the problem. Now, the disk type is validated against the instance type (rather than the opposite).

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

[ART PR BUILD NOTIFIER]

Distgit: ose-installer-altinfra
This PR has been included in build ose-installer-altinfra-container-v4.18.0-202410020009.p0.g577855c.assembly.stream.el9.
All builds following this will include this PR.

@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

Distgit: ose-installer-terraform-providers
This PR has been included in build ose-installer-terraform-providers-container-v4.18.0-202410020009.p0.g577855c.assembly.stream.el9.
All builds following this will include this PR.

@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

Distgit: ose-baremetal-installer
This PR has been included in build ose-baremetal-installer-container-v4.18.0-202410020009.p0.g577855c.assembly.stream.el9.
All builds following this will include this PR.

@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

Distgit: ose-installer-artifacts
This PR has been included in build ose-installer-artifacts-container-v4.18.0-202410020009.p0.g577855c.assembly.stream.el9.
All builds following this will include this PR.

@barbacbd
Copy link
Contributor Author

/jira backport release-4.17

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-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. 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. platform/google qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants