Refactoring of ingress class annotation and main flags

This commit is contained in:
Manuel de Brito Fontes 2017-11-22 10:35:47 -03:00
parent e937ed8134
commit 14b5259b0f
10 changed files with 155 additions and 35 deletions

View file

@ -69,10 +69,9 @@ const (
)
var (
tmplPath = "/etc/nginx/template/nginx.tmpl"
cfgPath = "/etc/nginx/nginx.conf"
nginxBinary = "/usr/sbin/nginx"
defIngressClass = "nginx"
tmplPath = "/etc/nginx/template/nginx.tmpl"
cfgPath = "/etc/nginx/nginx.conf"
nginxBinary = "/usr/sbin/nginx"
)
// NewNGINXController creates a new NGINX Ingress controller.
@ -246,7 +245,7 @@ func (n *NGINXController) Start() {
for _, obj := range n.listers.Ingress.List() {
ing := obj.(*extensions.Ingress)
if !class.IsValid(ing, n.cfg.IngressClass, n.cfg.DefaultIngressClass) {
if !class.IsValid(ing) {
a, _ := parser.GetStringAnnotation(class.IngressKey, ing, n)
glog.Infof("ignoring add for ingress %v based on annotation %v with value %v", ing.Name, class.IngressKey, a)
continue