Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: reimplement the create cmd for k8s and bare-metal #177

Merged
merged 3 commits into from
Oct 31, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
enrich the log message
Signed-off-by: sh2 <shawnhxh@outlook.com>
  • Loading branch information
shawnh2 committed Oct 27, 2023
commit cefca9b99dec990458316d5f97996ef591e40cdb
11 changes: 7 additions & 4 deletions pkg/cluster/baremetal/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,13 @@ func (c *Cluster) Wait(ctx context.Context, close bool) error {
v = "unknown"
}

csd := c.mm.GetClusterScopeDirs()
if !close {
c.logger.V(0).Infof("The cluster(pid=%d, version=%s) is running in bare-metal mode now...\n", os.Getpid(), v)
c.logger.V(0).Infof("To view dashboard by accessing: %s\n", logger.Bold("http://localhost:4000/dashboard/"))
c.logger.V(0).Infof("The cluster(pid=%d, version=%s) is running in bare-metal mode now...", os.Getpid(), v)
c.logger.V(0).Infof("To view dashboard by accessing: %s", logger.Bold("http://localhost:4000/dashboard/"))
} else {
c.logger.Warnf("The cluster(pid=%d, version=%s) run in bare-metal has been shutting down...\n", os.Getpid(), v)
c.logger.Warnf("The cluster(pid=%d, version=%s) run in bare-metal has been shutting down...", os.Getpid(), v)
c.logger.Warnf("To view the failure by browsing logs in: %s", logger.Bold(csd.LogsDir))
return nil
}

Expand All @@ -232,6 +234,7 @@ func (c *Cluster) wait(_ context.Context) error {
// it is not the context of current cluster.
<-c.ctx.Done()

c.logger.V(3).Info("Cluster is shutting down...")
csd := c.mm.GetClusterScopeDirs()
c.logger.V(0).Infof("Cluster is shutting down, don't worry, it still remain in %s", logger.Bold(csd.BaseDir))
return nil
}