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

Fix linter errors #557

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pkg/modules/application_mobility_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func TestApplicationMobilityPrecheck(t *testing.T) {
appMobility := tmpCR.Spec.Modules[0]

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(licenceCred).WithObjects(ivLicense).Build()
fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
clusterClient := ctrlClientFake.NewClientBuilder().WithObjects(licenceCred).WithObjects(ivLicense).Build()
return clusterClient, nil
}
Expand All @@ -408,7 +408,7 @@ func TestApplicationMobilityPrecheck(t *testing.T) {
ivLicense := getSecret(ns, "iv")

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(licenceCred).WithObjects(ivLicense).Build()
fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
return ctrlClientFake.NewClientBuilder().WithObjects(licenceCred).WithObjects(ivLicense).Build(), nil
}

Expand All @@ -428,7 +428,7 @@ func TestApplicationMobilityPrecheck(t *testing.T) {
ivLicense := getSecret(ns, "iv")

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(licenceCred).WithObjects(ivLicense).Build()
fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
return ctrlClientFake.NewClientBuilder().WithObjects(licenceCred).WithObjects(ivLicense).Build(), nil
}

Expand All @@ -446,7 +446,7 @@ func TestApplicationMobilityPrecheck(t *testing.T) {
licenceCred := getSecret(ns, "dls-licenses")

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(licenceCred).Build()
fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
return ctrlClientFake.NewClientBuilder().WithObjects(licenceCred).Build(), nil
}

Expand All @@ -463,7 +463,7 @@ func TestApplicationMobilityPrecheck(t *testing.T) {
}()
success, appMobility, tmpCR, sourceClient, fakeControllerRuntimeClient := tc(t)
utils.NewControllerRuntimeClientWrapper = fakeControllerRuntimeClient
utils.NewK8sClientWrapper = func(clusterConfigData []byte) (*kubernetes.Clientset, error) {
utils.NewK8sClientWrapper = func(_ []byte) (*kubernetes.Clientset, error) {
return nil, nil
}
fakeReconcile := utils.FakeReconcileCSM{
Expand Down
10 changes: 5 additions & 5 deletions pkg/modules/authorization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ func TestAuthorizationServerPreCheck(t *testing.T) {

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(karaviConfig, karaviStorage, karaviTLS).Build()

fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
clusterClient := ctrlClientFake.NewClientBuilder().WithObjects(karaviConfig, karaviStorage, karaviTLS).Build()
return clusterClient, nil
}
Expand All @@ -459,7 +459,7 @@ func TestAuthorizationServerPreCheck(t *testing.T) {
karaviTLS := getSecret(customResource.Namespace, "karavi-auth-tls")

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(karaviConfig, karaviStorage, karaviTLS).Build()
fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
clusterClient := ctrlClientFake.NewClientBuilder().WithObjects(karaviConfig, karaviStorage, karaviTLS).Build()
return clusterClient, nil
}
Expand All @@ -478,7 +478,7 @@ func TestAuthorizationServerPreCheck(t *testing.T) {

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects().Build()

fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
return ctrlClientFake.NewClientBuilder().WithObjects().Build(), nil
}

Expand All @@ -499,7 +499,7 @@ func TestAuthorizationServerPreCheck(t *testing.T) {
}
sourceClient := ctrlClientFake.NewClientBuilder().WithObjects().Build()

fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
clusterClient := ctrlClientFake.NewClientBuilder().WithObjects().Build()
return clusterClient, nil
}
Expand All @@ -518,7 +518,7 @@ func TestAuthorizationServerPreCheck(t *testing.T) {

success, auth, tmpCR, sourceClient, fakeControllerRuntimeClient := tc(t)
utils.NewControllerRuntimeClientWrapper = fakeControllerRuntimeClient
utils.NewK8sClientWrapper = func(clusterConfigData []byte) (*kubernetes.Clientset, error) {
utils.NewK8sClientWrapper = func(_ []byte) (*kubernetes.Clientset, error) {
return nil, nil
}

Expand Down
18 changes: 9 additions & 9 deletions pkg/modules/observability_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestObservabilityPrecheck(t *testing.T) {
observability := tmpCR.Spec.Modules[0]

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(isilonCreds).Build()
fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
clusterClient := ctrlClientFake.NewClientBuilder().WithObjects(isilonCreds).Build()
return clusterClient, nil
}
Expand All @@ -68,7 +68,7 @@ func TestObservabilityPrecheck(t *testing.T) {
observability := tmpCR.Spec.Modules[0]

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(isilonCreds).Build()
fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
clusterClient := ctrlClientFake.NewClientBuilder().WithObjects(isilonCreds).Build()
return clusterClient, nil
}
Expand All @@ -89,7 +89,7 @@ func TestObservabilityPrecheck(t *testing.T) {
observability := tmpCR.Spec.Modules[0]

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(vxflexosCreds).Build()
fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
clusterClient := ctrlClientFake.NewClientBuilder().WithObjects(vxflexosCreds).Build()
return clusterClient, nil
}
Expand All @@ -110,7 +110,7 @@ func TestObservabilityPrecheck(t *testing.T) {
observability := tmpCR.Spec.Modules[0]

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(pmaxCreds).Build()
fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
clusterClient := ctrlClientFake.NewClientBuilder().WithObjects(pmaxCreds).Build()
return clusterClient, nil
}
Expand All @@ -131,7 +131,7 @@ func TestObservabilityPrecheck(t *testing.T) {
observability.ConfigVersion = "v1.6.0"

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(isilonCreds).Build()
fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
clusterClient := ctrlClientFake.NewClientBuilder().WithObjects(isilonCreds).Build()
return clusterClient, nil
}
Expand All @@ -156,7 +156,7 @@ func TestObservabilityPrecheck(t *testing.T) {
auth.Enabled = true

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(isilonCreds, karaviAuthconfig, proxyAuthzTokens).Build()
fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
clusterClient := ctrlClientFake.NewClientBuilder().WithObjects(isilonCreds).Build()
return clusterClient, nil
}
Expand All @@ -178,7 +178,7 @@ func TestObservabilityPrecheck(t *testing.T) {

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(isilonCreds).Build()

fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
return ctrlClientFake.NewClientBuilder().WithObjects(isilonCreds).Build(), nil
}

Expand All @@ -199,7 +199,7 @@ func TestObservabilityPrecheck(t *testing.T) {

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(isilonCreds).Build()

fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
return ctrlClientFake.NewClientBuilder().WithObjects().Build(), nil
}

Expand All @@ -217,7 +217,7 @@ func TestObservabilityPrecheck(t *testing.T) {

success, observability, tmpCR, sourceClient, fakeControllerRuntimeClient := tc(t)
utils.NewControllerRuntimeClientWrapper = fakeControllerRuntimeClient
utils.NewK8sClientWrapper = func(clusterConfigData []byte) (*kubernetes.Clientset, error) {
utils.NewK8sClientWrapper = func(_ []byte) (*kubernetes.Clientset, error) {
return nil, nil
}

Expand Down
18 changes: 9 additions & 9 deletions pkg/modules/replication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func TestReplicationPreCheck(t *testing.T) {

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(cluster1ConfigSecret, cluster2ConfigSecret, driverSecret1, driverSecret2).Build()

fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
clusterClient := ctrlClientFake.NewClientBuilder().WithObjects(driverSecret1, driverSecret2).Build()
return clusterClient, nil
}
Expand All @@ -182,7 +182,7 @@ func TestReplicationPreCheck(t *testing.T) {

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(cluster1ConfigSecret, cluster2ConfigSecret, driverSecret1, driverSecret2).Build()

fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
clusterClient := ctrlClientFake.NewClientBuilder().WithObjects(driverSecret1, driverSecret2).Build()
return clusterClient, nil
}
Expand All @@ -206,7 +206,7 @@ func TestReplicationPreCheck(t *testing.T) {
driverSecret2 := getSecret(customResource.Namespace, customResource.Name+"-certs-0")

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(cluster1ConfigSecret, cluster2ConfigSecret, driverSecret1, driverSecret2).Build()
fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
clusterClient := ctrlClientFake.NewClientBuilder().WithObjects(driverSecret1, driverSecret2).Build()
return clusterClient, nil
}
Expand All @@ -229,7 +229,7 @@ func TestReplicationPreCheck(t *testing.T) {

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(cluster1ConfigSecret, cluster2ConfigSecret).Build()

fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
driverSecret1 := getSecret(customResource.Namespace, customResource.Name+"-creds")
clusterClient := ctrlClientFake.NewClientBuilder().WithObjects(driverSecret1).Build()
return clusterClient, nil
Expand Down Expand Up @@ -260,7 +260,7 @@ func TestReplicationPreCheck(t *testing.T) {

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects().Build()

fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
return ctrlClientFake.NewClientBuilder().WithObjects().Build(), nil
}

Expand All @@ -279,7 +279,7 @@ func TestReplicationPreCheck(t *testing.T) {

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects().Build()

fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
return ctrlClientFake.NewClientBuilder().WithObjects().Build(), nil
}

Expand All @@ -298,7 +298,7 @@ func TestReplicationPreCheck(t *testing.T) {

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects().Build()

fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
return ctrlClientFake.NewClientBuilder().WithObjects().Build(), nil
}

Expand All @@ -317,7 +317,7 @@ func TestReplicationPreCheck(t *testing.T) {

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects().Build()

fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
return ctrlClientFake.NewClientBuilder().WithObjects().Build(), nil
}

Expand All @@ -336,7 +336,7 @@ func TestReplicationPreCheck(t *testing.T) {

success, replica, tmpCR, sourceClient, fakeControllerRuntimeClient := tc(t)
utils.NewControllerRuntimeClientWrapper = fakeControllerRuntimeClient
utils.NewK8sClientWrapper = func(clusterConfigData []byte) (*kubernetes.Clientset, error) {
utils.NewK8sClientWrapper = func(_ []byte) (*kubernetes.Clientset, error) {
return nil, nil
}

Expand Down
10 changes: 5 additions & 5 deletions pkg/modules/resiliency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func TestResiliencyPrecheck(t *testing.T) {
replica := tmpCR.Spec.Modules[0]
sourceClient := ctrlClientFake.NewClientBuilder().WithObjects().Build()

fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
return ctrlClientFake.NewClientBuilder().WithObjects().Build(), nil
}

Expand All @@ -199,7 +199,7 @@ func TestResiliencyPrecheck(t *testing.T) {

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects().Build()

fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
return ctrlClientFake.NewClientBuilder().WithObjects().Build(), nil
}

Expand All @@ -218,7 +218,7 @@ func TestResiliencyPrecheck(t *testing.T) {

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects().Build()

fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
return ctrlClientFake.NewClientBuilder().WithObjects().Build(), nil
}

Expand All @@ -237,7 +237,7 @@ func TestResiliencyPrecheck(t *testing.T) {

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects().Build()

fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
return ctrlClientFake.NewClientBuilder().WithObjects().Build(), nil
}

Expand All @@ -256,7 +256,7 @@ func TestResiliencyPrecheck(t *testing.T) {

success, replica, tmpCR, sourceClient, fakeControllerRuntimeClient := tc(t)
utils.NewControllerRuntimeClientWrapper = fakeControllerRuntimeClient
utils.NewK8sClientWrapper = func(clusterConfigData []byte) (*kubernetes.Clientset, error) {
utils.NewK8sClientWrapper = func(_ []byte) (*kubernetes.Clientset, error) {
return nil, nil
}

Expand Down
16 changes: 8 additions & 8 deletions pkg/modules/reverseproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestReverseProxyPrecheck(t *testing.T) {
reverseProxy := tmpCR.Spec.Modules[0]

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(proxySecret, proxyConfigMap).Build()
fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
clusterClient := ctrlClientFake.NewClientBuilder().WithObjects(proxySecret, proxyConfigMap).Build()
return clusterClient, nil
}
Expand All @@ -69,7 +69,7 @@ func TestReverseProxyPrecheck(t *testing.T) {
auth.Enabled = true

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(proxySecret, proxyConfigMap, karaviAuthconfig, proxyAuthzTokens).Build()
fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
clusterClient := ctrlClientFake.NewClientBuilder().WithObjects(proxySecret, proxyConfigMap).Build()
return clusterClient, nil
}
Expand All @@ -91,7 +91,7 @@ func TestReverseProxyPrecheck(t *testing.T) {
reverseProxy.ConfigVersion = "v100000.0.0"

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(proxySecret, proxyConfigMap).Build()
fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
return ctrlClientFake.NewClientBuilder().WithObjects(proxySecret, proxyConfigMap).Build(), nil
}

Expand All @@ -113,7 +113,7 @@ func TestReverseProxyPrecheck(t *testing.T) {

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(proxySecret, proxyConfigMap).Build()

fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
return ctrlClientFake.NewClientBuilder().WithObjects().Build(), nil
}

Expand All @@ -133,7 +133,7 @@ func TestReverseProxyPrecheck(t *testing.T) {

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(proxyConfigMap).Build()

fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
return ctrlClientFake.NewClientBuilder().WithObjects().Build(), nil
}

Expand All @@ -153,7 +153,7 @@ func TestReverseProxyPrecheck(t *testing.T) {

sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(proxySecret).Build()

fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
return ctrlClientFake.NewClientBuilder().WithObjects().Build(), nil
}

Expand All @@ -174,7 +174,7 @@ func TestReverseProxyPrecheck(t *testing.T) {
reverseProxy.Components = nil
sourceClient := ctrlClientFake.NewClientBuilder().WithObjects(proxySecret, proxyConfigMap).Build()

fakeControllerRuntimeClient := func(clusterConfigData []byte) (ctrlClient.Client, error) {
fakeControllerRuntimeClient := func(_ []byte) (ctrlClient.Client, error) {
return ctrlClientFake.NewClientBuilder().WithObjects().Build(), nil
}

Expand All @@ -192,7 +192,7 @@ func TestReverseProxyPrecheck(t *testing.T) {

success, reverseProxy, tmpCR, sourceClient, fakeControllerRuntimeClient := tc(t)
utils.NewControllerRuntimeClientWrapper = fakeControllerRuntimeClient
utils.NewK8sClientWrapper = func(clusterConfigData []byte) (*kubernetes.Clientset, error) {
utils.NewK8sClientWrapper = func(_ []byte) (*kubernetes.Clientset, error) {
return nil, nil
}

Expand Down
Loading