mirror of
https://github.com/fluxcd/flux2.git
synced 2026-05-05 09:38:50 +00:00
Add kstatus to install and check commands
Signed-off-by: jonathan-innis <jonathan.innis.ji@gmail.com>
This commit is contained in:
parent
b3d7730e79
commit
b528428d02
6 changed files with 178 additions and 68 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue