Merge pull request #362 from gianrubio/fix-ingress-class

Fix ingress class
This commit is contained in:
Manuel Alejandro de Brito Fontes 2017-03-03 09:49:59 -03:00 committed by GitHub
commit 6cd21f7dea
6 changed files with 65 additions and 23 deletions

View file

@ -48,9 +48,10 @@ const (
)
var (
tmplPath = "/etc/nginx/template/nginx.tmpl"
cfgPath = "/etc/nginx/nginx.conf"
binary = "/usr/sbin/nginx"
tmplPath = "/etc/nginx/template/nginx.tmpl"
cfgPath = "/etc/nginx/nginx.conf"
binary = "/usr/sbin/nginx"
defIngressClass = "nginx"
)
// newNGINXController creates a new NGINX Ingress controller.
@ -259,7 +260,12 @@ func (n NGINXController) Info() *ingress.BackendInfo {
// OverrideFlags customize NGINX controller flags
func (n NGINXController) OverrideFlags(flags *pflag.FlagSet) {
flags.Set("ingress-class", "nginx")
flags.Set("ingress-class", defIngressClass)
}
// DefaultIngressClass just return the default ingress class
func (n NGINXController) DefaultIngressClass() string {
return defIngressClass
}
// testTemplate checks if the NGINX configuration inside the byte array is valid