From 521be9b2588d5ea9e5e1bb5f4679f5bd70b7cc27 Mon Sep 17 00:00:00 2001 From: Alex Kursell Date: Fri, 22 Feb 2019 10:14:09 -0500 Subject: [PATCH] Remove interface type from annotations.Ingress struct --- internal/ingress/annotations/annotations.go | 5 +++-- internal/ingress/controller/template/template.go | 2 +- internal/ingress/types.go | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/ingress/annotations/annotations.go b/internal/ingress/annotations/annotations.go index d6772b169..0f10c3981 100644 --- a/internal/ingress/annotations/annotations.go +++ b/internal/ingress/annotations/annotations.go @@ -80,7 +80,8 @@ type Ingress struct { CorsConfig cors.Config CustomHTTPErrors []int DefaultBackend *apiv1.Service - Denied error + //TODO: Change this back into an error when https://github.com/imdario/mergo/issues/100 is resolved + Denied string ExternalAuth authreq.Config HTTP2PushPreload bool Proxy proxy.Config @@ -182,7 +183,7 @@ func (e Extractor) Extract(ing *extensions.Ingress) *Ingress { _, alreadyDenied := data[DeniedKeyName] if !alreadyDenied { - data[DeniedKeyName] = err + data[DeniedKeyName] = err.Error() klog.Errorf("error reading %v annotation in Ingress %v/%v: %v", name, ing.GetNamespace(), ing.GetName(), err) continue } diff --git a/internal/ingress/controller/template/template.go b/internal/ingress/controller/template/template.go index 427a9a1c8..d04ff7ed7 100644 --- a/internal/ingress/controller/template/template.go +++ b/internal/ingress/controller/template/template.go @@ -611,7 +611,7 @@ func isLocationAllowed(input interface{}) bool { return false } - return loc.Denied == nil + return loc.Denied == "" } var ( diff --git a/internal/ingress/types.go b/internal/ingress/types.go index f4773131b..7872c0c57 100644 --- a/internal/ingress/types.go +++ b/internal/ingress/types.go @@ -239,7 +239,7 @@ type Location struct { BasicDigestAuth auth.Config `json:"basicDigestAuth,omitempty"` // Denied returns an error when this location cannot not be allowed // Requesting a denied location should return HTTP code 403. - Denied error `json:"denied,omitempty"` + Denied string `json:"denied,omitempty"` // CorsConfig returns the Cors Configuration for the ingress rule // +optional CorsConfig cors.Config `json:"corsConfig,omitempty"`