Skip to content

Commit 30d2982

Browse files
Fix duplicate imports and validateSplunkGeneralTerms call
- Remove duplicate testutils imports from controller test files - Remove duplicate scheme, ctrl2, config imports from controller_test.go - Remove duplicate server import from testenv.go - Remove duplicate validateSplunkGeneralTerms() call in configuration.go - Run gofmt on all affected files Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent 8a40195 commit 30d2982

19 files changed

Lines changed: 4 additions & 37 deletions

internal/controller/clustermanager_controller_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package controller
33
import (
44
"context"
55
"fmt"
6-
"github.com/splunk/splunk-operator/internal/controller/testutils"
76

87
"github.com/splunk/splunk-operator/internal/controller/testutils"
98

internal/controller/clustermaster_controller_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package controller
33
import (
44
"context"
55
"fmt"
6-
"github.com/splunk/splunk-operator/internal/controller/testutils"
76

87
"github.com/splunk/splunk-operator/internal/controller/testutils"
98

internal/controller/indexercluster_controller_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"fmt"
66
"github.com/splunk/splunk-operator/internal/controller/testutils"
77

8-
"github.com/splunk/splunk-operator/internal/controller/testutils"
9-
108
enterpriseApi "github.com/splunk/splunk-operator/api/v4"
119

1210
"time"

internal/controller/licensemanager_controller_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"fmt"
66
"github.com/splunk/splunk-operator/internal/controller/testutils"
77

8-
"github.com/splunk/splunk-operator/internal/controller/testutils"
9-
108
enterpriseApi "github.com/splunk/splunk-operator/api/v4"
119
"sigs.k8s.io/controller-runtime/pkg/client/fake"
1210

internal/controller/licensemaster_controller_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"fmt"
66
"github.com/splunk/splunk-operator/internal/controller/testutils"
77

8-
"github.com/splunk/splunk-operator/internal/controller/testutils"
9-
108
enterpriseApi "github.com/splunk/splunk-operator/api/v4"
119
"sigs.k8s.io/controller-runtime/pkg/client/fake"
1210

internal/controller/monitoringconsole_controller_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"fmt"
66
"github.com/splunk/splunk-operator/internal/controller/testutils"
77

8-
"github.com/splunk/splunk-operator/internal/controller/testutils"
9-
108
enterpriseApi "github.com/splunk/splunk-operator/api/v4"
119

1210
"time"

internal/controller/searchheadcluster_controller_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"fmt"
66
"github.com/splunk/splunk-operator/internal/controller/testutils"
77

8-
"github.com/splunk/splunk-operator/internal/controller/testutils"
9-
108
enterpriseApi "github.com/splunk/splunk-operator/api/v4"
119

1210
"time"

internal/controller/standalone_controller_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"fmt"
66
"github.com/splunk/splunk-operator/internal/controller/testutils"
77

8-
"github.com/splunk/splunk-operator/internal/controller/testutils"
9-
108
enterpriseApi "github.com/splunk/splunk-operator/api/v4"
119

1210
"time"

pkg/splunk/enterprise/configuration.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -410,11 +410,6 @@ func validateCommonSplunkSpec(ctx context.Context, c splcommon.ControllerClient,
410410
return err
411411
}
412412

413-
err = validateSplunkGeneralTerms()
414-
if err != nil {
415-
return err
416-
}
417-
418413
// if not provided, set default values for imagePullSecrets
419414
err = ValidateImagePullSecrets(ctx, c, cr, spec)
420415
if err != nil {

pkg/splunk/splkcontroller/controller_test.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,9 @@ package splkcontroller
1818
import (
1919
"context"
2020
"errors"
21-
"k8s.io/client-go/kubernetes/scheme"
2221
"net/http"
23-
ctrl2 "sigs.k8s.io/controller-runtime"
24-
"sigs.k8s.io/controller-runtime/pkg/config"
2522
"testing"
2623

27-
"k8s.io/client-go/kubernetes/scheme"
28-
ctrl2 "sigs.k8s.io/controller-runtime"
29-
"sigs.k8s.io/controller-runtime/pkg/config"
30-
3124
"github.com/go-logr/logr"
3225
splcommon "github.com/splunk/splunk-operator/pkg/splunk/common"
3326
spltest "github.com/splunk/splunk-operator/pkg/splunk/test"
@@ -37,11 +30,14 @@ import (
3730
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3831
"k8s.io/apimachinery/pkg/runtime"
3932
"k8s.io/apimachinery/pkg/runtime/schema"
33+
"k8s.io/client-go/kubernetes/scheme"
4034
"k8s.io/client-go/rest"
4135
"k8s.io/client-go/tools/record"
36+
ctrl2 "sigs.k8s.io/controller-runtime"
4237
"sigs.k8s.io/controller-runtime/pkg/cache"
4338
"sigs.k8s.io/controller-runtime/pkg/cache/informertest"
4439
"sigs.k8s.io/controller-runtime/pkg/client"
40+
"sigs.k8s.io/controller-runtime/pkg/config"
4541
"sigs.k8s.io/controller-runtime/pkg/healthz"
4642
logf "sigs.k8s.io/controller-runtime/pkg/log"
4743
"sigs.k8s.io/controller-runtime/pkg/manager"

0 commit comments

Comments
 (0)