From c01023d8f8c1049d918d407a7c36e59067aa4853 Mon Sep 17 00:00:00 2001 From: Boris Kreitchman Date: Tue, 11 Oct 2022 13:59:56 +0300 Subject: [PATCH] Process getVersion error in bootstrap Signed-off-by: Boris Kreitchman --- cmd/flux/bootstrap_bitbucket_server.go | 4 +++- cmd/flux/bootstrap_git.go | 4 +++- cmd/flux/bootstrap_github.go | 4 +++- cmd/flux/bootstrap_gitlab.go | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cmd/flux/bootstrap_bitbucket_server.go b/cmd/flux/bootstrap_bitbucket_server.go index 4b827498..baefbd75 100644 --- a/cmd/flux/bootstrap_bitbucket_server.go +++ b/cmd/flux/bootstrap_bitbucket_server.go @@ -128,7 +128,9 @@ func bootstrapBServerCmdRun(cmd *cobra.Command, args []string) error { } // Manifest base - if ver, err := getVersion(bootstrapArgs.version); err == nil { + if ver, err := getVersion(bootstrapArgs.version); err != nil { + return err + } else { bootstrapArgs.version = ver } manifestsBase, err := buildEmbeddedManifestBase() diff --git a/cmd/flux/bootstrap_git.go b/cmd/flux/bootstrap_git.go index f5909788..bd21fd4c 100644 --- a/cmd/flux/bootstrap_git.go +++ b/cmd/flux/bootstrap_git.go @@ -147,7 +147,9 @@ func bootstrapGitCmdRun(cmd *cobra.Command, args []string) error { } // Manifest base - if ver, err := getVersion(bootstrapArgs.version); err == nil { + if ver, err := getVersion(bootstrapArgs.version); err != nil { + return err + } else { bootstrapArgs.version = ver } manifestsBase, err := buildEmbeddedManifestBase() diff --git a/cmd/flux/bootstrap_github.go b/cmd/flux/bootstrap_github.go index faca1c7b..cc843407 100644 --- a/cmd/flux/bootstrap_github.go +++ b/cmd/flux/bootstrap_github.go @@ -132,7 +132,9 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error { } // Manifest base - if ver, err := getVersion(bootstrapArgs.version); err == nil { + if ver, err := getVersion(bootstrapArgs.version); err != nil { + return err + } else { bootstrapArgs.version = ver } manifestsBase, err := buildEmbeddedManifestBase() diff --git a/cmd/flux/bootstrap_gitlab.go b/cmd/flux/bootstrap_gitlab.go index 55f5dc58..ea71f4af 100644 --- a/cmd/flux/bootstrap_gitlab.go +++ b/cmd/flux/bootstrap_gitlab.go @@ -136,7 +136,9 @@ func bootstrapGitLabCmdRun(cmd *cobra.Command, args []string) error { } // Manifest base - if ver, err := getVersion(bootstrapArgs.version); err == nil { + if ver, err := getVersion(bootstrapArgs.version); err != nil { + return err + } else { bootstrapArgs.version = ver } manifestsBase, err := buildEmbeddedManifestBase()