[#1622] adm: Return non zero return code if metabase upgrade failed
All checks were successful
DCO action / DCO (pull_request) Successful in 46s
Tests and linters / Run gofumpt (pull_request) Successful in 49s
Vulncheck / Vulncheck (pull_request) Successful in 1m16s
Build / Build Components (pull_request) Successful in 2m18s
Tests and linters / Staticcheck (pull_request) Successful in 2m12s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m20s
Tests and linters / Tests (pull_request) Successful in 2m21s
Tests and linters / Lint (pull_request) Successful in 5m29s
Tests and linters / Tests with -race (pull_request) Successful in 5m31s
Tests and linters / gopls check (pull_request) Successful in 5m57s
Tests and linters / Run gofumpt (push) Successful in 37s
Vulncheck / Vulncheck (push) Successful in 52s
Pre-commit hooks / Pre-commit (push) Successful in 1m32s
Build / Build Components (push) Successful in 2m4s
Tests and linters / Staticcheck (push) Successful in 2m31s
Tests and linters / Lint (push) Successful in 3m20s
Tests and linters / Tests (push) Successful in 4m3s
OCI image / Build container images (push) Successful in 4m10s
Tests and linters / Tests with -race (push) Successful in 5m13s
Tests and linters / gopls check (push) Successful in 5m19s
All checks were successful
DCO action / DCO (pull_request) Successful in 46s
Tests and linters / Run gofumpt (pull_request) Successful in 49s
Vulncheck / Vulncheck (pull_request) Successful in 1m16s
Build / Build Components (pull_request) Successful in 2m18s
Tests and linters / Staticcheck (pull_request) Successful in 2m12s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m20s
Tests and linters / Tests (pull_request) Successful in 2m21s
Tests and linters / Lint (pull_request) Successful in 5m29s
Tests and linters / Tests with -race (pull_request) Successful in 5m31s
Tests and linters / gopls check (pull_request) Successful in 5m57s
Tests and linters / Run gofumpt (push) Successful in 37s
Vulncheck / Vulncheck (push) Successful in 52s
Pre-commit hooks / Pre-commit (push) Successful in 1m32s
Build / Build Components (push) Successful in 2m4s
Tests and linters / Staticcheck (push) Successful in 2m31s
Tests and linters / Lint (push) Successful in 3m20s
Tests and linters / Tests (push) Successful in 4m3s
OCI image / Build container images (push) Successful in 4m10s
Tests and linters / Tests with -race (push) Successful in 5m13s
Tests and linters / gopls check (push) Successful in 5m19s
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
57dc0a8e9e
commit
78bfd12229
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