Repository: kubernetes/kops (go)

Issue:
Updating to v1 of GCE libs broke network.Find()
The network self-link is [hardcoded](https://github.com/kubernetes/kops/blob/fd512ca1657ce88e3926fd32620e7de10c0fb1ba/upup/pkg/fi/cloudup/gcetasks/network.go#L79) to use `beta` resource name. When creating new clusters, this throws errors like : 

```
W0427 12:55:00.998554   49101 network.go:68] SelfLink did not match URL: "https://www.googleapis.com/compute/v1/projects/ehole-dev-abc/global/networks/default" vs "https://www.googleapis.com/compute/beta/project
s/ehole-dev-abc/global/networks/default"
```

Looks like we have another [place to update as well](https://github.com/kubernetes/kops/blob/master/upup/pkg/fi/cloudup/gcetasks/subnet.go#L196).

Pull request:
GCE: needs to use v1 network resources, not beta
closes #9003 

~~I don't think this impacts existing clusters, but am checking...~~
Looks like this is a no-op for existing clusters, we're good to go.

Patch:
diff --git a/upup/models/bindata.go b/upup/models/bindata.go
index c70b07732e..a6d64caa88 100644
--- a/upup/models/bindata.go
+++ b/upup/models/bindata.go
@@ -4708,7 +4708,7 @@ spec:
           value: {{ . }}
         {{ end }}
 {{ with .Networking.Cilium }}
-        image: "docker.io/cilium/cilium:{{- or .Version "v1.7.2" }}"
+        image: "docker.io/cilium/cilium:{{- or .Version "v1.7.1" }}"
         imagePullPolicy: IfNotPresent
         lifecycle:
           postStart:
@@ -4811,7 +4811,7 @@ spec:
               key: wait-bpf-mount
               name: cilium-config
               optional: true
-        image: "docker.io/cilium/cilium:{{- or .Version "v1.7.2" }}"
+        image: "docker.io/cilium/cilium:{{- or .Version "v1.7.1" }}"
 ## end of ` + "`" + `with .Networking.Cilium` + "`" + `
 #{{ end }}
         imagePullPolicy: IfNotPresent
@@ -5012,7 +5012,7 @@ spec:
         - name: KUBERNETES_SERVICE_PORT
           value: "443"
 {{ with .Networking.Cilium }}
-        image: "docker.io/cilium/operator:{{- if eq .Version "" -}}v1.7.2{{- else -}}{{ .Version }}{{- end -}}"
+        image: "docker.io/cilium/operator:{{- if eq .Version "" -}}v1.7.1{{- else -}}{{ .Version }}{{- end -}}"
         imagePullPolicy: IfNotPresent
         name: cilium-operator
         {{ if .EnablePrometheusMetrics }}
diff --git a/upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.12.yaml.template b/upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.12.yaml.template
index c4fcb8c4f0..ba071e32aa 100644
--- a/upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.12.yaml.template
+++ b/upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.12.yaml.template
@@ -419,7 +419,7 @@ spec:
           value: {{ . }}
         {{ end }}
 {{ with .Networking.Cilium }}
-        image: "docker.io/cilium/cilium:{{- or .Version "v1.7.2" }}"
+        image: "docker.io/cilium/cilium:{{- or .Version "v1.7.1" }}"
         imagePullPolicy: IfNotPresent
         lifecycle:
           postStart:
@@ -522,7 +522,7 @@ spec:
               key: wait-bpf-mount
               name: cilium-config
               optional: true
-        image: "docker.io/cilium/cilium:{{- or .Version "v1.7.2" }}"
+        image: "docker.io/cilium/cilium:{{- or .Version "v1.7.1" }}"
 ## end of `with .Networking.Cilium`
 #{{ end }}
         imagePullPolicy: IfNotPresent
@@ -723,7 +723,7 @@ spec:
         - name: KUBERNETES_SERVICE_PORT
           value: "443"
 {{ with .Networking.Cilium }}
-        image: "docker.io/cilium/operator:{{- if eq .Version "" -}}v1.7.2{{- else -}}{{ .Version }}{{- end -}}"
+        image: "docker.io/cilium/operator:{{- if eq .Version "" -}}v1.7.1{{- else -}}{{ .Version }}{{- end -}}"
         imagePullPolicy: IfNotPresent
         name: cilium-operator
         {{ if .EnablePrometheusMetrics }}
diff --git a/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go b/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go
index d5be9d46ce..38868f1d3a 100644
--- a/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go
+++ b/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go
@@ -988,7 +988,7 @@ func (b *BootstrapChannelBuilder) buildAddons() *channelsapi.Addons {
 
 	if b.cluster.Spec.Networking.Cilium != nil {
 		key := "networking.cilium.io"
-		version := "1.7.2-kops.1"
+		version := "1.7.1-kops.2"
 
 		{
 			id := "k8s-1.7"
diff --git a/upup/pkg/fi/cloudup/gcetasks/network.go b/upup/pkg/fi/cloudup/gcetasks/network.go
index db9475a901..96c6ad17df 100644
--- a/upup/pkg/fi/cloudup/gcetasks/network.go
+++ b/upup/pkg/fi/cloudup/gcetasks/network.go
@@ -76,7 +76,7 @@ func (e *Network) Find(c *fi.Context) (*Network, error) {
 
 func (e *Network) URL(project string) string {
 	u := gce.GoogleCloudURL{
-		Version: "beta",
+		Version: "v1",
 		Project: project,
 		Name:    *e.Name,
 		Type:    "networks",
diff --git a/upup/pkg/fi/cloudup/gcetasks/subnet.go b/upup/pkg/fi/cloudup/gcetasks/subnet.go
index dd2202db80..d0a720c38b 100644
--- a/upup/pkg/fi/cloudup/gcetasks/subnet.go
+++ b/upup/pkg/fi/cloudup/gcetasks/subnet.go
@@ -193,7 +193,7 @@ func (_ *Subnet) RenderGCE(t *gce.GCEAPITarget, a, e, changes *Subnet) error {
 
 func (e *Subnet) URL(project string, region string) string {
 	u := gce.GoogleCloudURL{
-		Version: "beta",
+		Version: "v1",
 		Project: project,
 		Name:    *e.GCEName,
 		Type:    "subnetworks",


Test patch:
diff --git a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/cilium/manifest.yaml b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/cilium/manifest.yaml
index 4927bd3215..f1ec2feb07 100644
--- a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/cilium/manifest.yaml
+++ b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/cilium/manifest.yaml
@@ -93,12 +93,12 @@ spec:
     name: networking.cilium.io
     selector:
       role.kubernetes.io/networking: "1"
-    version: 1.7.2-kops.1
+    version: 1.7.1-kops.2
   - id: k8s-1.12
     kubernetesVersion: '>=1.12.0'
     manifest: networking.cilium.io/k8s-1.12.yaml
-    manifestHash: 80953cfa6afa4d212f85364fe050bf52051b1d89
+    manifestHash: b9cc0e3b5e63d6aa283e2d1111a150680745abd2
     name: networking.cilium.io
     selector:
       role.kubernetes.io/networking: "1"
-    version: 1.7.2-kops.1
+    version: 1.7.1-kops.2