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

Bug 1957809: Validation of platform.openstack.machineSubnet #4917

Merged
merged 2 commits into from May 11, 2021

Conversation

adduarte
Copy link

@adduarte adduarte commented May 8, 2021

If the user provides an UUID under platform.openstack.machinesSubnet
of a subnet which does not exist, the installer should not fail with a
backtrace.
Instead, the installer should exit gracefully and provide the correct error
to the user.

If the user provides an UUID under platform.openstack.machinesSubnet
of a subnet which does not exist, the installer should not fail with a
backtrace.
Instead, the installer should exit gracefully and provide the correct error
to the user.
@openshift-ci openshift-ci bot added bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels May 8, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 8, 2021

@adduarte: This pull request references Bugzilla bug 1957809, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

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

No GitHub users were found matching the public email listed for the QA contact in Bugzilla (juriarte@redhat.com), skipping review request.

In response to this:

Bug 1957809: Validation of platform.openstack.machineSubnet

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/test-infra repository.

Copy link
Contributor

@Fedosin Fedosin left a comment

Choose a reason for hiding this comment

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

Just one suggestion. And also it would be nice to have a unit test for this case.

@@ -38,7 +38,7 @@ func validateMachinesSubnet(p *openstack.Platform, n *types.Networking, ci *Clou
if len(p.ExternalDNS) > 0 {
allErrs = append(allErrs, field.Invalid(fldPath.Child("externalDNS"), p.ExternalDNS, "externalDNS is set, externalDNS is not supported when machinesSubnet is set"))
}
if !validUUIDv4(p.MachinesSubnet) {
if !validUUIDv4(p.MachinesSubnet) || ci.MachinesSubnet == nil {
Copy link
Contributor

@Fedosin Fedosin May 8, 2021

Choose a reason for hiding this comment

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

I think we need to differentiate these errors. If there is no machine subnet with provided id, then we should generate NotFound error.

if !validUUIDv4(p.MachinesSubnet) {
	allErrs = append(allErrs, field.InternalError(fldPath.Child("machinesSubnet"), errors.New("invalid subnet ID")))
} else if ci.MachinesSubnet == nil {
	allErrs = append(allErrs, field.NotFound(fldPath.Child("machinesSubnet"), p.MachinesSubnet))
} else if n.MachineNetwork[0].CIDR.String() != ci.MachinesSubnet.CIDR {
	allErrs = append(allErrs, field.InternalError(fldPath.Child("machinesSubnet"), fmt.Errorf("the first CIDR in machineNetwork, %s, doesn't match the CIDR of the machineSubnet, %s", n.MachineNetwork[0].CIDR.String(), ci.MachinesSubnet.CIDR)))
}

@mandre
Copy link
Member

mandre commented May 10, 2021

/label platform/openstack

Co-authored-by: Martin André <m.andre@redhat.com>
Copy link
Member

@mandre mandre left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 11, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 11, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mandre

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 May 11, 2021
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 11, 2021

@adduarte: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-metal-ipi-ovn-ipv6 8abc715 link /test e2e-metal-ipi-ovn-ipv6
ci/prow/e2e-libvirt 8abc715 link /test e2e-libvirt
ci/prow/e2e-crc 8abc715 link /test e2e-crc

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/test-infra repository. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit f7170a4 into openshift:master May 11, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 11, 2021

@adduarte: All pull requests linked via external trackers have merged:

Bugzilla bug 1957809 has been moved to the MODIFIED state.

In response to this:

Bug 1957809: Validation of platform.openstack.machineSubnet

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/test-infra repository.

@EmilienM EmilienM deleted the BZ_1957809 branch December 1, 2021 14:06
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. bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged. platform/openstack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants