Skip to content

Commit

Permalink
fix: missing stuff
Browse files Browse the repository at this point in the history
Signed-off-by: DrummyFloyd <[email protected]>
  • Loading branch information
DrummyFloyd committed Oct 28, 2023
1 parent 4b20e73 commit 960d988
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cmd/k3s/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func NewCommand() *cobra.Command {
func Create() *cobra.Command {
createCmd := &cobra.Command{
Use: "create",
Short: "create the kubefirst platform running on GCP kubernetes",
Short: "create the kubefirst platform running on premise",
TraverseChildren: true,
RunE: createK3s,
// PreRun: common.CheckDocker,
Expand All @@ -75,7 +75,7 @@ func Create() *cobra.Command {
createCmd.Flags().StringVar(&clusterNameFlag, "cluster-name", "kubefirst", "the name of the cluster to create")
createCmd.Flags().StringVar(&clusterTypeFlag, "cluster-type", "mgmt", "the type of cluster to create (i.e. mgmt|workload)")
createCmd.Flags().StringVar(&dnsProviderFlag, "dns-provider", "cloudflare", fmt.Sprintf("the dns provider - one of: %s", supportedDNSProviders))
createCmd.MarkFlagRequired("domain-name")
createCmd.Flags().StringVar(&domainNameFlag, "domain-name", "", "the cloudProvider DNS Name to use for DNS records (i.e. your-domain.com|subdomain.your-domain.com) (required)")
createCmd.Flags().StringVar(&gitProviderFlag, "git-provider", "github", fmt.Sprintf("the git provider - one of: %s", supportedGitProviders))
createCmd.Flags().StringVar(&gitProtocolFlag, "git-protocol", "ssh", fmt.Sprintf("the git protocol - one of: %s", supportedGitProtocolOverride))
createCmd.Flags().StringVar(&githubOrgFlag, "github-org", "", "the GitHub organization for the new gitops and metaphor repositories - required if using github")
Expand Down
16 changes: 9 additions & 7 deletions internal/utilities/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ func GetFlags(cmd *cobra.Command, cloudProvider string) (types.CliFlags, error)
return cliFlags, err
}

cloudRegionFlag, err := cmd.Flags().GetString("cloud-region")
if err != nil {
progress.Error(err.Error())
return cliFlags, err
}

clusterNameFlag, err := cmd.Flags().GetString("cluster-name")
if err != nil {
progress.Error(err.Error())
Expand Down Expand Up @@ -92,6 +86,15 @@ func GetFlags(cmd *cobra.Command, cloudProvider string) (types.CliFlags, error)
return cliFlags, err
}

if cloudProvider != "k3s" {
cloudRegionFlag, err := cmd.Flags().GetString("cloud-region")
if err != nil {
progress.Error(err.Error())
return cliFlags, err
}
cliFlags.CloudRegion = cloudRegionFlag
}

if cloudProvider == "aws" {
ecrFlag, err := cmd.Flags().GetBool("ecr")
if err != nil {
Expand All @@ -113,7 +116,6 @@ func GetFlags(cmd *cobra.Command, cloudProvider string) (types.CliFlags, error)
}

cliFlags.AlertsEmail = alertsEmailFlag
cliFlags.CloudRegion = cloudRegionFlag
cliFlags.ClusterName = clusterNameFlag
cliFlags.DnsProvider = dnsProviderFlag
cliFlags.DomainName = domainNameFlag
Expand Down

0 comments on commit 960d988

Please sign in to comment.