Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(k3d): refactor suggestion #2165

Closed
wants to merge 11 commits into from
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ kubefirst.yaml
__debug_*
kubefirst
launch.json
.envrc
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
default: help

.PHONY: help
help: ## list makefile targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

PHONY: fmt
fmt: ## format go files
gofumpt -w .
gci write .
3 changes: 1 addition & 2 deletions cmd/akamai/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"fmt"
"os"

"github.com/rs/zerolog/log"
"github.com/kubefirst/kubefirst/internal/catalog"
"github.com/kubefirst/kubefirst/internal/cluster"
"github.com/kubefirst/kubefirst/internal/gitShim"
Expand All @@ -20,6 +19,7 @@ import (
"github.com/kubefirst/kubefirst/internal/utilities"
"github.com/kubefirst/runtime/pkg"
internalssh "github.com/kubefirst/runtime/pkg/ssh"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down Expand Up @@ -49,7 +49,6 @@ func createAkamai(cmd *cobra.Command, args []string) error {
utilities.CreateK1ClusterDirectory(clusterNameFlag)

gitAuth, err := gitShim.ValidateGitCredentials(cliFlags.GitProvider, cliFlags.GithubOrg, cliFlags.GitlabGroup)

if err != nil {
progress.Error(err.Error())
return nil
Expand Down
1 change: 0 additions & 1 deletion cmd/aws/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ func Destroy() *cobra.Command {
}

return destroyCmd

}

func Quota() *cobra.Command {
Expand Down
2 changes: 0 additions & 2 deletions cmd/aws/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ func createAws(cmd *cobra.Command, args []string) error {
Config: awsinternal.NewAwsV2(cloudRegionFlag),
}
creds, err := awsClient.Config.Credentials.Retrieve(aws.BackgroundContext())

if err != nil {
progress.Error(err.Error())
return nil
Expand All @@ -79,7 +78,6 @@ func createAws(cmd *cobra.Command, args []string) error {
}

gitAuth, err := gitShim.ValidateGitCredentials(cliFlags.GitProvider, cliFlags.GithubOrg, cliFlags.GitlabGroup)

if err != nil {
progress.Error(err.Error())
return nil
Expand Down
3 changes: 1 addition & 2 deletions cmd/aws/quota.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ func printAwsQuotaWarning(messageHeader string, output map[string][]awsinternal.

// Write to logs, but also output to stdout
return createAwsQuotaWarning.String()

}

// evalAwsQuota provides an interface to the command-line
Expand All @@ -53,7 +52,7 @@ func evalAwsQuota(cmd *cobra.Command, args []string) error {
return err
}

var messageHeader = fmt.Sprintf(
messageHeader := fmt.Sprintf(
"AWS Quota Health\nRegion: %s\n\nIf you encounter issues deploying your kubefirst cluster, check these quotas and determine if you need to request a limit increase.",
cloudRegionFlag,
)
Expand Down
1 change: 0 additions & 1 deletion cmd/civo/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ func createCivo(cmd *cobra.Command, args []string) error {
utilities.CreateK1ClusterDirectory(clusterNameFlag)

gitAuth, err := gitShim.ValidateGitCredentials(cliFlags.GitProvider, cliFlags.GithubOrg, cliFlags.GitlabGroup)

if err != nil {
progress.Error(err.Error())
return nil
Expand Down
3 changes: 1 addition & 2 deletions cmd/civo/quota.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func returnCivoQuotaEvaluation(cloudRegion string) (string, int, int, error) {
}

// Parse the entire message
var messageHeader = fmt.Sprintf("Civo Quota Health\nRegion: %s\n\nNote that if any of these are approaching their limits, you may want to increase them.", cloudRegion)
messageHeader := fmt.Sprintf("Civo Quota Health\nRegion: %s\n\nNote that if any of these are approaching their limits, you may want to increase them.", cloudRegion)
sort.Strings(output)
result := printCivoQuotaWarning(messageHeader, output)

Expand Down Expand Up @@ -164,7 +164,6 @@ func printCivoQuotaWarning(messageHeader string, output []string) string {

// Write to logs, but also output to stdout
return createCivoQuotaWarning.String()

}

// evalCivoQuota provides an interface to the command-line
Expand Down
1 change: 0 additions & 1 deletion cmd/digitalocean/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/kubefirst/kubefirst-api/pkg/constants"
"github.com/kubefirst/kubefirst/internal/common"
"github.com/kubefirst/kubefirst/internal/progress"

"github.com/spf13/cobra"
)

Expand Down
1 change: 0 additions & 1 deletion cmd/digitalocean/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func createDigitalocean(cmd *cobra.Command, args []string) error {
utilities.CreateK1ClusterDirectory(clusterNameFlag)

gitAuth, err := gitShim.ValidateGitCredentials(cliFlags.GitProvider, cliFlags.GithubOrg, cliFlags.GitlabGroup)

if err != nil {
progress.Error(err.Error())
return nil
Expand Down
5 changes: 0 additions & 5 deletions cmd/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ var infoCmd = &cobra.Command{
Short: "provides general Kubefirst setup data",
Long: `Provides machine data, files and folders paths`,
Run: func(cmd *cobra.Command, args []string) {

config := configs.ReadConfig()

content := `
Expand Down Expand Up @@ -49,7 +48,3 @@ var infoCmd = &cobra.Command{
progress.Success(content)
},
}

func init() {
rootCmd.AddCommand(infoCmd)
}
156 changes: 0 additions & 156 deletions cmd/k3d/command.go

This file was deleted.

Loading
Loading