Skip to content

Commit

Permalink
fix(alibaba): change prompt info
Browse files Browse the repository at this point in the history
Signed-off-by: Jason-ZW <zhenyang@rancher.com>
  • Loading branch information
rancher-sy-bot committed Sep 25, 2020
1 parent 535feed commit 85568af
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions pkg/providers/alibaba/alibaba.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ const (
terway = "none"
terwayMaxPoolSize = "5"
cloudControllerManager = "false"
usageInfo = `================ Prompt Info ================
Use 'autok3s kubectl config use-context %s'
Use 'autok3s kubectl get pods -A' get POD status`
)

type Alibaba struct {
Expand Down Expand Up @@ -85,13 +88,15 @@ func (p *Alibaba) CreateK3sCluster(ssh *types.SSH) (err error) {
s.Start()
defer func() {
s.Stop()
if err == nil && p.UI != "none" && len(p.Status.MasterNodes) > 0 {
if strings.EqualFold(p.CloudControllerManager, "true") {
fmt.Printf("K3s UI %s URL: https://<using `kubectl get svc -A` get UI address>:8999\n", p.UI)
} else {
fmt.Printf("K3s UI %s URL: https://%s:8999\n", p.UI, p.Status.MasterNodes[0].PublicIPAddress[0])
if err == nil && len(p.Status.MasterNodes) > 0 {
fmt.Printf(usageInfo, p.Name)
if p.UI != "none" {
if strings.EqualFold(p.CloudControllerManager, "true") {
fmt.Printf("K3s UI %s URL: https://<using `kubectl get svc -A` get UI address>:8999\n", p.UI)
} else {
fmt.Printf("K3s UI %s URL: https://%s:8999\n", p.UI, p.Status.MasterNodes[0].PublicIPAddress[0])
}
}
fmt.Printf("Use `autok3s kubectl get pods -A` get UI status\n")
}
}()

Expand Down

0 comments on commit 85568af

Please # to comment.