-
Notifications
You must be signed in to change notification settings - Fork 201
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
Fix Cluster Creation in User Provided Subnet #961
Fix Cluster Creation in User Provided Subnet #961
Conversation
Hi @shaad7. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/ok-to-test |
38b60ac
to
9cddad0
Compare
@shaad7 - how would you feel about adding an e2e test to cover this scenario? |
9cddad0
to
63f906b
Compare
63f906b
to
e5e0c02
Compare
@richardcase I have looked the e2e test codes. The cluster template is generated using |
It can be quite time-consuming adding e2e tests, but there is lots of value as it prevents regressions. If i was doing the work i would probably do this:
It("Should create a cluster with 1 worker node with user provided subnets", func() {
By("Creating subnets")
// Add code to create or get existing subnets in GCP
By("Initializes with 1 worker node")
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
ClusterProxy: bootstrapClusterProxy,
ConfigCluster: clusterctl.ConfigClusterInput{
LogFolder: clusterctlLogFolder,
ClusterctlConfigPath: clusterctlConfigPath,
KubeconfigPath: bootstrapClusterProxy.GetKubeconfigPath(),
InfrastructureProvider: clusterctl.DefaultInfrastructureProvider,
Flavor: "newtemplateflavour", // <- this is where we specify the new template
Namespace: namespace.Name,
ClusterName: clusterName,
KubernetesVersion: e2eConfig.GetVariable(KubernetesVersion),
ControlPlaneMachineCount: pointer.Int64Ptr(1),
WorkerMachineCount: pointer.Int64Ptr(1),
ClusterctlVariables: map[string]string{
"SUBNET": subnetid,
},
},
WaitForClusterIntervals: e2eConfig.GetIntervals(specName, "wait-cluster"),
WaitForControlPlaneIntervals: e2eConfig.GetIntervals(specName, "wait-control-plane"),
WaitForMachineDeployments: e2eConfig.GetIntervals(specName, "wait-worker-nodes"),
}, result)
})
}) |
Thank you @richardcase . I have added e2e test for the scenario. Can you have a look ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shaad7 - thanks for adding the e2e test. A coupld of comments on it. Currently the test isn't using the new template you added.
07c51f9
to
0f85590
Compare
30f54f9
to
9ffc725
Compare
/test pull-cluster-api-provider-gcp-e2e-test |
7d84490
to
95cf624
Compare
95cf624
to
073e360
Compare
073e360
to
bab1fa1
Compare
✅ Deploy Preview for kubernetes-sigs-cluster-api-gcp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
99eefe6
to
7a0db02
Compare
Signed-off-by: Shaad7 <[email protected]> Signed-off-by: AbdullahAlShaad <[email protected]>
7a0db02
to
d6cf2e1
Compare
/test ls |
@cpanato: The specified target(s) for
The following commands are available to trigger optional jobs:
Use
In response to this:
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. |
/test pull-cluster-api-provider-gcp-capi-e2e |
Thanks @AbdullahAlShaad . From my side: /approve |
For final eyes and lgtm /assign cpanato |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AbdullahAlShaad, cpanato, richardcase 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 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PR enables the creation of clusters in user-provided subnets. It also adds validation for user-provided subnets to ensure that at least one subnet is in the same region where the cluster will be created. The user-provided subnets are created in the intended region rather than the default region.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #896
Special notes for your reviewer:
Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.
TODOs:
Release note: