diff --git a/pkg/annotations/service.go b/pkg/annotations/service.go index 1e4a013671..be1d477904 100644 --- a/pkg/annotations/service.go +++ b/pkg/annotations/service.go @@ -106,8 +106,8 @@ func (svc Service) NEGEnabled() bool { var ( ErrBackendConfigNoneFound = errors.New("no BackendConfig's found in annotation") - ErrBackendConfigInvalidJSON = errors.New("annotation is invalid json") - ErrBackendConfigAnnotationMissing = errors.New("annotation is missing") + ErrBackendConfigInvalidJSON = errors.New("BackendConfig annotation is invalid json") + ErrBackendConfigAnnotationMissing = errors.New("BackendConfig annotation is missing") ) type BackendConfigs struct { diff --git a/pkg/backendconfig/backendconfig.go b/pkg/backendconfig/backendconfig.go index 76b549f3f0..47077186e0 100644 --- a/pkg/backendconfig/backendconfig.go +++ b/pkg/backendconfig/backendconfig.go @@ -62,7 +62,11 @@ func GetServicesForBackendConfig(svcLister cache.Store, backendConfig *backendco } backendConfigNames, err := annotations.FromService(svc).GetBackendConfigs() if err != nil { - glog.Errorf("Failed to get BackendConfig names from service %s/%s: %v", svc.Namespace, svc.Name, err) + // If the user did not provide the annotation at all, then we + // do not want to log an error. + if err != annotations.ErrBackendConfigAnnotationMissing { + glog.Errorf("Failed to get BackendConfig names from service %s/%s: %v", svc.Namespace, svc.Name, err) + } continue } if backendConfigNames != nil { diff --git a/pkg/controller/errors/errors.go b/pkg/controller/errors/errors.go index bd125f0da2..32a034e3a3 100644 --- a/pkg/controller/errors/errors.go +++ b/pkg/controller/errors/errors.go @@ -78,7 +78,7 @@ type ErrSvcBackendConfig struct { // Error returns the port name/number, service name, and the underlying error. func (e ErrSvcBackendConfig) Error() string { - return fmt.Sprintf("error getting BackendConfig for port %q on service %q, err: %v", e.ServicePortID.Port, e.ServicePortID.Service, e.Err) + return fmt.Sprintf("error getting BackendConfig for port %q on service %q, err: %v", e.ServicePortID.Port.String(), e.ServicePortID.Service.String(), e.Err) } // ErrBackendConfigValidation is returned when there was an error validating a BackendConfig. diff --git a/pkg/controller/translator/translator.go b/pkg/controller/translator/translator.go index f6ab2b068f..3fb366e365 100644 --- a/pkg/controller/translator/translator.go +++ b/pkg/controller/translator/translator.go @@ -177,7 +177,7 @@ func (t *Translator) TranslateIngress(ing *extensions.Ingress, systemDefaultBack return urlMap, errs } - errs = append(errs, fmt.Errorf("failed to retrieve the system default backend service %q with port %q", systemDefaultBackend.Service, systemDefaultBackend.Port)) + errs = append(errs, fmt.Errorf("failed to retrieve the system default backend service %q with port %q: %v", systemDefaultBackend.Service.String(), systemDefaultBackend.Port.String(), err)) return urlMap, errs }