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

Fixes to subnets creation for GKE multiproject profile. #132

Merged
merged 1 commit into from
May 12, 2021

Conversation

chizhg
Copy link
Contributor

@chizhg chizhg commented May 10, 2021

  1. subnet create command does not support --zone(https://cloud.google.com/sdk/gcloud/reference/compute/networks/subnets/create) but cluster create command supports, this PR converts zone to region when creating subnets if zonal clusters are requested.
  2. Move createSubnets and deleteSubnets to separate functions.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 10, 2021
@k8s-ci-robot k8s-ci-robot requested review from MushuEE and spiffxp May 10, 2021 05:38
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 10, 2021
@chizhg chizhg force-pushed the kubetest2-updates branch from 27a9a1f to 6e9adce Compare May 10, 2021 05:49
@chizhg
Copy link
Contributor Author

chizhg commented May 10, 2021

FYI @joshua-bone

@chizhg
Copy link
Contributor Author

chizhg commented May 10, 2021

/assign @amwat

Copy link
Contributor

@amwat amwat left a comment

Choose a reason for hiding this comment

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

/approve

minor comments before lgtm

@@ -201,14 +202,24 @@ func (d *deployer) verifyLocationFlags() error {
return nil
}

// location returns the location flags for gcloud commands.
func location(region, zone string) string {
// locationFlag returns the location flag for gcloud commands.
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
// locationFlag returns the location flag for gcloud commands.
// locationFlag builds the zone/region flag from the provided zone/region
// prioritizes zones if both are specified
// used by gcloud commands.

Copy link
Contributor Author

@chizhg chizhg May 12, 2021

Choose a reason for hiding this comment

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

We actually do not allow --region and --zone to be both set in the verifyLocationFlags function, so I added the comment as:

// locationFlag builds the zone/region flag from the provided zone/region
// used by gcloud commands.

Copy link
Contributor

Choose a reason for hiding this comment

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

We actually do not allow --region and --zone to be both set in the verifyLocationFlags function

ACK, mainly the "prioritizes" comment was to highlight what gets chosen if both are specified in context of just this function.

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 11, 2021
1. subnet create command does not support --zone(https://cloud.google.com/sdk/gcloud/reference/compute/networks/subnets/create) but cluster create command supports, this PR converts zone to region when creating subnets if zonal clusters are requested.
2. Move createSubnets and deleteSubnets to separate functions.
@chizhg chizhg force-pushed the kubetest2-updates branch from 6e9adce to 91ae07d Compare May 12, 2021 00:12
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 12, 2021
Copy link
Contributor

@amwat amwat 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

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 12, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amwat, chizhg

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

@k8s-ci-robot k8s-ci-robot merged commit 0c98da7 into kubernetes-sigs:master May 12, 2021
@chizhg chizhg deleted the kubetest2-updates branch November 3, 2021 22:00
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants