Fix golangci-lint errors (#10196)
* Fix golangci-lint errors Signed-off-by: z1cheng <imchench@gmail.com> * Fix dupl errors Signed-off-by: z1cheng <imchench@gmail.com> * Fix comments Signed-off-by: z1cheng <imchench@gmail.com> * Fix errcheck lint errors Signed-off-by: z1cheng <imchench@gmail.com> * Fix assert in e2e test Signed-off-by: z1cheng <imchench@gmail.com> * Not interrupt the waitForPodsReady Signed-off-by: z1cheng <imchench@gmail.com> * Replace string with constant Signed-off-by: z1cheng <imchench@gmail.com> * Fix comments Signed-off-by: z1cheng <imchench@gmail.com> * Revert write file permision Signed-off-by: z1cheng <imchench@gmail.com> --------- Signed-off-by: z1cheng <imchench@gmail.com>
This commit is contained in:
parent
46d87d3462
commit
b3060bfbd0
253 changed files with 2434 additions and 2113 deletions
|
|
@ -33,12 +33,14 @@ import (
|
|||
"k8s.io/ingress-nginx/test/e2e/framework"
|
||||
)
|
||||
|
||||
const echoHost = "echo"
|
||||
|
||||
var _ = framework.IngressNginxDescribe("[Service] Type ExternalName", func() {
|
||||
f := framework.NewDefaultFramework("type-externalname", framework.WithHTTPBunEnabled())
|
||||
|
||||
ginkgo.It("works with external name set to incomplete fqdn", func() {
|
||||
f.NewEchoDeployment()
|
||||
host := "echo"
|
||||
host := echoHost
|
||||
|
||||
svc := &corev1.Service{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
|
|
@ -74,7 +76,7 @@ var _ = framework.IngressNginxDescribe("[Service] Type ExternalName", func() {
|
|||
})
|
||||
|
||||
ginkgo.It("should return 200 for service type=ExternalName without a port defined", func() {
|
||||
host := "echo"
|
||||
host := echoHost
|
||||
|
||||
svc := &corev1.Service{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
|
|
@ -114,7 +116,7 @@ var _ = framework.IngressNginxDescribe("[Service] Type ExternalName", func() {
|
|||
})
|
||||
|
||||
ginkgo.It("should return 200 for service type=ExternalName with a port defined", func() {
|
||||
host := "echo"
|
||||
host := echoHost
|
||||
|
||||
svc := framework.BuildNIPExternalNameService(f, f.HTTPBunIP, host)
|
||||
f.EnsureService(svc)
|
||||
|
|
@ -144,7 +146,7 @@ var _ = framework.IngressNginxDescribe("[Service] Type ExternalName", func() {
|
|||
})
|
||||
|
||||
ginkgo.It("should return status 502 for service type=ExternalName with an invalid host", func() {
|
||||
host := "echo"
|
||||
host := echoHost
|
||||
|
||||
svc := &corev1.Service{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
|
|
@ -180,7 +182,7 @@ var _ = framework.IngressNginxDescribe("[Service] Type ExternalName", func() {
|
|||
})
|
||||
|
||||
ginkgo.It("should return 200 for service type=ExternalName using a port name", func() {
|
||||
host := "echo"
|
||||
host := echoHost
|
||||
|
||||
svc := framework.BuildNIPExternalNameService(f, f.HTTPBunIP, host)
|
||||
f.EnsureService(svc)
|
||||
|
|
@ -221,7 +223,7 @@ var _ = framework.IngressNginxDescribe("[Service] Type ExternalName", func() {
|
|||
})
|
||||
|
||||
ginkgo.It("should return 200 for service type=ExternalName using FQDN with trailing dot", func() {
|
||||
host := "echo"
|
||||
host := echoHost
|
||||
|
||||
svc := &corev1.Service{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
|
|
@ -257,7 +259,7 @@ var _ = framework.IngressNginxDescribe("[Service] Type ExternalName", func() {
|
|||
})
|
||||
|
||||
ginkgo.It("should update the external name after a service update", func() {
|
||||
host := "echo"
|
||||
host := echoHost
|
||||
|
||||
svc := framework.BuildNIPExternalNameService(f, f.HTTPBunIP, host)
|
||||
f.EnsureService(svc)
|
||||
|
|
@ -306,7 +308,7 @@ var _ = framework.IngressNginxDescribe("[Service] Type ExternalName", func() {
|
|||
Get(context.TODO(), framework.NIPService, metav1.GetOptions{})
|
||||
assert.Nil(ginkgo.GinkgoT(), err, "unexpected error obtaining external service")
|
||||
|
||||
//Deploy a new instance to switch routing to
|
||||
// Deploy a new instance to switch routing to
|
||||
ip := f.NewHttpbunDeployment(framework.WithDeploymentName("eu-server"))
|
||||
svc.Spec.ExternalName = framework.BuildNIPHost(ip)
|
||||
|
||||
|
|
@ -335,12 +337,12 @@ var _ = framework.IngressNginxDescribe("[Service] Type ExternalName", func() {
|
|||
assert.Contains(
|
||||
ginkgo.GinkgoT(),
|
||||
output,
|
||||
fmt.Sprintf(`"address": "%s"`, framework.BuildNIPHost(ip)),
|
||||
fmt.Sprintf(`"address": %q`, framework.BuildNIPHost(ip)),
|
||||
)
|
||||
})
|
||||
|
||||
ginkgo.It("should sync ingress on external name service addition/deletion", func() {
|
||||
host := "echo"
|
||||
host := echoHost
|
||||
|
||||
// Create the Ingress first
|
||||
ing := framework.NewSingleIngress(host,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue