1
0
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:
Erik Wilson
2019-01-07 19:12:02 -07:00
committed by Craig Jellick
parent e0db2069c7
commit c57c8773a6

View File

@@ -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 {