diff --git a/.golangci.yml b/.golangci.yml index 32cb7a7..9586b94 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -7,6 +7,17 @@ misspell: linters: enable-all: true disable: + # deprecated + - maligned + - varcheck + - scopelint + - ifshort + - interfacer + - structcheck + - nosnakecase + - golint + - deadcode + ############ - exhaustivestruct - exhaustruct - varnamelen diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index 3397be5..fc1b3f7 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -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() @@ -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) } @@ -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) } @@ -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) } diff --git a/pkg/api/api.go b/pkg/api/api.go index 6fbcf80..bffa256 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -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) @@ -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) @@ -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) diff --git a/pkg/config/config.go b/pkg/config/config.go index c5a7a06..2bad7c4 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -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, } } @@ -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{ diff --git a/pkg/version/version.go b/pkg/version/version.go index 3400613..0cd8a61 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -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 }, }