mirror of
https://github.com/rancher/cli.git
synced 2026-02-05 09:48:36 +01:00
Wait until app is installed to print notes
Fixes cli timeout when installing app without a NOTES.txt file.
This commit is contained in:
committed by
Craig Jellick
parent
e0db2069c7
commit
c57c8773a6
19
cmd/app.go
19
cmd/app.go
@@ -601,11 +601,14 @@ func templateInstall(ctx *cli.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// wait for the app's notes to be populated so we can print them
|
||||
var timeout int
|
||||
for len(madeApp.Notes) == 0 {
|
||||
// wait for the app to be installed to print the notes
|
||||
var (
|
||||
timeout int
|
||||
installed bool
|
||||
)
|
||||
for !installed {
|
||||
if timeout == 60 {
|
||||
return errors.New("timed out waiting for app notes, the app could still be installing. Run 'rancher apps' to verify")
|
||||
return errors.New("timed out waiting for app to install. Run 'rancher apps' to verify status")
|
||||
}
|
||||
timeout++
|
||||
time.Sleep(2 * time.Second)
|
||||
@@ -613,6 +616,14 @@ func templateInstall(ctx *cli.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, condition := range madeApp.Conditions {
|
||||
condType := strings.ToLower(condition.Type)
|
||||
condStatus := strings.ToLower(condition.Status)
|
||||
if condType == "installed" && condStatus == "true" {
|
||||
installed = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(madeApp.Notes) != 0 {
|
||||
|
||||
Reference in New Issue
Block a user