Skip to content

Commit

Permalink
Update Ingresses to networking.k8s.io/v1beta1
Browse files Browse the repository at this point in the history
Signed-off-by: Mikkel Oscar Lyderik Larsen <[email protected]>
  • Loading branch information
mikkeloscar committed Jul 16, 2019
1 parent 1158930 commit 79d3428
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 42 deletions.
2 changes: 1 addition & 1 deletion cluster/manifests/emergency-access-service/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ if eq .Environment "production" }}
apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: emergency-access-service
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ var _ = framework.KubeDescribe("API Server webhook tests", func() {
By("Creating deployment " + nameprefix + " in namespace " + ns)

deployment := createImagePolicyWebhookTestDeployment(nameprefix+"-", ns, tag, podname, replicas)
_, err := cs.ExtensionsV1beta1().Deployments(ns).Create(deployment)
_, err := cs.AppsV1().Deployments(ns).Create(deployment)
defer func() {
By(fmt.Sprintf("Delete a compliant deployment: %s", deployment.Name))
defer GinkgoRecover()
err := cs.ExtensionsV1beta1().Deployments(ns).Delete(deployment.Name, metav1.NewDeleteOptions(0))
err := cs.AppsV1().Deployments(ns).Delete(deployment.Name, metav1.NewDeleteOptions(0))
Expect(err).NotTo(HaveOccurred())
}()
Expect(err).NotTo(HaveOccurred())
Expand All @@ -79,12 +79,12 @@ var _ = framework.KubeDescribe("API Server webhook tests", func() {
By("Creating deployment " + nameprefix + " in namespace " + ns)

deployment := createImagePolicyWebhookTestDeployment(nameprefix+"-", ns, tag, podname, replicas)
_, err := cs.ExtensionsV1beta1().Deployments(ns).Create(deployment)
_, err := cs.AppsV1().Deployments(ns).Create(deployment)
Expect(err).NotTo(HaveOccurred())
defer func() {
By(fmt.Sprintf("Delete a compliant deployment: %s", deployment.Name))
defer GinkgoRecover()
err := cs.ExtensionsV1beta1().Deployments(ns).Delete(deployment.Name, metav1.NewDeleteOptions(0))
err := cs.AppsV1().Deployments(ns).Delete(deployment.Name, metav1.NewDeleteOptions(0))
Expect(err).NotTo(HaveOccurred())
}()
err = framework.WaitForDeploymentWithCondition(cs, ns, deployment.Name, "FailedCreate", appsv1.DeploymentReplicaFailure)
Expand Down
6 changes: 1 addition & 5 deletions test/e2e/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ require (
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c // indirect
github.com/google/cadvisor v0.32.0 // indirect
github.com/google/certificate-transparency-go v1.0.21 // indirect
github.com/google/gofuzz v1.0.0 // indirect
github.com/gophercloud/gophercloud v0.0.0-20190126172459-c818fa66e4c8 // indirect
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e // indirect
github.com/gorilla/websocket v1.4.0 // indirect
Expand All @@ -70,7 +69,6 @@ require (
github.com/imdario/mergo v0.3.6 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jonboulle/clockwork v0.1.0 // indirect
github.com/json-iterator/go v1.1.5 // indirect
github.com/jtolds/gls v4.2.1+incompatible // indirect
github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1 // indirect
github.com/karrick/godirwalk v1.8.0 // indirect
Expand All @@ -85,7 +83,6 @@ require (
github.com/mikkeloscar/kube-aws-iam-controller v0.1.0
github.com/mindprince/gonvml v0.0.0-20180514031326-b364b296c732 // indirect
github.com/mistifyio/go-zfs v0.0.0-20151009155749-1b4ae6fb4e77 // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/mrunalp/fileutils v0.0.0-20171103030105-7d4729fb3618 // indirect
github.com/munnerz/goautoneg v0.0.0-20190414153302-2ae31c8b6b30 // indirect
Expand All @@ -109,7 +106,6 @@ require (
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect
github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c // indirect
github.com/spf13/cobra v0.0.3 // indirect
github.com/spf13/pflag v1.0.3 // indirect
github.com/spf13/viper v1.2.1 // indirect
github.com/storageos/go-api v0.0.0-20180912212459-343b3eff91fc // indirect
github.com/syndtr/gocapability v0.0.0-20160928074757-e7cb7fa329f4 // indirect
Expand All @@ -132,7 +128,7 @@ require (
gotest.tools v2.2.0+incompatible // indirect
k8s.io/api v0.0.0-20190515023547-db5a9d1c40eb
k8s.io/apiextensions-apiserver v0.0.0-20170616221715-abd4538a1176 // indirect
k8s.io/apimachinery v0.0.0-20190515023456-b74e4c97951f
k8s.io/apimachinery v0.0.0-20190715170309-6171873045ff
k8s.io/apiserver v0.0.0-20170616221227-b1c85a6c288c
k8s.io/cli-runtime v0.0.0-20190301175653-0c2382d2cffa // indirect
k8s.io/client-go v11.0.0+incompatible
Expand Down
12 changes: 4 additions & 8 deletions test/e2e/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,8 @@ github.com/google/certificate-transparency-go v1.0.21 h1:Yf1aXowfZ2nuboBsg7iYGLm
github.com/google/certificate-transparency-go v1.0.21/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg=
github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g=
Expand Down Expand Up @@ -224,9 +223,8 @@ github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5i
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3 h1:/UewZcckqhvnnS0C6r3Sher2hSEbVmM6Ogpcjen08+Y=
github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.5 h1:gL2yXlmiIo4+t+y32d4WGwOjKGYcGOuyrg46vadswDE=
github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/jtolds/gls v4.2.1+incompatible h1:fSuqC+Gmlu6l/ZYAoZzx2pyucC8Xza35fpRVWLVmUEE=
github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
Expand Down Expand Up @@ -277,9 +275,8 @@ github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQz
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180228065516-1df9eeb2bb81 h1:ImOHKpmdLPXWX5KSYquUWXKaopEPuY7TPPUo18u9aOI=
github.com/modern-go/reflect2 v0.0.0-20180228065516-1df9eeb2bb81/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
github.com/mrunalp/fileutils v0.0.0-20171103030105-7d4729fb3618 h1:7InQ7/zrOh6SlFjaXFubv0xX0HsuC9qJsdqm7bNQpYM=
Expand Down Expand Up @@ -368,9 +365,8 @@ github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3
github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.2 h1:Fy0orTDgHdbnzHcsOgfCN4LtHf0ec3wwtiwJqwvf3Gc=
github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/viper v1.2.1 h1:bIcUwXqLseLF3BDAZduuNfekWG87ibtFxi59Bq+oI9M=
github.com/spf13/viper v1.2.1/go.mod h1:P4AexN0a+C9tGAnUFNwDMYYZv3pjFuvmeiMyKRaNVlI=
github.com/storageos/go-api v0.0.0-20180912212459-343b3eff91fc h1:n+WYaU0kQ6WIiuEyWSgbXqkBx16irO69kYCtwVYoO5s=
Expand Down
36 changes: 18 additions & 18 deletions test/e2e/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"k8s.io/api/extensions/v1beta1"
"k8s.io/api/networking/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/client-go/kubernetes"
Expand Down Expand Up @@ -84,14 +84,14 @@ var _ = framework.KubeDescribe("Ingress ALB creation", func() {
defer func() {
By("deleting the ingress")
defer GinkgoRecover()
err2 := cs.ExtensionsV1beta1().Ingresses(ns).Delete(ing.Name, metav1.NewDeleteOptions(0))
err2 := cs.NetworkingV1beta1().Ingresses(ns).Delete(ing.Name, metav1.NewDeleteOptions(0))
Expect(err2).NotTo(HaveOccurred())
}()
ingressCreate, err := cs.ExtensionsV1beta1().Ingresses(ns).Create(ing)
ingressCreate, err := cs.NetworkingV1beta1().Ingresses(ns).Create(ing)
Expect(err).NotTo(HaveOccurred())
addr, err := jig.WaitForIngressAddress(cs, ns, ingressCreate.Name, 10*time.Minute)
Expect(err).NotTo(HaveOccurred())
ingress, err := cs.ExtensionsV1beta1().Ingresses(ns).Get(ing.Name, metav1.GetOptions{ResourceVersion: "0"})
ingress, err := cs.NetworkingV1beta1().Ingresses(ns).Get(ing.Name, metav1.GetOptions{ResourceVersion: "0"})
Expect(err).NotTo(HaveOccurred())
By(fmt.Sprintf("ALB endpoint from ingress status: %s", ingress.Status.LoadBalancer.Ingress[0].Hostname))

Expand Down Expand Up @@ -155,13 +155,13 @@ var __ = framework.KubeDescribe("Ingress tests simple", func() {
Expect(err).NotTo(HaveOccurred())

ing := createIngress(serviceName, hostName, ns, labels, port)
ingressCreate, err := cs.ExtensionsV1beta1().Ingresses(ns).Create(ing)
ingressCreate, err := cs.NetworkingV1beta1().Ingresses(ns).Create(ing)
Expect(err).NotTo(HaveOccurred())

addr, err := jig.WaitForIngressAddress(cs, ns, ingressCreate.Name, waitTime)
Expect(err).NotTo(HaveOccurred())

_, err = cs.ExtensionsV1beta1().Ingresses(ns).Get(ing.Name, metav1.GetOptions{ResourceVersion: "0"})
_, err = cs.NetworkingV1beta1().Ingresses(ns).Get(ing.Name, metav1.GetOptions{ResourceVersion: "0"})
Expect(err).NotTo(HaveOccurred())

// skipper http -> https redirect
Expand Down Expand Up @@ -210,7 +210,7 @@ var __ = framework.KubeDescribe("Ingress tests simple", func() {
},
port,
)
ingressUpdate, err := cs.ExtensionsV1beta1().Ingresses(ingressCreate.ObjectMeta.Namespace).Update(updatedIng)
ingressUpdate, err := cs.NetworkingV1beta1().Ingresses(ingressCreate.ObjectMeta.Namespace).Update(updatedIng)
Expect(err).NotTo(HaveOccurred())
By(fmt.Sprintf("Waiting for ingress %s/%s we wait to get a 200 with the right content for the next request", ingressUpdate.Namespace, ingressUpdate.Name))
resp, err = getAndWaitResponse(rt, req, 10*time.Second, http.StatusOK)
Expand All @@ -237,7 +237,7 @@ var __ = framework.KubeDescribe("Ingress tests simple", func() {
},
port,
)
ingressUpdate, err = cs.ExtensionsV1beta1().Ingresses(ingressCreate.ObjectMeta.Namespace).Update(updatedIng)
ingressUpdate, err = cs.NetworkingV1beta1().Ingresses(ingressCreate.ObjectMeta.Namespace).Update(updatedIng)
Expect(err).NotTo(HaveOccurred())
By(fmt.Sprintf("Waiting for ingress %s/%s we wait to get a 404 for the next request", ingressUpdate.Namespace, ingressUpdate.Name))
resp, err = getAndWaitResponse(rt, req, 10*time.Second, http.StatusNotFound)
Expand All @@ -261,7 +261,7 @@ var __ = framework.KubeDescribe("Ingress tests simple", func() {
},
port,
)
ingressUpdate, err = cs.ExtensionsV1beta1().Ingresses(ingressCreate.ObjectMeta.Namespace).Update(updatedIng)
ingressUpdate, err = cs.NetworkingV1beta1().Ingresses(ingressCreate.ObjectMeta.Namespace).Update(updatedIng)
Expect(err).NotTo(HaveOccurred())
By(fmt.Sprintf("Waiting for ingress %s/%s we wait to get a 200 with %s header set to %s for the next request", ingressUpdate.Namespace, ingressUpdate.Name, headerKey, headerVal))
time.Sleep(10 * time.Second) // wait for routing change propagation
Expand All @@ -282,7 +282,7 @@ var __ = framework.KubeDescribe("Ingress tests simple", func() {
// Test additional hostname
additionalHostname := fmt.Sprintf("foo-%d.%s", time.Now().UTC().Unix(), E2EHostedZone())
addHostIng := addHostIngress(updatedIng, additionalHostname)
ingressUpdate, err = cs.ExtensionsV1beta1().Ingresses(ingressCreate.ObjectMeta.Namespace).Update(addHostIng)
ingressUpdate, err = cs.NetworkingV1beta1().Ingresses(ingressCreate.ObjectMeta.Namespace).Update(addHostIng)
Expect(err).NotTo(HaveOccurred())
By("Waiting for new DNS hostname to be resolvable " + additionalHostname)
err = waitForResponse(additionalHostname, "https", waitTime, isSuccess, false)
Expand Down Expand Up @@ -316,7 +316,7 @@ var __ = framework.KubeDescribe("Ingress tests simple", func() {
// Test changed path
newPath := "/foo"
changePathIng := changePathIngress(updatedIng, newPath)
ingressUpdate, err = cs.ExtensionsV1beta1().Ingresses(ingressCreate.ObjectMeta.Namespace).Update(changePathIng)
ingressUpdate, err = cs.NetworkingV1beta1().Ingresses(ingressCreate.ObjectMeta.Namespace).Update(changePathIng)
Expect(err).NotTo(HaveOccurred())

By(fmt.Sprintf("Waiting for ingress %s/%s we wait to get a 404 for the old request, because of the path route", ingressUpdate.Namespace, ingressUpdate.Name))
Expand Down Expand Up @@ -409,13 +409,13 @@ var ___ = framework.KubeDescribe("Ingress tests paths", func() {

By("Creating ingress " + serviceName + " in namespace " + ns + "with hostname " + hostName)
ing := createIngress(serviceName, hostName, ns, labels, port)
ingressCreate, err := cs.ExtensionsV1beta1().Ingresses(ns).Create(ing)
ingressCreate, err := cs.NetworkingV1beta1().Ingresses(ns).Create(ing)
Expect(err).NotTo(HaveOccurred())

addr, err := jig.WaitForIngressAddress(cs, ns, ingressCreate.Name, waitTime)
Expect(err).NotTo(HaveOccurred())

_, err = cs.ExtensionsV1beta1().Ingresses(ns).Get(ing.Name, metav1.GetOptions{ResourceVersion: "0"})
_, err = cs.NetworkingV1beta1().Ingresses(ns).Get(ing.Name, metav1.GetOptions{ResourceVersion: "0"})
Expect(err).NotTo(HaveOccurred())

// skipper http -> https redirect
Expand Down Expand Up @@ -462,7 +462,7 @@ var ___ = framework.KubeDescribe("Ingress tests paths", func() {
ingressCreate.ObjectMeta.Annotations,
port,
)
ingressUpdate, err := cs.ExtensionsV1beta1().Ingresses(ingressCreate.ObjectMeta.Namespace).Update(updatedIng)
ingressUpdate, err := cs.NetworkingV1beta1().Ingresses(ingressCreate.ObjectMeta.Namespace).Update(updatedIng)
Expect(err).NotTo(HaveOccurred())

By(fmt.Sprintf("Testing for ingress %s/%s we want to get a 404 for path /", ingressUpdate.Namespace, ingressUpdate.Name))
Expand Down Expand Up @@ -504,7 +504,7 @@ var ___ = framework.KubeDescribe("Ingress tests paths", func() {
ServicePort: intstr.FromInt(port),
},
)
ingressUpdate, err = cs.ExtensionsV1beta1().Ingresses(ingressCreate.ObjectMeta.Namespace).Update(updatedIng)
ingressUpdate, err = cs.NetworkingV1beta1().Ingresses(ingressCreate.ObjectMeta.Namespace).Update(updatedIng)
Expect(err).NotTo(HaveOccurred())
resp, err = getAndWaitResponse(rt, bereq2, 10*time.Second, http.StatusOK)
Expect(err).NotTo(HaveOccurred())
Expand Down Expand Up @@ -577,13 +577,13 @@ var ____ = framework.KubeDescribe("Ingress tests custom routes", func() {

By("Creating ingress " + serviceName + " in namespace " + ns + "with hostname " + hostName)
ing := createIngress(serviceName, hostName, ns, labels, port)
ingressCreate, err := cs.ExtensionsV1beta1().Ingresses(ns).Create(ing)
ingressCreate, err := cs.NetworkingV1beta1().Ingresses(ns).Create(ing)
Expect(err).NotTo(HaveOccurred())

addr, err := jig.WaitForIngressAddress(cs, ns, ingressCreate.Name, waitTime)
Expect(err).NotTo(HaveOccurred())

_, err = cs.ExtensionsV1beta1().Ingresses(ns).Get(ing.Name, metav1.GetOptions{ResourceVersion: "0"})
_, err = cs.NetworkingV1beta1().Ingresses(ns).Get(ing.Name, metav1.GetOptions{ResourceVersion: "0"})
Expect(err).NotTo(HaveOccurred())

// skipper http -> https redirect
Expand Down Expand Up @@ -637,7 +637,7 @@ var ____ = framework.KubeDescribe("Ingress tests custom routes", func() {
},
port,
)
ingressUpdate, err := cs.ExtensionsV1beta1().Ingresses(ingressCreate.ObjectMeta.Namespace).Update(updatedIng)
ingressUpdate, err := cs.NetworkingV1beta1().Ingresses(ingressCreate.ObjectMeta.Namespace).Update(updatedIng)
Expect(err).NotTo(HaveOccurred())

By(fmt.Sprintf("Testing for ingress %s/%s we want to get a 307 for path %s", ingressUpdate.Namespace, ingressUpdate.Name, redirectPath))
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/kube_metrics_adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
appsv1 "k8s.io/api/apps/v1"
autoscaling "k8s.io/api/autoscaling/v2beta1"
corev1 "k8s.io/api/core/v1"
"k8s.io/api/extensions/v1beta1"
"k8s.io/api/networking/v1beta1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
Expand Down Expand Up @@ -127,7 +127,7 @@ func (tc *CustomMetricTestCase) Run() {
Expect(err).NotTo(HaveOccurred())

// Create an Ingress since RPS based scaling relies on it
ingressCreate, err := tc.kubeClient.ExtensionsV1beta1().Ingresses(ns).Create(tc.ingress)
ingressCreate, err := tc.kubeClient.NetworkingV1beta1().Ingresses(ns).Create(tc.ingress)
Expect(err).NotTo(HaveOccurred())

_, err = tc.jig.WaitForIngressAddress(tc.kubeClient, ns, ingressCreate.Name, 10*time.Minute)
Expand Down
13 changes: 9 additions & 4 deletions test/e2e/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
"k8s.io/api/extensions/v1beta1"
"k8s.io/api/networking/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/apimachinery/pkg/util/uuid"
Expand Down Expand Up @@ -588,16 +588,21 @@ func waitForReplicas(deploymentName, namespace string, kubeClient kubernetes.Int

/** needed for image webhook policy tests: */

func createImagePolicyWebhookTestDeployment(nameprefix, namespace, tag, podname string, replicas int32) *v1beta1.Deployment {
func createImagePolicyWebhookTestDeployment(nameprefix, namespace, tag, podname string, replicas int32) *appsv1.Deployment {
zero := int64(0)
return &v1beta1.Deployment{
return &appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: nameprefix + string(uuid.NewUUID()),
Namespace: namespace,
Labels: map[string]string{},
},
Spec: v1beta1.DeploymentSpec{
Spec: appsv1.DeploymentSpec{
Replicas: &replicas,
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"app": podname,
},
},
Template: v1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
Expand Down

0 comments on commit 79d3428

Please sign in to comment.