1
0
mirror of synced 2026-02-13 13:06:56 +00:00

Add kstatus to install and check commands

Signed-off-by: jonathan-innis <jonathan.innis.ji@gmail.com>
This commit is contained in:
jonathan-innis
2021-02-01 11:03:37 -08:00
parent b3d7730e79
commit b528428d02
6 changed files with 178 additions and 68 deletions

View File

@@ -23,6 +23,7 @@ import (
"os"
"path/filepath"
"strings"
"time"
"github.com/spf13/cobra"
@@ -178,14 +179,19 @@ func installCmdRun(cmd *cobra.Command, args []string) error {
logger.Successf("install completed")
}
statusChecker := StatusChecker{}
err = statusChecker.New(time.Second, rootArgs.timeout)
if err != nil {
return fmt.Errorf("install failed with: %v", err)
}
logger.Waitingf("verifying installation")
for _, deployment := range components {
kubectlArgs = []string{"-n", rootArgs.namespace, "rollout", "status", "deployment", deployment, "--timeout", rootArgs.timeout.String()}
if _, err := utils.ExecKubectlCommand(ctx, applyOutput, rootArgs.kubeconfig, rootArgs.kubecontext, kubectlArgs...); err != nil {
err := statusChecker.Assess(deployment)
if err != nil {
return fmt.Errorf("install failed")
} else {
logger.Successf("%s ready", deployment)
}
logger.Successf("%s ready", deployment)
}
logger.Successf("install finished")