cluster-api-provider-gcp
cluster-api-provider-gcp copied to clipboard
Incorrect URI used for subnetwork setup
/kind bug
What steps did you take and what happened:
Specifying sub network does not work due to incorrect URI being used
https://www.googleapis.com/compute/v1/projects/<project>/regions/<region>/subnetworks/<subnetwork>
It should be subnetworks not subnetwork
diff --git a/cloud/services/compute/instances.go b/cloud/services/compute/instances.go
index dee46ddc..6db51c42 100644
--- a/cloud/services/compute/instances.go
+++ b/cloud/services/compute/instances.go
@@ -138,7 +138,7 @@ func (s *Service) CreateInstance(scope *scope.MachineScope) (*compute.Instance,
}
if scope.GCPMachine.Spec.Subnet != nil {
- input.NetworkInterfaces[0].Subnetwork = fmt.Sprintf("regions/%s/subnetwork/%s",
+ input.NetworkInterfaces[0].Subnetwork = fmt.Sprintf("regions/%s/subnetworks/%s",
scope.Region(), *scope.GCPMachine.Spec.Subnet)
}
What did you expect to happen:
User should be able to create and use custom subnets.
Environment:
- Cluster-api version: v1 alpha 2 (but the bug is present in master)
- Minikube/KIND version: 0.7.0
- Kubernetes version: (use
kubectl version):
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-10T03:03:57Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2020-01-14T00:09:19Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
``
- OS (e.g. from `/etc/os-release`):
NAME="Ubuntu" VERSION="18.04.3 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 18.04.3 LTS" VERSION_ID="18.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
/remove-lifecycle stale
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle rotten
/lifecycle frozen
Seems to be fixed in https://github.com/kubernetes-sigs/cluster-api-provider-gcp/pull/331 or?
Agreed this has been fixed.