Skip to content

Commit

Permalink
lint: unused argument
Browse files Browse the repository at this point in the history
  • Loading branch information
thbkrkr committed May 30, 2023
1 parent e01d73a commit 0900742
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion pkg/controller/apmserver/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ func withESReference(apm apmv1.ApmServer, selector commonv1.ObjectSelector) *apm
return obj
}

func withAssociationConf(apm apmv1.ApmServer, conf commonv1.AssociationConf) *apmv1.ApmServer {
func withAssociationConf(apm apmv1.ApmServer, _ commonv1.AssociationConf) *apmv1.ApmServer {
obj := apm.DeepCopy()
association := apmv1.NewApmEsAssociation(obj)
association.SetAssociationConf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,6 @@ func (f *fakeEsClient) CreateAutoscalingPolicy(_ context.Context, _ string, _ v1
func (f *fakeEsClient) GetAutoscalingCapacity(_ context.Context) (esclient.AutoscalingCapacityResult, error) {
return f.autoscalingPolicies, nil
}
func (f *fakeEsClient) UpdateMLNodesSettings(_ context.Context, maxLazyMLNodes int32, maxMemory string) error {
func (f *fakeEsClient) UpdateMLNodesSettings(_ context.Context, _ int32, _ string) error {
return nil
}
2 changes: 1 addition & 1 deletion pkg/controller/elasticsearch/bootstrap/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type fakeESClient struct {
err error
}

func (f *fakeESClient) GetClusterInfo(ctx context.Context) (esclient.Info, error) {
func (f *fakeESClient) GetClusterInfo(_ context.Context) (esclient.Info, error) {
return esclient.Info{ClusterUUID: f.uuid}, f.err
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/elasticsearch/client/v6.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ func (c *clientV6) StartBasic(ctx context.Context) (StartBasicResponse, error) {
return response, err
}

func (c *clientV6) AddVotingConfigExclusions(ctx context.Context, nodeNames []string) error {
func (c *clientV6) AddVotingConfigExclusions(_ context.Context, _ []string) error {
return errNotSupportedInEs6x
}

func (c *clientV6) DeleteVotingConfigExclusions(ctx context.Context, waitForRemoval bool) error {
func (c *clientV6) DeleteVotingConfigExclusions(_ context.Context, waitForRemoval bool) error {
return errNotSupportedInEs6x
}

Expand Down Expand Up @@ -211,7 +211,7 @@ func (c *clientV6) ClusterBootstrappedForZen2(ctx context.Context) (bool, error)
return false, errors.New("no master found in ClusterBootstrappedForZen2")
}

func (c *clientV6) GetClusterState(ctx context.Context) (ClusterState, error) {
func (c *clientV6) GetClusterState(_ context.Context) (ClusterState, error) {
return ClusterState{}, errors.New("cluster state is not supported in Elasticsearch 6.x")
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/elasticsearch/client/v7.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (c *clientV7) DeleteVotingConfigExclusions(ctx context.Context, waitForRemo
return nil
}

func (c *clientV7) GetClusterState(ctx context.Context) (ClusterState, error) {
func (c *clientV7) GetClusterState(_ context.Context) (ClusterState, error) {
return ClusterState{}, errors.New("cluster state is not supported in Elasticsearch 7.x")
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/elasticsearch/client/v8.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (c *clientV8) AddVotingConfigExclusions(ctx context.Context, nodeNames []st
return nil
}

func (c *clientV8) SyncedFlush(ctx context.Context) error {
func (c *clientV8) SyncedFlush(_ context.Context) error {
return errors.New("synced flush is not supported in Elasticsearch 8.x")
}

Expand Down
12 changes: 6 additions & 6 deletions pkg/controller/elasticsearch/license/apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ type fakeInvalidLicenseUpdater struct {
statusCodeOnGetLicense int
}

func (f *fakeInvalidLicenseUpdater) GetLicense(ctx context.Context) (esclient.License, error) {
func (f *fakeInvalidLicenseUpdater) GetLicense(_ context.Context) (esclient.License, error) {
if f.statusCodeOnGetLicense == 200 {
return f.license, nil
}
Expand All @@ -327,26 +327,26 @@ type fakeLicenseUpdater struct {
updateLicenseCalled bool
}

func (f *fakeLicenseUpdater) StartTrial(ctx context.Context) (esclient.StartTrialResponse, error) {
func (f *fakeLicenseUpdater) StartTrial(_ context.Context) (esclient.StartTrialResponse, error) {
return esclient.StartTrialResponse{
Acknowledged: true,
TrialWasStarted: true,
}, nil
}

func (f *fakeLicenseUpdater) GetLicense(ctx context.Context) (esclient.License, error) {
func (f *fakeLicenseUpdater) GetLicense(_ context.Context) (esclient.License, error) {
return f.license, nil
}

func (f *fakeLicenseUpdater) UpdateLicense(ctx context.Context, licenses esclient.LicenseUpdateRequest) (esclient.LicenseUpdateResponse, error) {
func (f *fakeLicenseUpdater) UpdateLicense(_ context.Context, _ esclient.LicenseUpdateRequest) (esclient.LicenseUpdateResponse, error) {
f.updateLicenseCalled = true
return esclient.LicenseUpdateResponse{
Acknowledged: true,
LicenseStatus: "valid",
}, nil
}

func (f *fakeLicenseUpdater) StartBasic(ctx context.Context) (esclient.StartBasicResponse, error) {
func (f *fakeLicenseUpdater) StartBasic(_ context.Context) (esclient.StartBasicResponse, error) {
f.startBasicCalled = true
return esclient.StartBasicResponse{}, nil
}
Expand All @@ -358,7 +358,7 @@ type fakeClient struct {
errors map[client.ObjectKey]error
}

func (f *fakeClient) Get(ctx context.Context, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error {
func (f *fakeClient) Get(_ context.Context, key client.ObjectKey, obj client.Object, _ ...client.GetOption) error {
if err := f.errors[key]; err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/elasticsearch/observer/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func TestManager_StopObserving(t *testing.T) {
}
}

func TestManager_AddObservationListener(t *testing.T) {
func TestManager_AddObservationListener(_ *testing.T) {
m := NewManager(1*time.Second, nil)
ctx := context.Background()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ type fakeESClient struct {
client.Client
}

func (f *fakeESClient) SetMinimumMasterNodes(ctx context.Context, count int) error {
func (f *fakeESClient) SetMinimumMasterNodes(_ context.Context, count int) error {
f.called = true
f.calledWith = count
return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/kibana/config_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func filterConfigSettings(kb kbv1.Kibana, cfg *settings.CanonicalConfig) error {
}

// VersionDefaults generates any version specific settings that should exist by default.
func VersionDefaults(kb *kbv1.Kibana, v version.Version) *settings.CanonicalConfig {
func VersionDefaults(_ *kbv1.Kibana, v version.Version) *settings.CanonicalConfig {
if v.GTE(version.From(7, 6, 0)) {
// setting exists only as of 7.6.0
return settings.MustCanonicalConfig(map[string]interface{}{XpackLicenseManagementUIEnabled: false})
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/kibana/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,11 @@ func newK8sFailingStatusUpdateClient(initObjs ...client.Object) *k8sFailingStatu
}
}

func (k *k8sFailingStatusUpdateClient) Get(ctx context.Context, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error {
func (k *k8sFailingStatusUpdateClient) Get(ctx context.Context, key client.ObjectKey, obj client.Object, _ ...client.GetOption) error {
return k.client.Get(ctx, key, obj)
}

func (k *k8sFailingStatusUpdateClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error {
func (k *k8sFailingStatusUpdateClient) Update(_ context.Context, _ client.Object, _ ...client.UpdateOption) error {
return errors.New("internal error")
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/dev/portforward/pod_forwarder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type capturingDialer struct {
addresses []string
}

func (d *capturingDialer) DialContext(ctx context.Context, network, address string) (net.Conn, error) {
func (d *capturingDialer) DialContext(_ context.Context, _, address string) (net.Conn, error) {
d.addresses = append(d.addresses, address)
return nil, nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/vault/secret_file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func newMockClient(t *testing.T, data ...string) Client {
}
}

func (c *mockClient) Read(path string) (*api.Secret, error) {
func (c *mockClient) Read(_ string) (*api.Secret, error) {
c.readCount++
return &api.Secret{Data: c.data}, nil
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/test/elasticsearch/checks_reversal.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (s *MutationReversalTestContext) PostMutationSteps(k *test.K8sClient) test.
}
}

func (s *MutationReversalTestContext) VerificationSteps(k *test.K8sClient) test.StepList {
func (s *MutationReversalTestContext) VerificationSteps(_ *test.K8sClient) test.StepList {
//nolint:thelper
return test.StepList{
{
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/test/logstash/http_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
)

// TODO refactor identical to Kibana client
func NewLogstashClient(logstash v1alpha1.Logstash, k *test.K8sClient) (*http.Client, error) {
func NewLogstashClient(logstash v1alpha1.Logstash, _ *test.K8sClient) (*http.Client, error) {
var caCerts []*x509.Certificate
// TODO: Integrate with TLS on metrics API
// if ems.Spec.HTTP.TLS.Enabled() {
Expand Down

0 comments on commit 0900742

Please sign in to comment.