diff --git a/internal/informer/application/appinformer.go b/internal/informer/application/appinformer.go index dd1b23e..d6fc74b 100644 --- a/internal/informer/application/appinformer.go +++ b/internal/informer/application/appinformer.go @@ -225,7 +225,11 @@ func NewAppInformer(ctx context.Context, client appclientset.Interface, namespac } func (i *AppInformer) Start(stopch <-chan struct{}) { - log().Infof("Starting app informer (namespaces: %s)", strings.Join(append([]string{i.options.namespace}, i.options.namespaces...), ",")) + ns := "" + if i.options.namespace != "" { + ns = i.options.namespace + "," + } + log().Infof("Starting app informer (namespaces: %s)", strings.TrimSuffix(ns+strings.Join(i.options.namespaces, ","), ",")) i.appInformer.Run(stopch) log().Infof("App informer has shutdown") } diff --git a/principal/server.go b/principal/server.go index e8b86dd..ec6a080 100644 --- a/principal/server.go +++ b/principal/server.go @@ -165,7 +165,13 @@ func NewServer(ctx context.Context, kubeClient *kube.KubernetesClient, namespace // error during startup, before the go routines are running, will be returned // immediately. Errors during the runtime will be propagated via errch. func (s *Server) Start(ctx context.Context, errch chan error) error { - log().Infof("Starting %s (server) v%s (ns=%s, allowed_namespaces=%v)", s.version.Name(), s.version.Version(), s.namespace, s.options.namespaces) + + if s.namespace != "" { + log().Infof("Starting %s (server) v%s (ns=%s, allowed_namespaces=%v)", s.version.Name(), s.version.Version(), s.namespace, s.options.namespaces) + } else { + log().Infof("Starting %s (server) v%s (allowed_namespaces=%v)", s.version.Name(), s.version.Version(), s.options.namespaces) + } + if s.options.serveGRPC { if err := s.serveGRPC(ctx, errch); err != nil { return err