[#1622] adm: Return non zero return code if metabase upgrade failed
All checks were successful
Tests and linters / Run gofumpt (pull_request) Successful in 35s
DCO action / DCO (pull_request) Successful in 40s
Vulncheck / Vulncheck (pull_request) Successful in 1m24s
Build / Build Components (pull_request) Successful in 1m56s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m38s
Tests and linters / Staticcheck (pull_request) Successful in 2m46s
Tests and linters / Tests with -race (pull_request) Successful in 2m56s
Tests and linters / Tests (pull_request) Successful in 2m58s
Tests and linters / gopls check (pull_request) Successful in 3m9s
Tests and linters / Lint (pull_request) Successful in 3m23s
All checks were successful
Tests and linters / Run gofumpt (pull_request) Successful in 35s
DCO action / DCO (pull_request) Successful in 40s
Vulncheck / Vulncheck (pull_request) Successful in 1m24s
Build / Build Components (pull_request) Successful in 1m56s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m38s
Tests and linters / Staticcheck (pull_request) Successful in 2m46s
Tests and linters / Tests with -race (pull_request) Successful in 2m56s
Tests and linters / Tests (pull_request) Successful in 2m58s
Tests and linters / gopls check (pull_request) Successful in 3m9s
Tests and linters / Lint (pull_request) Successful in 3m23s
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
74e11b3cf3
commit
f43ee57b9b
1 changed files with 7 additions and 1 deletions
|
@ -28,6 +28,7 @@ const (
|
|||
var (
|
||||
errNoPathsFound = errors.New("no metabase paths found")
|
||||
errNoMorphEndpointsFound = errors.New("no morph endpoints found")
|
||||
errUpgradeFailed = errors.New("upgrade failed")
|
||||
)
|
||||
|
||||
var UpgradeCmd = &cobra.Command{
|
||||
|
@ -91,14 +92,19 @@ func upgrade(cmd *cobra.Command, _ []string) error {
|
|||
if err := eg.Wait(); err != nil {
|
||||
return err
|
||||
}
|
||||
allSuccess := true
|
||||
for mb, ok := range result {
|
||||
if ok {
|
||||
cmd.Println(mb, ": success")
|
||||
} else {
|
||||
cmd.Println(mb, ": failed")
|
||||
allSuccess = false
|
||||
}
|
||||
}
|
||||
return nil
|
||||
if allSuccess {
|
||||
return nil
|
||||
}
|
||||
return errUpgradeFailed
|
||||
}
|
||||
|
||||
func getMetabasePaths(appCfg *config.Config) ([]string, error) {
|
||||
|
|
Loading…
Add table
Reference in a new issue