Migrate ingress definitions from extensions to networking.k8s.io

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-12-12 20:12:12 -03:00
parent be1907142b
commit 0dce5be743
49 changed files with 186 additions and 189 deletions

View file

@ -25,7 +25,7 @@ import (
"github.com/parnurzeal/gorequest"
corev1 "k8s.io/api/core/v1"
extensions "k8s.io/api/extensions/v1beta1"
networking "k8s.io/api/networking/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
@ -85,23 +85,23 @@ var _ = framework.IngressNginxDescribe("Service backend - 503", func() {
})
func buildIngressWithNonexistentService(host, namespace, path string) *extensions.Ingress {
func buildIngressWithNonexistentService(host, namespace, path string) *networking.Ingress {
backendService := "nonexistent-svc"
return &extensions.Ingress{
return &networking.Ingress{
ObjectMeta: metav1.ObjectMeta{
Name: host,
Namespace: namespace,
},
Spec: extensions.IngressSpec{
Rules: []extensions.IngressRule{
Spec: networking.IngressSpec{
Rules: []networking.IngressRule{
{
Host: host,
IngressRuleValue: extensions.IngressRuleValue{
HTTP: &extensions.HTTPIngressRuleValue{
Paths: []extensions.HTTPIngressPath{
IngressRuleValue: networking.IngressRuleValue{
HTTP: &networking.HTTPIngressRuleValue{
Paths: []networking.HTTPIngressPath{
{
Path: path,
Backend: extensions.IngressBackend{
Backend: networking.IngressBackend{
ServiceName: backendService,
ServicePort: intstr.FromInt(80),
},
@ -115,23 +115,23 @@ func buildIngressWithNonexistentService(host, namespace, path string) *extension
}
}
func buildIngressWithUnavailableServiceEndpoints(host, namespace, path string) (*extensions.Ingress, *corev1.Service) {
func buildIngressWithUnavailableServiceEndpoints(host, namespace, path string) (*networking.Ingress, *corev1.Service) {
backendService := "unavailable-svc"
return &extensions.Ingress{
return &networking.Ingress{
ObjectMeta: metav1.ObjectMeta{
Name: host,
Namespace: namespace,
},
Spec: extensions.IngressSpec{
Rules: []extensions.IngressRule{
Spec: networking.IngressSpec{
Rules: []networking.IngressRule{
{
Host: host,
IngressRuleValue: extensions.IngressRuleValue{
HTTP: &extensions.HTTPIngressRuleValue{
Paths: []extensions.HTTPIngressPath{
IngressRuleValue: networking.IngressRuleValue{
HTTP: &networking.HTTPIngressRuleValue{
Paths: []networking.HTTPIngressPath{
{
Path: path,
Backend: extensions.IngressBackend{
Backend: networking.IngressBackend{
ServiceName: backendService,
ServicePort: intstr.FromInt(80),
},