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,15 +22,14 @@ import (
"github.com/onsi/ginkgo"
"github.com/stretchr/testify/assert"
networkingv1beta1 "k8s.io/api/networking/v1beta1"
"k8s.io/apimachinery/pkg/util/intstr"
networking "k8s.io/api/networking/v1"
"k8s.io/ingress-nginx/test/e2e/framework"
)
var _ = framework.IngressNginxDescribe("single ingress - multiple hosts", func() {
f := framework.NewDefaultFramework("simh")
pathprefix := networking.PathTypePrefix
ginkgo.BeforeEach(func() {
f.NewEchoDeploymentWithNameAndReplicas("first-service", 1)
f.NewEchoDeploymentWithNameAndReplicas("second-service", 1)
@ -43,16 +42,21 @@ var _ = framework.IngressNginxDescribe("single ingress - multiple hosts", func()
ing := framework.NewSingleIngress("simh", "/", "first.host", f.Namespace, "first-service", 80, annotations)
ing.Spec.Rules = append(ing.Spec.Rules, networkingv1beta1.IngressRule{
ing.Spec.Rules = append(ing.Spec.Rules, networking.IngressRule{
Host: "second.host",
IngressRuleValue: networkingv1beta1.IngressRuleValue{
HTTP: &networkingv1beta1.HTTPIngressRuleValue{
Paths: []networkingv1beta1.HTTPIngressPath{
IngressRuleValue: networking.IngressRuleValue{
HTTP: &networking.HTTPIngressRuleValue{
Paths: []networking.HTTPIngressPath{
{
Path: "/",
Backend: networkingv1beta1.IngressBackend{
ServiceName: "second-service",
ServicePort: intstr.FromInt(80),
Path: "/",
PathType: &pathprefix,
Backend: networking.IngressBackend{
Service: &networking.IngressServiceBackend{
Name: "second-service",
Port: networking.ServiceBackendPort{
Number: int32(80),
},
},
},
},
},

View file

@ -22,7 +22,7 @@ import (
"github.com/onsi/ginkgo"
"github.com/stretchr/testify/assert"
networkingv1beta1 "k8s.io/api/networking/v1beta1"
networking "k8s.io/api/networking/v1"
"k8s.io/ingress-nginx/test/e2e/framework"
)
@ -35,9 +35,6 @@ var _ = framework.IngressNginxDescribe("[Ingress] [PathType] exact", func() {
})
ginkgo.It("should choose exact location for /exact", func() {
if !f.IsIngressV1Beta1Ready {
ginkgo.Skip("Test requires Kubernetes v1.18 or higher")
}
host := "exact.path"
@ -45,7 +42,7 @@ var _ = framework.IngressNginxDescribe("[Ingress] [PathType] exact", func() {
"nginx.ingress.kubernetes.io/configuration-snippet": `more_set_input_headers "pathType: exact";`,
}
var exactPathType = networkingv1beta1.PathTypeExact
var exactPathType = networking.PathTypeExact
ing := framework.NewSingleIngress("exact", "/exact", host, f.Namespace, framework.EchoService, 80, annotations)
ing.Spec.Rules[0].IngressRuleValue.HTTP.Paths[0].PathType = &exactPathType
f.EnsureIngress(ing)

View file

@ -23,7 +23,7 @@ import (
"github.com/onsi/ginkgo"
"github.com/stretchr/testify/assert"
networkingv1beta1 "k8s.io/api/networking/v1beta1"
networking "k8s.io/api/networking/v1"
"k8s.io/ingress-nginx/test/e2e/framework"
)
@ -34,12 +34,9 @@ var _ = framework.IngressNginxDescribe("[Ingress] [PathType] mix Exact and Prefi
f.NewEchoDeployment()
})
var exactPathType = networkingv1beta1.PathTypeExact
var exactPathType = networking.PathTypeExact
ginkgo.It("should choose the correct location", func() {
if !f.IsIngressV1Beta1Ready {
ginkgo.Skip("Test requires Kubernetes v1.18 or higher")
}
host := "mixed.path"

View file

@ -22,9 +22,8 @@ import (
"strings"
"github.com/onsi/ginkgo"
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"
)
@ -62,9 +61,13 @@ var _ = framework.IngressNginxDescribe("[Ingress] definition without host", func
Namespace: f.Namespace,
},
Spec: networking.IngressSpec{
Backend: &networking.IngressBackend{
ServiceName: framework.EchoService,
ServicePort: intstr.FromInt(80),
DefaultBackend: &networking.IngressBackend{
Service: &networking.IngressServiceBackend{
Name: framework.EchoService,
Port: networking.ServiceBackendPort{
Number: int32(80),
},
},
},
Rules: []networking.IngressRule{
{