Skip to content

Conversation

@hardys
Copy link

@hardys hardys commented Nov 30, 2018

Add validation based on the clouds available in the clouds.yaml and related validation for the other options (most of which can be validated by doing an API call to e.g list the regions, images or whatever)

Since we have the list of valid names we can also enable selection of the name when specified interactively.

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 30, 2018
@hardys
Copy link
Author

hardys commented Nov 30, 2018

@russellb FYI this cleans up a couple of FIXME/TODO's you added, it's the start of a cleanup to add all the missing validations for the different inputs we added.

@flaper87 and @tomassedovic review welcome if you get a moment, thanks! :)

@hardys hardys force-pushed the openstack_validation branch from 0ad5b29 to e444fe4 Compare November 30, 2018 13:47
Steven Hardy added 2 commits November 30, 2018 14:54
Add validation based on the clouds available in the clouds.yaml.

Since we have the list of valid names we can also enable selection
of the name when specified interactively.
@hardys hardys force-pushed the openstack_validation branch from e444fe4 to 24507b2 Compare November 30, 2018 14:54
@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 30, 2018
@hardys hardys changed the title Validate OpenStack cloud name Add validation and choices to OpenStack installconfig Nov 30, 2018
@hardys hardys changed the title Add validation and choices to OpenStack installconfig WIP: Add validation and choices to OpenStack installconfig Nov 30, 2018
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 30, 2018
@hardys
Copy link
Author

hardys commented Nov 30, 2018

/assign

@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 30, 2018
Steven Hardy added 4 commits November 30, 2018 17:03
This checks the available regions and validates the user input, and
enables selecting from a list in the interactive case
This checks the available images and validates the user input, and
enables selecting from a list in the interactive case
This checks the available networks and validates the user input, and
enables selecting from a list in the interactive case
@hardys hardys force-pushed the openstack_validation branch from d749a7b to 932b417 Compare November 30, 2018 17:12
@hardys hardys changed the title WIP: Add validation and choices to OpenStack installconfig Add validation and choices to OpenStack installconfig Nov 30, 2018
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 30, 2018
@hardys
Copy link
Author

hardys commented Nov 30, 2018

Ok I think this is ready for review now - note that the existing limitation that these interfaces require names not IDs exist (this appears to be due to terraform but I've not fully investigated), so I clarified that in some of the help strings.

I pushed as a series of small commits but can squash if folks prefer that.

i := 0
cloudNames := make([]string, len(clouds))
for k := range clouds {
cloudNames[i] = k
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just use append instead of keeping with an index?

Copy link
Author

@hardys hardys Dec 3, 2018

Choose a reason for hiding this comment

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

Yeah we could do it either way, I read that this approach is slightly more efficient because you don't have to do reallocations, but I'm fine with either. Honestly I'm amazed there's no native .keys() equivalent and I just found this approach while looking for a go alternative.

@flaper87
Copy link
Contributor

flaper87 commented Dec 3, 2018

/test e2e-aws
/test e2e-libvirt
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 3, 2018
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: flaper87, hardys

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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

@hardys: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/e2e-libvirt 932b417 link /test e2e-libvirt

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

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.

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. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants