diff --git a/controllers/nginx/pkg/cmd/controller/nginx.go b/controllers/nginx/pkg/cmd/controller/nginx.go index a395f98a6..b6b23fa3d 100644 --- a/controllers/nginx/pkg/cmd/controller/nginx.go +++ b/controllers/nginx/pkg/cmd/controller/nginx.go @@ -85,11 +85,12 @@ func newNGINXController() *NGINXController { } n := &NGINXController{ - binary: ngx, - configmap: &api_v1.ConfigMap{}, - isIPV6Enabled: isIPv6Enabled(), - resolver: h, - ports: &config.ListenPorts{}, + binary: ngx, + configmap: &api_v1.ConfigMap{}, + isIPV6Enabled: isIPv6Enabled(), + resolver: h, + ports: &config.ListenPorts{}, + backendDefaults: config.NewDefault().Backend, } fcgiListener, err := net.Listen("unix", fastCGISocket) diff --git a/controllers/nginx/pkg/template/template.go b/controllers/nginx/pkg/template/template.go index b9ff076d3..8acb192bf 100644 --- a/controllers/nginx/pkg/template/template.go +++ b/controllers/nginx/pkg/template/template.go @@ -601,18 +601,17 @@ type ingressInformation struct { func getIngressInformation(i, p interface{}) *ingressInformation { ing, ok := i.(*extensions.Ingress) if !ok { - glog.Errorf("expected an Ingress type but %T was returned", i) + glog.V(3).Infof("expected an Ingress type but %T was returned", i) return &ingressInformation{} } path, ok := p.(string) if !ok { - glog.Errorf("expected a string type but %T was returned", p) + glog.V(3).Infof("expected a string type but %T was returned", p) return &ingressInformation{} } if ing == nil { - glog.Errorf("expected an Ingress") return &ingressInformation{} } diff --git a/core/pkg/ingress/controller/controller.go b/core/pkg/ingress/controller/controller.go index 979bce2a5..459b9158c 100644 --- a/core/pkg/ingress/controller/controller.go +++ b/core/pkg/ingress/controller/controller.go @@ -1169,7 +1169,12 @@ func (ic *GenericController) createServers(data []interface{}, servers[host].Alias = aliasAnnotation // only add a certificate if the server does not have one previously configured - if len(ing.Spec.TLS) == 0 || servers[host].SSLCertificate != "" { + if servers[host].SSLCertificate != "" { + continue + } + + if len(ing.Spec.TLS) == 0 { + glog.V(3).Infof("ingress %v/%v for host %v does not contains a TLS section", ing.Namespace, ing.Name, host) continue } @@ -1183,9 +1188,9 @@ func (ic *GenericController) createServers(data []interface{}, } } - // the current ing.Spec.Rules[].Host doesn't have an entry at - // ing.Spec.TLS[].Hosts[] skipping to the next Rule if !found { + glog.Warningf("ingress %v/%v for host %v contains a TLS section but none of the host match", + ing.Namespace, ing.Name, host) continue } @@ -1199,7 +1204,7 @@ func (ic *GenericController) createServers(data []interface{}, key := fmt.Sprintf("%v/%v", ing.Namespace, tlsSecretName) bc, exists := ic.sslCertTracker.Get(key) if !exists { - glog.Infof("ssl certificate \"%v\" does not exist in local store", key) + glog.Warningf("ssl certificate \"%v\" does not exist in local store", key) continue }