Skip to content

Commit

Permalink
adjusting branch selection logic on gcp (#1731)
Browse files Browse the repository at this point in the history
  • Loading branch information
johndietz authored Jul 31, 2023
1 parent b75aafe commit db1dfa0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/gcp/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,14 +395,19 @@ func createGCP(cmd *cobra.Command, args []string) error {
if strings.Contains(gitopsTemplateURLFlag, "https://github.com/kubefirst/gitops-template.git") && gitopsTemplateBranchFlag == "" {
gitopsTemplateBranchFlag = "main"
}
case "default":
default:
switch gitopsTemplateURLFlag {
case "https://github.com/kubefirst/gitops-template.git":
if gitopsTemplateBranchFlag == "" {
gitopsTemplateBranchFlag = configs.K1Version
}
default:
if gitopsTemplateBranchFlag != "" {
return fmt.Errorf("must supply gitops-template-branch flag when gitops-template-url is overridden")
}
}
}

log.Info().Msgf("kubefirst version configs.K1Version: %s ", configs.K1Version)
log.Info().Msgf("cloning gitops-template repo url: %s ", gitopsTemplateURLFlag)
log.Info().Msgf("cloning gitops-template repo branch: %s ", gitopsTemplateBranchFlag)
Expand Down

0 comments on commit db1dfa0

Please sign in to comment.