Drop v1beta1 from ingress nginx (#7156)

* Drop v1beta1 from ingress nginx

Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>

* Fix intorstr logic in controller

Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>

* fixing admission

Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>

* more intorstr fixing

* correct template rendering

Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>

* Fix e2e tests for v1 api

Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>

* Fix gofmt errors

* This is finally working...almost there...

Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>

* Re-add removed validation of AdmissionReview
This commit is contained in:
Ricardo Katz 2021-06-23 18:20:10 -03:00 committed by GitHub
parent a8408cdb51
commit 78afe7e389
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
159 changed files with 1217 additions and 1008 deletions

View file

@ -22,13 +22,14 @@ import (
"github.com/onsi/ginkgo"
corev1 "k8s.io/api/core/v1"
networking "k8s.io/api/networking/v1beta1"
networking "k8s.io/api/networking/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/ingress-nginx/test/e2e/framework"
)
var pathtype = networking.PathTypePrefix
var _ = framework.IngressNginxDescribe("[Service] backend status code 503", func() {
f := framework.NewDefaultFramework("service-backend")
@ -86,10 +87,15 @@ func buildIngressWithNonexistentService(host, namespace, path string) *networkin
HTTP: &networking.HTTPIngressRuleValue{
Paths: []networking.HTTPIngressPath{
{
Path: path,
Path: path,
PathType: &pathtype,
Backend: networking.IngressBackend{
ServiceName: backendService,
ServicePort: intstr.FromInt(80),
Service: &networking.IngressServiceBackend{
Name: backendService,
Port: networking.ServiceBackendPort{
Number: int32(80),
},
},
},
},
},
@ -116,10 +122,15 @@ func buildIngressWithUnavailableServiceEndpoints(host, namespace, path string) (
HTTP: &networking.HTTPIngressRuleValue{
Paths: []networking.HTTPIngressPath{
{
Path: path,
Path: path,
PathType: &pathtype,
Backend: networking.IngressBackend{
ServiceName: backendService,
ServicePort: intstr.FromInt(80),
Service: &networking.IngressServiceBackend{
Name: backendService,
Port: networking.ServiceBackendPort{
Number: int32(80),
},
},
},
},
},

View file

@ -27,6 +27,7 @@ import (
"github.com/stretchr/testify/assert"
core "k8s.io/api/core/v1"
corev1 "k8s.io/api/core/v1"
networking "k8s.io/api/networking/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
@ -203,7 +204,15 @@ var _ = framework.IngressNginxDescribe("[Service] Type ExternalName", func() {
"nginx.ingress.kubernetes.io/upstream-vhost": "httpbin.org",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.HTTPBinService, 80, annotations)
ing.Spec.Rules[0].HTTP.Paths[0].Backend.ServicePort = intstr.FromString(host)
namedBackend := networking.IngressBackend{
Service: &networking.IngressServiceBackend{
Name: framework.HTTPBinService,
Port: networking.ServiceBackendPort{
Name: host,
},
},
}
ing.Spec.Rules[0].HTTP.Paths[0].Backend = namedBackend
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -276,7 +285,15 @@ var _ = framework.IngressNginxDescribe("[Service] Type ExternalName", func() {
"nginx.ingress.kubernetes.io/upstream-vhost": "httpbin.org",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.HTTPBinService, 80, annotations)
ing.Spec.Rules[0].HTTP.Paths[0].Backend.ServicePort = intstr.FromString(host)
namedBackend := networking.IngressBackend{
Service: &networking.IngressServiceBackend{
Name: framework.HTTPBinService,
Port: networking.ServiceBackendPort{
Name: host,
},
},
}
ing.Spec.Rules[0].HTTP.Paths[0].Backend = namedBackend
f.EnsureIngress(ing)
f.WaitForNginxServer(host,