Skip to content

Commit

Permalink
golangci-lint v1.56.2
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Paskal <[email protected]>
  • Loading branch information
maksim-paskal committed Mar 4, 2024
1 parent 736aec8 commit 6576c1a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
11 changes: 11 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ misspell:
linters:
enable-all: true
disable:
# deprecated
- maligned
- varcheck
- scopelint
- ifshort
- interfacer
- structcheck
- nosnakecase
- golint
- deadcode
############
- exhaustivestruct
- exhaustruct
- varnamelen
Expand Down
5 changes: 5 additions & 0 deletions e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func Test(t *testing.T) { //nolint:funlen,paralleltest,cyclop
}

config.SetBranch(os.Getenv("GIT_BRANCH"))

config.Get().Deployments = extraDeployments
config.Get().KubeConfigPath = tmpFile.Name()

Expand All @@ -112,12 +113,14 @@ func Test(t *testing.T) { //nolint:funlen,paralleltest,cyclop
utils.SleepContext(ctx, 10*time.Second)

t.Log("Creating cluster...")

if err := applicationAPI.NewCluster(ctx); err != nil {
t.Fatal(err)
}

// test kuberentes cluster
t.Log("Test kubernetes cluster...")

if err := testKubernetesCluster(ctx, t, config.Get().KubeConfigPath); err != nil {
t.Fatal(err)
}
Expand All @@ -133,6 +136,7 @@ func Test(t *testing.T) { //nolint:funlen,paralleltest,cyclop
}

t.Log("Patch cluster...")

if err := applicationAPI.PatchClusterDeployment(ctx); err != nil {
t.Fatal(err)
}
Expand All @@ -142,6 +146,7 @@ func Test(t *testing.T) { //nolint:funlen,paralleltest,cyclop

// test kuberentes cluster after patching
t.Log("Test kubernetes cluster...")

if err := testKubernetesCluster(ctx, t, config.Get().KubeConfigPath); err != nil {
t.Fatal(err)
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ func (api *ApplicationAPI) joinToMasterNodes(ctx context.Context, server string)
if retryCount > 0 {
utils.SleepContext(ctx, config.Get().MasterServers.WaitTimeInRetry)
}

retryCount++

log.Infof("Waiting for server... try=%03d", retryCount)
Expand Down Expand Up @@ -243,6 +244,7 @@ func (api *ApplicationAPI) postInstall(ctx context.Context, copyNewScripts bool)
if retryCount > 0 {
utils.SleepContext(ctx, config.Get().MasterServers.WaitTimeInRetry)
}

retryCount++

log.Infof("Waiting for master node... try=%03d", retryCount)
Expand Down Expand Up @@ -308,6 +310,7 @@ func (api *ApplicationAPI) initFirstMasterNode(ctx context.Context) error { //no
if retryCount > 0 {
utils.SleepContext(ctx, config.Get().MasterServers.WaitTimeInRetry)
}

retryCount++

log.Infof("Waiting for master node... try=%03d", retryCount)
Expand Down
4 changes: 2 additions & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ type clusterAutoscalingGroup struct {
func getDefaultMasterServersInitParams(branch string) masterServersInitParams {
return masterServersInitParams{
TarGz: fmt.Sprintf("https://github.com/maksim-paskal/hcloud-k8s-ctl/archive/refs/heads/%s.tar.gz", branch),
Folder: fmt.Sprintf("hcloud-k8s-ctl-%s", branch),
Folder: "hcloud-k8s-ctl-" + branch,
}
}

Expand Down Expand Up @@ -222,7 +222,7 @@ func defaultConfig() Type {
Datacenter: defaultDatacenter,
KubeConfigPath: kubeConfigPath,
SSHPrivateKey: privateKey,
SSHPublicKey: fmt.Sprintf("%s.pub", privateKey),
SSHPublicKey: privateKey + ".pub",
MasterCount: masterServersCount,
CliArgs: cliArguments,
MasterServers: masterServers{
Expand Down
2 changes: 1 addition & 1 deletion pkg/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
)

var versionClient = http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error {
CheckRedirect: func(_ *http.Request, _ []*http.Request) error {
return http.ErrUseLastResponse
},
}
Expand Down

0 comments on commit 6576c1a

Please sign in to comment.