Skip to content

Commit 7ee611f

Browse files
Merge pull request #219 from banzaicloud/updates
Updates
2 parents ebeb7f4 + 5067748 commit 7ee611f

File tree

27 files changed

+17
-59
lines changed

27 files changed

+17
-59
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
build:
99
docker:
1010
-
11-
image: circleci/golang:1.12
11+
image: circleci/golang:1.14
1212
environment:
1313
GOFLAGS: -mod=readonly
1414

@@ -135,7 +135,7 @@ jobs:
135135
release:
136136
docker:
137137
-
138-
image: circleci/golang:1.12
138+
image: circleci/golang:1.14
139139
environment:
140140
GOFLAGS: -mod=readonly
141141

.golangci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ linters:
22
enable-all: true
33
disable:
44
- funlen
5+
- gomnd
56
- maligned
7+
- wsl
68

79
# TODO: fix these
10+
- stylecheck
811
- bodyclose
912
- deadcode
1013
- dupl
@@ -14,12 +17,14 @@ linters:
1417
- gochecknoinits
1518
- gocritic
1619
- gocyclo
20+
- gocognit
1721
- gofmt
1822
- goimports
1923
- golint
2024
- lll
2125
- megacheck
2226
- varcheck
27+
- godox
2328

2429
linters-settings:
2530
golint:

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ CLOUDINFO_VERSION = 0.7.8
2626
TELESCOPES_VERSION = 0.5.2
2727

2828
# Dependency versions
29-
GOTESTSUM_VERSION = 0.3.5
30-
GOLANGCI_VERSION = 1.18.0
29+
GOTESTSUM_VERSION = 0.4.1
30+
GOLANGCI_VERSION = 1.24.0
3131
LICENSEI_VERSION = 0.1.0
3232
GORELEASER_VERSION = 0.112.2
3333
PACKR_VERSION = 2.6.0
3434
OPENAPI_GENERATOR_VERSION = v4.2.2
3535

36-
GOLANG_VERSION = 1.12
36+
GOLANG_VERSION = 1.14
3737

3838
# Add the ability to override some variables
3939
# Use with care
@@ -115,6 +115,11 @@ bin/golangci-lint-${GOLANGCI_VERSION}:
115115
lint: bin/golangci-lint ## Run linter
116116
bin/golangci-lint run
117117

118+
.PHONY: fix
119+
fix: export CGO_ENABLED = 1
120+
fix: bin/golangci-lint ## Fix lint violations
121+
bin/golangci-lint run --fix
122+
118123
bin/licensei: bin/licensei-${LICENSEI_VERSION}
119124
@ln -sf licensei-${LICENSEI_VERSION} bin/licensei
120125
bin/licensei-${LICENSEI_VERSION}:

cmd/root.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ func GetRootCommand() *cobra.Command {
6767
// Execute adds all child commands to the root command and sets flags appropriately.
6868
// This is called by main.main(). It only needs to happen once to the rootCmd.
6969
func Execute() {
70-
7170
if err := rootCmd.Execute(); err != nil {
7271
fmt.Println(err)
7372
os.Exit(1)

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module github.com/banzaicloud/banzai-cli
22

3+
go 1.14
4+
35
require (
46
emperror.dev/errors v0.4.2
57
github.com/AlecAivazis/survey/v2 v2.0.2
@@ -40,5 +42,3 @@ require (
4042
k8s.io/client-go v11.0.0+incompatible
4143
sigs.k8s.io/kind v0.4.0
4244
)
43-
44-
go 1.13

internal/cli/cli.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ func CheckPipelineEndpoint(endpoint string) (string, error, error) {
267267
if err != nil {
268268
return "", nil, errors.WrapIf(err, "failed to connect to Pipeline")
269269
}
270-
271270
}
272271

273272
defer response.Body.Close()

internal/cli/command/cluster/context/context.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ type clusterContext struct {
4040
const clusterIdKey = "cluster.id"
4141

4242
func NewClusterContext(cmd *cobra.Command, banzaiCli cli.Cli, verb string) Context {
43-
4443
ctx := clusterContext{
4544
banzaiCli: banzaiCli,
4645
}

internal/cli/command/cluster/create.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,6 @@ func buildDefaultRequest(out map[string]interface{}) error {
518518
}
519519

520520
func buildSecretChoice(banzaiCli cli.Cli, orgID int32, cloud string, out map[string]interface{}) (string, error) {
521-
522521
if id, ok := out["secretId"].(string); id != "" && ok {
523522
return id, nil
524523
}
@@ -535,7 +534,6 @@ func buildSecretChoice(banzaiCli cli.Cli, orgID int32, cloud string, out map[str
535534

536535
// get ID from Name + validate
537536
if name, ok := out["secretName"].(string); name != "" && ok {
538-
539537
for _, secret := range secrets {
540538
if secret.Name == name {
541539
return secret.Id, nil

internal/cli/command/cluster/helm.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ func NewHelmCommand(banzaiCli cli.Cli) *cobra.Command {
5656
}
5757

5858
func writeHelm(url, name string) error {
59-
6059
tgz, err := http.Get(url) // #nosec
6160
if err != nil {
6261
return errors.WrapIff(err, "failed to download helm from %q", url)

internal/cli/command/cluster/integratedservice/services/dns/common.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ func (ac actionContext) IsUpdate() bool {
9090
// assembleServiceRequest assembles the request for activate and update the ExternalDNS integrated service
9191
// if the input rawSpec is nil -> activate flow, otherwise update flow
9292
func assembleServiceRequest(banzaiCli cli.Cli, clusterCtx clustercontext.Context, spec ServiceSpec, actionContext actionContext) (map[string]interface{}, error) {
93-
9493
// select the provider
9594
selectedProviderInfo, err := selectProvider(*spec.ExternalDNS.Provider)
9695
if err != nil {

0 commit comments

Comments
 (0)