From 1a92159fa4c0455cf44ed208ce18d0918abf8921 Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Wed, 22 Nov 2017 21:20:04 -0300 Subject: [PATCH] Refactor annotations prefix helper --- internal/ingress/controller/controller.go | 7 ------- internal/ingress/resolver/main.go | 3 --- internal/ingress/resolver/mock.go | 7 ------- 3 files changed, 17 deletions(-) diff --git a/internal/ingress/controller/controller.go b/internal/ingress/controller/controller.go index 12d951e87..252406277 100644 --- a/internal/ingress/controller/controller.go +++ b/internal/ingress/controller/controller.go @@ -66,8 +66,6 @@ func init() { // Configuration contains all the settings required by an Ingress controller type Configuration struct { - AnnotationsPrefix string - APIServerHost string KubeConfigFile string Client clientset.Interface @@ -136,11 +134,6 @@ func (n NGINXController) GetService(name string) (*apiv1.Service, error) { return n.listers.Service.GetByName(name) } -// GetAnnotationWithPrefix returns the prefix of ingress annotations -func (n NGINXController) GetAnnotationWithPrefix(suffix string) string { - return fmt.Sprintf("%v/%v", n.cfg.AnnotationsPrefix, suffix) -} - // sync collects all the pieces required to assemble the configuration file and // then sends the content to the backend (OnUpdate) receiving the populated // template as response reloading the backend if is required. diff --git a/internal/ingress/resolver/main.go b/internal/ingress/resolver/main.go index 9fd43828f..b73144866 100644 --- a/internal/ingress/resolver/main.go +++ b/internal/ingress/resolver/main.go @@ -37,9 +37,6 @@ type Resolver interface { // GetService searches for services contenating the namespace and name using a the character / GetService(string) (*apiv1.Service, error) - - // GetAnnotationWithPrefix returns the prefix of the Ingress annotations - GetAnnotationWithPrefix(suffix string) string } // AuthSSLCert contains the necessary information to do certificate based diff --git a/internal/ingress/resolver/mock.go b/internal/ingress/resolver/mock.go index 7a11972b9..603a6593d 100644 --- a/internal/ingress/resolver/mock.go +++ b/internal/ingress/resolver/mock.go @@ -17,8 +17,6 @@ limitations under the License. package resolver import ( - "fmt" - apiv1 "k8s.io/api/core/v1" "k8s.io/ingress-nginx/internal/ingress/defaults" @@ -49,8 +47,3 @@ func (m Mock) GetAuthCertificate(string) (*AuthSSLCert, error) { func (m Mock) GetService(string) (*apiv1.Service, error) { return nil, nil } - -// GetAnnotationWithPrefix returns the prefix of the Ingress annotations -func (m Mock) GetAnnotationWithPrefix(name string) string { - return fmt.Sprintf("nginx/%v", name) -}