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

Refactor components status check

- run install/bootstrap checks in parallel (1m timeout)
- list not found components

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
Stefan Prodan
2021-02-04 10:59:46 +02:00
parent c708e390a7
commit e055c9ddc1
5 changed files with 60 additions and 49 deletions

View File

@@ -175,23 +175,16 @@ func installCmdRun(cmd *cobra.Command, args []string) error {
if installDryRun {
logger.Successf("install dry-run finished")
return nil
} else {
logger.Successf("install completed")
}
statusChecker := StatusChecker{}
err = statusChecker.New(time.Second, rootArgs.timeout)
statusChecker, err := NewStatusChecker(time.Second, time.Minute)
if err != nil {
return fmt.Errorf("install failed with: %v", err)
return fmt.Errorf("install failed: %w", err)
}
logger.Waitingf("verifying installation")
for _, deployment := range components {
err := statusChecker.Assess(deployment)
if err != nil {
return fmt.Errorf("%s: install failed while rolling out deployment", deployment)
}
logger.Successf("%s ready", deployment)
if err := statusChecker.Assess(components...); err != nil {
return fmt.Errorf("install failed")
}
logger.Successf("install finished")