Skip to content

Commit

Permalink
feat: install kubefirst pro flag (#2236)
Browse files Browse the repository at this point in the history
* feat: install kubefirst pro flag

* feat: bump launch up version
  • Loading branch information
CristhianF7 authored Jul 18, 2024
1 parent afd1efa commit d7185b0
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 4 deletions.
2 changes: 2 additions & 0 deletions cmd/aws/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ var (
nodeTypeFlag string
nodeCountFlag string
installCatalogApps string
installKubefirstProFlag bool

// RootCredentials
copyArgoCDPasswordToClipboardFlag bool
Expand Down Expand Up @@ -102,6 +103,7 @@ func Create() *cobra.Command {
createCmd.Flags().StringVar(&installCatalogApps, "install-catalog-apps", "", "comma seperated values to install after provision")
createCmd.Flags().BoolVar(&useTelemetryFlag, "use-telemetry", true, "whether to emit telemetry")
createCmd.Flags().BoolVar(&ecrFlag, "ecr", false, "whether or not to use ecr vs the git provider")
createCmd.Flags().BoolVar(&installKubefirstProFlag, "install-kubefirst-pro", true, "whether or not to install kubefirst pro")

return createCmd
}
Expand Down
2 changes: 2 additions & 0 deletions cmd/civo/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ var (
nodeTypeFlag string
nodeCountFlag string
installCatalogApps string
installKubefirstProFlag bool

// RootCredentials
copyArgoCDPasswordToClipboardFlag bool
Expand Down Expand Up @@ -112,6 +113,7 @@ func Create() *cobra.Command {
createCmd.Flags().StringVar(&gitopsTemplateURLFlag, "gitops-template-url", "https://github.com/kubefirst/gitops-template.git", "the fully qualified url to the gitops-template repository to clone")
createCmd.Flags().StringVar(&installCatalogApps, "install-catalog-apps", "", "comma seperated values to install after provision")
createCmd.Flags().BoolVar(&useTelemetryFlag, "use-telemetry", true, "whether to emit telemetry")
createCmd.Flags().BoolVar(&installKubefirstProFlag, "install-kubefirst-pro", true, "whether or not to install kubefirst pro")

return createCmd
}
Expand Down
2 changes: 2 additions & 0 deletions cmd/digitalocean/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ var (
nodeTypeFlag string
nodeCountFlag string
installCatalogApps string
installKubefirstProFlag bool

// RootCredentials
copyArgoCDPasswordToClipboardFlag bool
Expand Down Expand Up @@ -105,6 +106,7 @@ func Create() *cobra.Command {
createCmd.Flags().StringVar(&gitopsTemplateURLFlag, "gitops-template-url", "https://github.com/kubefirst/gitops-template.git", "the fully qualified url to the gitops-template repository to clone")
createCmd.Flags().StringVar(&installCatalogApps, "install-catalog-apps", "", "comma seperated values to install after provision")
createCmd.Flags().BoolVar(&useTelemetryFlag, "use-telemetry", true, "whether to emit telemetry")
createCmd.Flags().BoolVar(&installKubefirstProFlag, "install-kubefirst-pro", true, "whether or not to install kubefirst pro")

return createCmd
}
Expand Down
3 changes: 3 additions & 0 deletions cmd/google/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ var (
nodeTypeFlag string
nodeCountFlag string
installCatalogApps string
installKubefirstProFlag bool

// RootCredentials
copyArgoCDPasswordToClipboardFlag bool
Expand Down Expand Up @@ -110,6 +111,8 @@ func Create() *cobra.Command {
createCmd.Flags().StringVar(&installCatalogApps, "install-catalog-apps", "", "comma seperated values to install after provision")
createCmd.Flags().BoolVar(&useTelemetryFlag, "use-telemetry", true, "whether to emit telemetry")
createCmd.Flags().BoolVar(&forceDestroyFlag, "force-destroy", false, "allows force destruction on objects (helpful for test environments, defaults to false)")
createCmd.Flags().BoolVar(&installKubefirstProFlag, "install-kubefirst-pro", true, "whether or not to install kubefirst pro")

return createCmd
}

Expand Down
3 changes: 3 additions & 0 deletions cmd/k3s/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var (
installCatalogApps string
useTelemetryFlag bool
forceDestroyFlag bool
installKubefirstProFlag bool

// RootCredentials
copyArgoCDPasswordToClipboardFlag bool
Expand Down Expand Up @@ -107,6 +108,8 @@ func Create() *cobra.Command {
createCmd.Flags().StringVar(&installCatalogApps, "install-catalog-apps", "", "comma seperated values to install after provision")
createCmd.Flags().BoolVar(&useTelemetryFlag, "use-telemetry", true, "whether to emit telemetry")
createCmd.Flags().BoolVar(&forceDestroyFlag, "force-destroy", false, "allows force destruction on objects (helpful for test environments, defaults to false)")
createCmd.Flags().BoolVar(&installKubefirstProFlag, "install-kubefirst-pro", true, "whether or not to install kubefirst pro")

return createCmd
}

Expand Down
2 changes: 2 additions & 0 deletions cmd/vultr/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ var (
nodeTypeFlag string
nodeCountFlag string
installCatalogApps string
installKubefirstProFlag bool

// RootCredentials
copyArgoCDPasswordToClipboardFlag bool
Expand Down Expand Up @@ -105,6 +106,7 @@ func Create() *cobra.Command {
createCmd.Flags().StringVar(&gitopsTemplateURLFlag, "gitops-template-url", "https://github.com/kubefirst/gitops-template.git", "the fully qualified url to the gitops-template repository to clone")
createCmd.Flags().StringVar(&installCatalogApps, "install-catalog-apps", "", "comma seperated values to install after provision")
createCmd.Flags().BoolVar(&useTelemetryFlag, "use-telemetry", true, "whether to emit telemetry")
createCmd.Flags().BoolVar(&installKubefirstProFlag, "install-kubefirst-pro", true, "whether or not to install kubefirst pro")

return createCmd
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/dustin/go-humanize v1.0.1
github.com/go-git/go-git/v5 v5.6.1
github.com/hashicorp/vault/api v1.9.0
github.com/kubefirst/kubefirst-api v0.1.25
github.com/kubefirst/kubefirst-api v0.1.26
github.com/kubefirst/metrics-client v0.3.0
github.com/nxadm/tail v1.4.8
github.com/rs/zerolog v1.29.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -724,8 +724,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kubefirst/kubefirst-api v0.1.25 h1:cWtMz4BfvaDfIHfpBX3wO4cJJXOhuTFfEjpTtLaXyfY=
github.com/kubefirst/kubefirst-api v0.1.25/go.mod h1:9fJTwsFdkmTiscz+rBvTLMnKpi8zKIeUHDE2fQex3E4=
github.com/kubefirst/kubefirst-api v0.1.26 h1:0ejYuTEh5wZPed/Lsd7E721Yy0TouzFLz03Yw8/KbiM=
github.com/kubefirst/kubefirst-api v0.1.26/go.mod h1:9fJTwsFdkmTiscz+rBvTLMnKpi8zKIeUHDE2fQex3E4=
github.com/kubefirst/metrics-client v0.3.0 h1:zCug82pEzeWhHhpeYQvdhytRNDxrLxX18dPQ5PSxY3s=
github.com/kubefirst/metrics-client v0.3.0/go.mod h1:GR7wsMcyYhd+EU67PeuMCBYFE6OJ7P/j5OI5BLOoRMc=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
Expand Down
2 changes: 1 addition & 1 deletion internal/launch/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const (
helmChartName = "kubefirst"
helmChartRepoName = "kubefirst"
helmChartRepoURL = "https://charts.kubefirst.com"
helmChartVersion = "2.4.12"
helmChartVersion = "2.4.13"
namespace = "kubefirst"
secretName = "kubefirst-initial-secrets"
)
1 change: 1 addition & 0 deletions internal/types/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ type CliFlags struct {
K3sServersPrivateIps []string
K3sServersPublicIps []string
K3sServersArgs []string
InstallKubefirstPro bool
}
7 changes: 7 additions & 0 deletions internal/utilities/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ func GetFlags(cmd *cobra.Command, cloudProvider string) (types.CliFlags, error)
return cliFlags, err
}

installKubefirstProFlag, err := cmd.Flags().GetBool("install-kubefirst-pro")
if err != nil {
progress.Error(err.Error())
return cliFlags, err
}

if cloudProvider == "aws" {
ecrFlag, err := cmd.Flags().GetBool("ecr")
if err != nil {
Expand Down Expand Up @@ -191,6 +197,7 @@ func GetFlags(cmd *cobra.Command, cloudProvider string) (types.CliFlags, error)
cliFlags.NodeType = nodeTypeFlag
cliFlags.NodeCount = nodeCountFlag
cliFlags.InstallCatalogApps = installCatalogAppsFlag
cliFlags.InstallKubefirstPro = installKubefirstProFlag

viper.Set("flags.alerts-email", cliFlags.AlertsEmail)
viper.Set("flags.cluster-name", cliFlags.ClusterName)
Expand Down
1 change: 1 addition & 0 deletions internal/utilities/utilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ func CreateClusterDefinitionRecordFromRaw(gitAuth apiTypes.GitAuth, cliFlags typ
DnsProvider: viper.GetString("flags.dns-provider"),
LogFileName: viper.GetString("k1-paths.log-file-name"),
PostInstallCatalogApps: catalogApps,
InstallKubefirstPro: cliFlags.InstallKubefirstPro,
GitAuth: apiTypes.GitAuth{
Token: gitAuth.Token,
User: gitAuth.User,
Expand Down

0 comments on commit d7185b0

Please sign in to comment.