Improve console message in case no k8s connection possible

This commit is contained in:
Andrei Pohilko
2023-03-13 15:26:32 +00:00
parent 57d4d073e9
commit e9ee10287b
2 changed files with 10 additions and 3 deletions

View File

@@ -46,7 +46,7 @@ func (s *Server) StartServer(ctx context.Context, cancel context.CancelFunc) (st
err = s.detectClusterMode(data)
if err != nil {
return "", nil, err
return "", nil, errorx.Decorate(err, "Failed to detect cluster mode")
}
go checkUpgrade(data.StatusInfo)
@@ -80,7 +80,7 @@ func (s *Server) detectClusterMode(data *objects.DataLayer) error {
}
ns, err := app.K8s.GetNameSpaces()
if err != nil { // no point in continuing without kubectl context and k8s connection
return err
return errorx.InitializationFailed.Wrap(err, "No k8s cluster connection")
}
log.Debugf("Got %d namespaces listed", len(ns.Items))
data.StatusInfo.ClusterMode = true