From 91eba53035a19599a434a295ee8dd4615c585859 Mon Sep 17 00:00:00 2001 From: Sudarsan Reddy Date: Tue, 9 Aug 2022 11:14:12 +0100 Subject: [PATCH] TUN-6639: Validate cyclic ingress configuration This reverts commit d4d9a43dd7b673627532afcd08fdfe1aae916a60. We revert this change because the value this configuration addition brings is small (it only stops an explicit cyclic configuration versus not accounting for local hosts and ip based cycles amongst other things) whilst the potential inconvenience it may cause is high (for example, someone had a cyclic configuration as an ingress rule that they weren't even using). --- ingress/ingress.go | 4 ---- ingress/ingress_test.go | 10 ---------- 2 files changed, 14 deletions(-) diff --git a/ingress/ingress.go b/ingress/ingress.go index cc0fca55..05a90a8b 100644 --- a/ingress/ingress.go +++ b/ingress/ingress.go @@ -232,10 +232,6 @@ func validateIngress(ingress []config.UnvalidatedIngressRule, defaults OriginReq } else { service = newTCPOverWSService(u) } - - if u.Hostname() == r.Hostname { - return Ingress{}, fmt.Errorf("Cyclic Ingress configuration: Hostname:%s points to service:%s.", r.Hostname, r.Service) - } } if err := validateHostname(r, i, len(ingress)); err != nil { diff --git a/ingress/ingress_test.go b/ingress/ingress_test.go index 5bf3f912..1ff5e11c 100644 --- a/ingress/ingress_test.go +++ b/ingress/ingress_test.go @@ -404,16 +404,6 @@ ingress: service: https://localhost:8000 - hostname: "*" service: https://localhost:8001 -`}, - wantErr: true, - }, - { - name: "Cyclic hostname definition", - args: args{rawYAML: ` -ingress: - - hostname: "test.example.com" - service: https://test.example.com - - service: http_status_404 `}, wantErr: true, },