Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolves issue with proxy-redirect nginx configuration #2423

Merged
merged 1 commit into from
May 18, 2018

Conversation

diazjf
Copy link

@diazjf diazjf commented Apr 26, 2018

Resolves an issue where the proxy-redirect annotations were not generating the correct configuration possibly because of user error. This is resolved by only setting the proxy_redirect if both proxy-redirect-from and proxy-redirect-to have valid values.

Fixes #2074

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 26, 2018
@diazjf
Copy link
Author

diazjf commented Apr 26, 2018

Still need to test this btw.

@diazjf
Copy link
Author

diazjf commented May 13, 2018

kubectl exec -it -n kube-system nginx-ingress-controller-lwp77 cat /etc/nginx/nginx.conf | grep proxy_redirect

proxy_redirect                          off;
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: cafe-ingress
  annotations:
    nginx.ingress.kubernetes.io/proxy-redirect-from: "default"
    nginx.ingress.kubernetes.io/proxy-redirect-to: "goodbye.com"
spec:
  rules:
  - host: hello.com
    http:
      paths:
      - path: /tea
        backend:
          serviceName: tea-svc
          servicePort: 80
      - path: /coffee
        backend:
          serviceName: coffee-svc
          servicePort: 80

kubectl exec -it -n kube-system nginx-ingress-controller-lwp77 cat /etc/nginx/nginx.conf | grep proxy_redirect

proxy_redirect                          default;
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: cafe-ingress
  annotations:
    nginx.ingress.kubernetes.io/proxy-redirect-from: "heyy.com"
    nginx.ingress.kubernetes.io/proxy-redirect-to: "goodbye.com"
spec:
  rules:
  - host: hello.com
    http:
      paths:
      - path: /tea
        backend:
          serviceName: tea-svc
          servicePort: 80
      - path: /coffee
        backend:
          serviceName: coffee-svc
          servicePort: 80


kubectl exec -it -n kube-system nginx-ingress-controller-lwp77 cat /etc/nginx/nginx.conf | grep proxy_redirect

proxy_redirect                          heyy.com goodbye.com;

@aledbf
Copy link
Member

aledbf commented May 14, 2018

@diazjf please add e2e tests with the same checks you showed in the comments

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 15, 2018
@diazjf
Copy link
Author

diazjf commented May 15, 2018

@aledbf in order to run E2E Tests is the following correct:

  1. Setup Minikube with image based off of the current branch.
  2. Change Context to Minikube
  3. run make e2e-test

I am getting the following errors:

ingress-nginx git:(fix-2074) ✗ make e2e-test                                       
Ginkgo Version 1.5.0
Compiling e2e...
    compiled e2e.test
Running Suite: nginx-ingress-controller e2e suite
=================================================
Random Seed: 1526396875 - Will randomize all specs
Will run 36 specs

Running in parallel across 2 nodes

[BeforeEach] [nginx-ingress] Annotations - lua-resty-waf
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:80
STEP: Creating a kubernetes client
May 15 10:07:55.361: INFO: >>> config: /Users/fernandodiaz/.kube/config

STEP: Building a namespace api object
May 15 10:07:55.401: INFO: Created namespace: e2e-tests-luarestywaf-1526396875365084743-hvjwv
STEP: Starting new ingress controller
[AfterEach] [nginx-ingress] Annotations - lua-resty-waf
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:81
STEP: Waiting for test namespace to no longer exist


• Failure in Spec Setup (BeforeEach) [300.948 seconds]
[nginx-ingress] Annotations - lua-resty-waf
/Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:142
  when lua-resty-waf is not enabled [BeforeEach]
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/annotations/luarestywaf.go:106
    should run in simulate mode
    /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/annotations/luarestywaf.go:120

    Expected error:
        <*errors.errorString | 0xc4200c8ef0>: {
            s: "timed out waiting for the condition",
        }
        timed out waiting for the condition
    not to have occurred

    /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:113

    Full Stack Trace
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/vendor/github.com/onsi/gomega/internal/assertion/assertion.go:69 +0x1ed
    k8s.io/ingress-nginx/vendor/github.com/onsi/gomega/internal/assertion.(*Assertion).NotTo(0xc4203bd340, 0x1e47a60, 0x25bd548, 0x0, 0x0, 0x0, 0xc4203bd340)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/vendor/github.com/onsi/gomega/internal/assertion/assertion.go:43 +0xae
    k8s.io/ingress-nginx/test/e2e/framework.(*Framework).BeforeEach(0xc4202cefa0)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:113 +0x60a
    k8s.io/ingress-nginx/test/e2e/framework.(*Framework).BeforeEach-fm()
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:80 +0x2a
    k8s.io/ingress-nginx/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync(0xc420351440, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/e2e.go:53 +0x172
    k8s.io/ingress-nginx/test/e2e.TestE2E(0xc4201b81e0)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/e2e_test.go:36 +0x2b
    testing.tRunner(0xc4201b81e0, 0x1dcc658)
        /usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:777 +0xd0
    created by testing.(*T).Run
        /usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:824 +0x2e0
    
------------------------------
[BeforeEach] [nginx-ingress] No Auth locations
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:80
STEP: Creating a kubernetes client
May 15 10:07:55.361: INFO: >>> config: /Users/fernandodiaz/.kube/config

STEP: Building a namespace api object
May 15 10:07:55.395: INFO: Created namespace: e2e-tests-no-auth-locations-1526396875364965672-v267z
STEP: Starting new ingress controller
[AfterEach] [nginx-ingress] No Auth locations
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:81
STEP: Waiting for test namespace to no longer exist
[AfterEach] [nginx-ingress] No Auth locations
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/settings/no_auth_locations.go:63


• Failure in Spec Setup (BeforeEach) [300.979 seconds]
[nginx-ingress] No Auth locations
/Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:142
  should return status code 200 when accessing '/noauth' unauthenticated [BeforeEach]
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/settings/no_auth_locations.go:100

  Expected error:
      <*errors.errorString | 0xc4200c2ef0>: {
          s: "timed out waiting for the condition",
      }
      timed out waiting for the condition
  not to have occurred

  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:113

  Full Stack Trace
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/vendor/github.com/onsi/gomega/internal/assertion/assertion.go:69 +0x1ed
  k8s.io/ingress-nginx/vendor/github.com/onsi/gomega/internal/assertion.(*Assertion).NotTo(0xc42041c180, 0x1e47a60, 0x25bd548, 0x0, 0x0, 0x0, 0xc42041c180)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/vendor/github.com/onsi/gomega/internal/assertion/assertion.go:43 +0xae
  k8s.io/ingress-nginx/test/e2e/framework.(*Framework).BeforeEach(0xc4200e1270)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:113 +0x60a
  k8s.io/ingress-nginx/test/e2e/framework.(*Framework).BeforeEach-fm()
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:80 +0x2a
  k8s.io/ingress-nginx/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync(0xc4200e7b00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/e2e.go:53 +0x172
  k8s.io/ingress-nginx/test/e2e.TestE2E(0xc4201c41e0)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/e2e_test.go:36 +0x2b
  testing.tRunner(0xc4201c41e0, 0x1dcc658)
        /usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:777 +0xd0
  created by testing.(*T).Run
        /usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:824 +0x2e0
  
------------------------------
[BeforeEach] [nginx-ingress] Annotations - lua-resty-waf
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:80
STEP: Creating a kubernetes client
May 15 10:12:56.313: INFO: >>> config: /Users/fernandodiaz/.kube/config

STEP: Building a namespace api object
May 15 10:12:56.323: INFO: Created namespace: e2e-tests-luarestywaf-1526397176315450125-hfrqg
STEP: Starting new ingress controller
[AfterEach] [nginx-ingress] Annotations - lua-resty-waf
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:81
STEP: Waiting for test namespace to no longer exist


• Failure in Spec Setup (BeforeEach) [300.917 seconds]
[nginx-ingress] Annotations - lua-resty-waf
/Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:142
  when lua-resty-waf is not enabled [BeforeEach]
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/annotations/luarestywaf.go:106
    should run in simulate mode
    /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/annotations/luarestywaf.go:120

    Expected error:
        <*errors.errorString | 0xc4200c8ef0>: {
            s: "timed out waiting for the condition",
        }
        timed out waiting for the condition
    not to have occurred

    /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:113

    Full Stack Trace
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/vendor/github.com/onsi/gomega/internal/assertion/assertion.go:69 +0x1ed
    k8s.io/ingress-nginx/vendor/github.com/onsi/gomega/internal/assertion.(*Assertion).NotTo(0xc4203bd5c0, 0x1e47a60, 0x25bd548, 0x0, 0x0, 0x0, 0xc4203bd5c0)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/vendor/github.com/onsi/gomega/internal/assertion/assertion.go:43 +0xae
    k8s.io/ingress-nginx/test/e2e/framework.(*Framework).BeforeEach(0xc4202cefa0)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:113 +0x60a
    k8s.io/ingress-nginx/test/e2e/framework.(*Framework).BeforeEach-fm()
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:80 +0x2a
    k8s.io/ingress-nginx/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync(0xc420351440, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/e2e.go:53 +0x172
    k8s.io/ingress-nginx/test/e2e.TestE2E(0xc4201b81e0)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/e2e_test.go:36 +0x2b
    testing.tRunner(0xc4201b81e0, 0x1dcc658)
        /usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:777 +0xd0
    created by testing.(*T).Run
        /usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:824 +0x2e0
    
------------------------------
[BeforeEach] [nginx-ingress] No Auth locations
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:80
STEP: Creating a kubernetes client
May 15 10:12:56.343: INFO: >>> config: /Users/fernandodiaz/.kube/config

STEP: Building a namespace api object
May 15 10:12:56.353: INFO: Created namespace: e2e-tests-no-auth-locations-1526397176345611178-rp2xm
STEP: Starting new ingress controller
[AfterEach] [nginx-ingress] No Auth locations
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:81
STEP: Waiting for test namespace to no longer exist
[AfterEach] [nginx-ingress] No Auth locations
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/settings/no_auth_locations.go:63


• Failure in Spec Setup (BeforeEach) [300.905 seconds]
[nginx-ingress] No Auth locations
/Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:142
  should return status code 200 when accessing '/noauth' unauthenticated [BeforeEach]
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/settings/no_auth_locations.go:100

  Expected error:
      <*errors.errorString | 0xc4200c2ef0>: {
          s: "timed out waiting for the condition",
      }
      timed out waiting for the condition
  not to have occurred

  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:113

  Full Stack Trace
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/vendor/github.com/onsi/gomega/internal/assertion/assertion.go:69 +0x1ed
  k8s.io/ingress-nginx/vendor/github.com/onsi/gomega/internal/assertion.(*Assertion).NotTo(0xc42028f380, 0x1e47a60, 0x25bd548, 0x0, 0x0, 0x0, 0xc42028f380)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/vendor/github.com/onsi/gomega/internal/assertion/assertion.go:43 +0xae
  k8s.io/ingress-nginx/test/e2e/framework.(*Framework).BeforeEach(0xc4200e1270)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:113 +0x60a
  k8s.io/ingress-nginx/test/e2e/framework.(*Framework).BeforeEach-fm()
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:80 +0x2a
  k8s.io/ingress-nginx/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync(0xc4200e7b00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/e2e.go:53 +0x172
  k8s.io/ingress-nginx/test/e2e.TestE2E(0xc4201c41e0)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/e2e_test.go:36 +0x2b
  testing.tRunner(0xc4201c41e0, 0x1dcc658)
        /usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:777 +0xd0
  created by testing.(*T).Run
        /usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:824 +0x2e0
  
------------------------------
[BeforeEach] [nginx-ingress] Annotations - Affinity
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:80
STEP: Creating a kubernetes client
May 15 10:17:57.212: INFO: >>> config: /Users/fernandodiaz/.kube/config

STEP: Building a namespace api object
May 15 10:17:57.223: INFO: Created namespace: e2e-tests-affinity-1526397477215702105-nwj9m
STEP: Starting new ingress controller
[AfterEach] [nginx-ingress] Annotations - Affinity
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:81
STEP: Waiting for test namespace to no longer exist
[AfterEach] [nginx-ingress] Annotations - Affinity
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/annotations/affinity.go:43


• Failure in Spec Setup (BeforeEach) [300.935 seconds]
[nginx-ingress] Annotations - Affinity
/Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:142
  should set sticky cookie SERVERID [BeforeEach]
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/annotations/affinity.go:46

  Expected error:
      <*errors.errorString | 0xc4200c2ef0>: {
          s: "timed out waiting for the condition",
      }
      timed out waiting for the condition
  not to have occurred

  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:113

  Full Stack Trace
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/vendor/github.com/onsi/gomega/internal/assertion/assertion.go:69 +0x1ed
  k8s.io/ingress-nginx/vendor/github.com/onsi/gomega/internal/assertion.(*Assertion).NotTo(0xc42065f200, 0x1e47a60, 0x25bd548, 0x0, 0x0, 0x0, 0xc42065f200)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/vendor/github.com/onsi/gomega/internal/assertion/assertion.go:43 +0xae
  k8s.io/ingress-nginx/test/e2e/framework.(*Framework).BeforeEach(0xc4202da6e0)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:113 +0x60a
  k8s.io/ingress-nginx/test/e2e/framework.(*Framework).BeforeEach-fm()
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:80 +0x2a
  k8s.io/ingress-nginx/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync(0xc4200e7860, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/e2e.go:53 +0x172
  k8s.io/ingress-nginx/test/e2e.TestE2E(0xc4201c41e0)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/e2e_test.go:36 +0x2b
  testing.tRunner(0xc4201c41e0, 0x1dcc658)
        /usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:777 +0xd0
  created by testing.(*T).Run
        /usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:824 +0x2e0
  
------------------------------
[BeforeEach] [nginx-ingress] Annotations - Affinity
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:80
STEP: Creating a kubernetes client
May 15 10:17:57.194: INFO: >>> config: /Users/fernandodiaz/.kube/config

STEP: Building a namespace api object
May 15 10:17:57.200: INFO: Created namespace: e2e-tests-affinity-1526397477197265222-jwr8v
STEP: Starting new ingress controller
[AfterEach] [nginx-ingress] Annotations - Affinity
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:81
STEP: Waiting for test namespace to no longer exist
[AfterEach] [nginx-ingress] Annotations - Affinity
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/annotations/affinity.go:43


• Failure in Spec Setup (BeforeEach) [300.979 seconds]
[nginx-ingress] Annotations - Affinity
/Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:142
  should redirect to '/something' with enabled affinity [BeforeEach]
  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/annotations/affinity.go:98

  Expected error:
      <*errors.errorString | 0xc4200c8ef0>: {
          s: "timed out waiting for the condition",
      }
      timed out waiting for the condition
  not to have occurred

  /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:113

  Full Stack Trace
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/vendor/github.com/onsi/gomega/internal/assertion/assertion.go:69 +0x1ed
  k8s.io/ingress-nginx/vendor/github.com/onsi/gomega/internal/assertion.(*Assertion).NotTo(0xc42004d600, 0x1e47a60, 0x25bd548, 0x0, 0x0, 0x0, 0xc42004d600)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/vendor/github.com/onsi/gomega/internal/assertion/assertion.go:43 +0xae
  k8s.io/ingress-nginx/test/e2e/framework.(*Framework).BeforeEach(0xc4202ce6e0)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:113 +0x60a
  k8s.io/ingress-nginx/test/e2e/framework.(*Framework).BeforeEach-fm()
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:80 +0x2a
  k8s.io/ingress-nginx/vendor/github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync(0xc4200ed860, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/e2e.go:53 +0x172
  k8s.io/ingress-nginx/test/e2e.TestE2E(0xc4201b81e0)
        /Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/e2e_test.go:36 +0x2b
  testing.tRunner(0xc4201b81e0, 0x1dcc658)
        /usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:777 +0xd0
  created by testing.(*T).Run
        /usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:824 +0x2e0
  
------------------------------
^C

Summarizing 6 Failures:

[Fail] [nginx-ingress] Annotations - lua-resty-waf [BeforeEach] when lua-resty-waf is not enabled should run in simulate mode 
/Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:113

[Fail] [nginx-ingress] No Auth locations [BeforeEach] should return status code 200 when accessing '/noauth' unauthenticated 
/Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:113

[Fail] [nginx-ingress] Annotations - lua-resty-waf [BeforeEach] when lua-resty-waf is not enabled should run in simulate mode 
/Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:113

[Fail] [nginx-ingress] No Auth locations [BeforeEach] should return status code 200 when accessing '/noauth' unauthenticated 
/Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:113

[Fail] [nginx-ingress] Annotations - Affinity [BeforeEach] should set sticky cookie SERVERID 
/Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:113

[Fail] [nginx-ingress] Annotations - Affinity [BeforeEach] should redirect to '/something' with enabled affinity 
/Users/fernandodiaz/Desktop/go-stuff-community/src/k8s.io/ingress-nginx/test/e2e/framework/framework.go:113

Ran 4 of 4 Specs in 1015.781 seconds
FAIL! -- 2 Passed | 2 Failed | 2 Flaked | 0 Pending | 0 Skipped


Ginkgo ran 1 suite in 16m55.817344721s
Test Suite Failed
make: *** [e2e-test] Error 1

Also another question, should we add RBAC to https://github.com/kubernetes/minikube/pull/2788/files

@diazjf
Copy link
Author

diazjf commented May 15, 2018

@aledbf ^

@aledbf
Copy link
Member

aledbf commented May 15, 2018

@diazjf please rebase and run make dev-env && make e2e-test

https://github.com/kubernetes/ingress-nginx/blob/master/docs/development.md#initial-developer-environment-build

Also another question, should we add RBAC to https://github.com/kubernetes/minikube/pull/2788/files

Yes, before the end of the day I will open a PR to fix this.

@diazjf diazjf force-pushed the fix-2074 branch 3 times, most recently from d6d622e to 397bee7 Compare May 16, 2018 16:18
Resolves an issue where the proxy-redirect annotations were not generating the
correct configuration possibly because of user error. This is done by only
setting the proxy_redirect if both proxy-redirect-from and proxy-redirect-to
have valid values. Also adds the e2e tests.

Fixes kubernetes#2074
@@ -262,7 +262,7 @@ func (f *Framework) matchNginxConditions(name string, matcher func(cfg string) b
glog.Infof("nginx.conf:\n%v", o)
}

if matcher(o) {
if matcher(strings.Join(strings.Fields(o), " ")) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this there are sections with some variable spaces within the template

strings.Fields(o) = splits everything up by 1 or more spaces, then we join each item, with spaces in-between

@diazjf
Copy link
Author

diazjf commented May 17, 2018

@aledbf I think this is ready now. I still have a few problems running the e2e-tests locally. I'll try sometime later after #2515 is merged

@codecov-io
Copy link

Codecov Report

Merging #2423 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2423      +/-   ##
==========================================
+ Coverage   40.74%   40.76%   +0.01%     
==========================================
  Files          73       73              
  Lines        5021     5022       +1     
==========================================
+ Hits         2046     2047       +1     
  Misses       2701     2701              
  Partials      274      274
Impacted Files Coverage Δ
internal/ingress/controller/config/config.go 98.23% <100%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d577fe2...e224259. Read the comment docs.

@aledbf
Copy link
Member

aledbf commented May 17, 2018

/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 17, 2018
@aledbf
Copy link
Member

aledbf commented May 17, 2018

@diazjf thanks!

@aledbf
Copy link
Member

aledbf commented May 18, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 18, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aledbf, diazjf

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit aa256ac into kubernetes:master May 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

proxy-redirect-* annotations dont have any effect on geenrated nginx.conf
6 participants