Signed-off-by: Ricardo Pchevuzinske Katz <rkatz@vmware.com>
This commit is contained in:
parent
a104d4fbc3
commit
bb265845b5
12 changed files with 30 additions and 28 deletions
|
|
@ -245,7 +245,7 @@ func (n *NGINXController) CheckIngress(ing *networking.Ingress) error {
|
|||
}
|
||||
}
|
||||
|
||||
if !cfg.EnableSnippetDirectives && strings.HasSuffix(key, "-snippet") {
|
||||
if !cfg.AllowSnippetAnnotations && strings.HasSuffix(key, "-snippet") {
|
||||
return fmt.Errorf("%s annotation cannot be used. Snippet directives are disabled by the Ingress administrator", key)
|
||||
}
|
||||
|
||||
|
|
@ -547,7 +547,7 @@ func (n *NGINXController) getBackendServers(ingresses []*ingress.Ingress) ([]*in
|
|||
ingKey := k8s.MetaNamespaceKey(ing)
|
||||
anns := ing.ParsedAnnotations
|
||||
|
||||
if !n.store.GetBackendConfiguration().EnableSnippetDirectives {
|
||||
if !n.store.GetBackendConfiguration().AllowSnippetAnnotations {
|
||||
dropSnippetDirectives(anns, ingKey)
|
||||
}
|
||||
|
||||
|
|
@ -820,7 +820,7 @@ func (n *NGINXController) createUpstreams(data []*ingress.Ingress, du *ingress.B
|
|||
anns := ing.ParsedAnnotations
|
||||
ingKey := k8s.MetaNamespaceKey(ing)
|
||||
|
||||
if !n.store.GetBackendConfiguration().EnableSnippetDirectives {
|
||||
if !n.store.GetBackendConfiguration().AllowSnippetAnnotations {
|
||||
dropSnippetDirectives(anns, ingKey)
|
||||
}
|
||||
|
||||
|
|
@ -1103,7 +1103,7 @@ func (n *NGINXController) createServers(data []*ingress.Ingress,
|
|||
ingKey := k8s.MetaNamespaceKey(ing)
|
||||
anns := ing.ParsedAnnotations
|
||||
|
||||
if !n.store.GetBackendConfiguration().EnableSnippetDirectives {
|
||||
if !n.store.GetBackendConfiguration().AllowSnippetAnnotations {
|
||||
dropSnippetDirectives(anns, ingKey)
|
||||
}
|
||||
|
||||
|
|
@ -1183,7 +1183,7 @@ func (n *NGINXController) createServers(data []*ingress.Ingress,
|
|||
ingKey := k8s.MetaNamespaceKey(ing)
|
||||
anns := ing.ParsedAnnotations
|
||||
|
||||
if !n.store.GetBackendConfiguration().EnableSnippetDirectives {
|
||||
if !n.store.GetBackendConfiguration().AllowSnippetAnnotations {
|
||||
dropSnippetDirectives(anns, ingKey)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue