Skip to content

Conversation

@patrickdillon
Copy link
Contributor

@patrickdillon patrickdillon commented Oct 10, 2019

Jira: CORS-1216

This PR:

  • creates a client to make calls to the GCP API
  • validates user-provided VPC networks and subnets
  • validates the install config for required fields when providing VPC & subnets
  • creates tests for user-provided VPC scenario
  • updates existing DNS code to use the client

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 10, 2019
@patrickdillon patrickdillon force-pushed the byo-vpc-validation branch 5 times, most recently from b7ba2ff to 8b26c38 Compare October 14, 2019 01:51
@patrickdillon patrickdillon changed the title WIP: BYO VPC Validation BYO VPC Validation Oct 14, 2019
@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 Oct 14, 2019
@abhinavdahiya
Copy link
Contributor

/test e2e-gcp

@patrickdillon
Copy link
Contributor Author

/test e2e-gcp

@patrickdillon patrickdillon force-pushed the byo-vpc-validation branch 2 times, most recently from 486b6ca to 13a7128 Compare October 14, 2019 19:37
@abhinavdahiya
Copy link
Contributor

/test e2e-gcp

1 similar comment
@patrickdillon
Copy link
Contributor Author

/test e2e-gcp

Copy link
Contributor

@abhinavdahiya abhinavdahiya Oct 14, 2019

Choose a reason for hiding this comment

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

Also it seems like this function should be called validatePlatform as it does validation for VPC + subnets.

maybe validatePlatform(client API, platform *types.GCPPlatform, networking *types.Networking, path *field.Path) field.ErrorList

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree we should change the name from VPC, but I imagined the top level validate function to be the equivalent of validatePlatform. If there were further platform-specific data that needed to be added they would not be added here. Perhaps validateNetwork or validateNetworks?

@patrickdillon patrickdillon force-pushed the byo-vpc-validation branch 2 times, most recently from c431991 to 72695ae Compare October 15, 2019 00:59
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 15, 2019
This creates an interface and a wrapper for calls to the GCP API. This initial implementation has a bare-bones method for retrieiving VPC networks. This will be important for testing so that we can stub out calls to the GCP API.
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 15, 2019
@patrickdillon
Copy link
Contributor Author

/test e2e-gcp

Adds logic to check Google API to make sure user-provided VPC information is valid. Checks that the VPC belongs to project, subnets belong to VPC, and subnets are in the correct region.
This generates mocks for the GCP client API interface and creates tests for the BYO VPC validation use case.
Checks to make sure both subnets are required in install config if a network is specified.
Rewrites existing DNS code for getting basedomains and dns public zone to utliize new gcp client. Regenerate mock with addition to interface.
@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 15, 2019
@patrickdillon
Copy link
Contributor Author

/test e2e-gcp

@patrickdillon
Copy link
Contributor Author

I added 6cf9eda to incorporate DNS to use the client. I think it seems like a natural fit, but not sure if we want to include it. I started to write tests but the scenarios seem pretty artificial, so I think it is ok without them.

@abhinavdahiya
Copy link
Contributor

/retest

@abhinavdahiya
Copy link
Contributor

/approve

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 15, 2019
@abhinavdahiya
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 16, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya, patrickdillon

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

/retest

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

@openshift-merge-robot openshift-merge-robot merged commit af56855 into openshift:master Oct 16, 2019
@patrickdillon patrickdillon deleted the byo-vpc-validation branch October 24, 2019 18:22
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants