From d9af197e62374a7a89135ecc72ece3527a72da22 Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Sun, 27 Dec 2020 22:26:51 -0300 Subject: [PATCH] Remove dead code --- internal/ingress/annotations/annotations_test.go | 2 -- internal/ingress/controller/checker.go | 2 +- internal/ingress/controller/store/store.go | 3 --- internal/ingress/controller/template/template.go | 7 +++---- test/e2e/framework/framework.go | 4 ---- test/e2e/lua/dynamic_configuration.go | 3 --- test/e2e/settings/ocsp/ocsp.go | 9 --------- 7 files changed, 4 insertions(+), 26 deletions(-) diff --git a/internal/ingress/annotations/annotations_test.go b/internal/ingress/annotations/annotations_test.go index 2e4da69a6..1a428e729 100644 --- a/internal/ingress/annotations/annotations_test.go +++ b/internal/ingress/annotations/annotations_test.go @@ -30,7 +30,6 @@ import ( ) var ( - annotationSecureVerifyCACert = parser.GetAnnotationWithPrefix("secure-verify-ca-secret") annotationPassthrough = parser.GetAnnotationWithPrefix("ssl-passthrough") annotationAffinityType = parser.GetAnnotationWithPrefix("affinity") annotationAffinityMode = parser.GetAnnotationWithPrefix("affinity-mode") @@ -39,7 +38,6 @@ var ( annotationCorsAllowHeaders = parser.GetAnnotationWithPrefix("cors-allow-headers") annotationCorsExposeHeaders = parser.GetAnnotationWithPrefix("cors-expose-headers") annotationCorsAllowCredentials = parser.GetAnnotationWithPrefix("cors-allow-credentials") - backendProtocol = parser.GetAnnotationWithPrefix("backend-protocol") defaultCorsMethods = "GET, PUT, POST, DELETE, PATCH, OPTIONS" defaultCorsHeaders = "DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization" annotationAffinityCookieName = parser.GetAnnotationWithPrefix("session-cookie-name") diff --git a/internal/ingress/controller/checker.go b/internal/ingress/controller/checker.go index 3603fccb8..81c6e12be 100644 --- a/internal/ingress/controller/checker.go +++ b/internal/ingress/controller/checker.go @@ -56,7 +56,7 @@ func (n *NGINXController) Check(_ *http.Request) error { return errors.Wrapf(err, "reading NGINX PID from file %v", nginx.PID) } - _, err = fs.NewProc(pid) + _, err = fs.Proc(pid) if err != nil { return errors.Wrapf(err, "checking for NGINX process with PID %v", pid) } diff --git a/internal/ingress/controller/store/store.go b/internal/ingress/controller/store/store.go index 1e36d6cc2..9e8ca06a4 100644 --- a/internal/ingress/controller/store/store.go +++ b/internal/ingress/controller/store/store.go @@ -630,9 +630,6 @@ func isCatchAllIngress(spec networkingv1beta1.IngressSpec) bool { return spec.Backend != nil && len(spec.Rules) == 0 } -// Default path type is Prefix to not break existing definitions -var defaultPathType = networkingv1beta1.PathTypePrefix - // syncIngress parses ingress annotations converting the value of the // annotation to a go struct func (s *k8sStore) syncIngress(ing *networkingv1beta1.Ingress) { diff --git a/internal/ingress/controller/template/template.go b/internal/ingress/controller/template/template.go index 3a6f02c64..247b3263c 100644 --- a/internal/ingress/controller/template/template.go +++ b/internal/ingress/controller/template/template.go @@ -50,10 +50,9 @@ import ( ) const ( - slash = "/" - nonIdempotent = "non_idempotent" - defBufferSize = 65535 - defAuthSigninRedirectParam = "rd" + slash = "/" + nonIdempotent = "non_idempotent" + defBufferSize = 65535 ) // TemplateWriter is the interface to render a template diff --git a/test/e2e/framework/framework.go b/test/e2e/framework/framework.go index ae5a96a38..8fb85e051 100644 --- a/test/e2e/framework/framework.go +++ b/test/e2e/framework/framework.go @@ -293,10 +293,6 @@ func (f *Framework) matchNginxCustomConditions(from string, to string, matcher f } } -func (f *Framework) getNginxConfigMap() (*v1.ConfigMap, error) { - return f.getConfigMap("nginx-ingress-controller") -} - func (f *Framework) getConfigMap(name string) (*v1.ConfigMap, error) { if f.KubeClientSet == nil { return nil, fmt.Errorf("KubeClientSet not initialized") diff --git a/test/e2e/lua/dynamic_configuration.go b/test/e2e/lua/dynamic_configuration.go index ce79827a7..5fcebac7d 100644 --- a/test/e2e/lua/dynamic_configuration.go +++ b/test/e2e/lua/dynamic_configuration.go @@ -33,11 +33,8 @@ import ( ) const ( - logDynamicConfigSuccess = "Dynamic reconfiguration succeeded" - logDynamicConfigFailure = "Dynamic reconfiguration failed" logRequireBackendReload = "Configuration changes detected, backend reload required" logBackendReloadSuccess = "Backend successfully reloaded" - logInitialConfigSync = "Initial synchronization of the NGINX configuration" waitForLuaSync = 5 * time.Second ) diff --git a/test/e2e/settings/ocsp/ocsp.go b/test/e2e/settings/ocsp/ocsp.go index 38055659d..873d10f2b 100644 --- a/test/e2e/settings/ocsp/ocsp.go +++ b/test/e2e/settings/ocsp/ocsp.go @@ -267,15 +267,6 @@ func prepareCertificates(namespace string) error { return nil } -func commandExists(name string) bool { - _, err := exec.Command(name, "version").Output() - if err != nil { - return false - } - - return true -} - func ocspserveDeployment(namespace string) (*appsv1.Deployment, *corev1.Service) { name := "ocspserve" return &appsv1.Deployment{