Skip to content

Commit ae1cb14

Browse files
CSPL-3964: Fixing smoke test failures caused by operator-sdk upgrade changes as well as rebasing to develop.
1 parent 679d30d commit ae1cb14

File tree

6 files changed

+105
-17
lines changed

6 files changed

+105
-17
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ AWSCLI_URL=https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.8.6.zip
55
KUBECTL_VERSION=v1.29.1
66
AZ_CLI_VERSION=2.79.0
77
EKSCTL_VERSION=v0.215.0
8-
EKS_CLUSTER_K8_VERSION=1.34
8+
EKS_CLUSTER_K8_VERSION=1.34.0
99
EKS_INSTANCE_TYPE=m5.2xlarge
1010
EKS_INSTANCE_TYPE_ARM64=c6g.4xlarge
1111
SPLUNK_ENTERPRISE_RELEASE_IMAGE=splunk/splunk:10.0.0

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ require (
1717
github.com/google/uuid v1.6.0
1818
github.com/joho/godotenv v1.5.1
1919
github.com/minio/minio-go/v7 v7.0.16
20-
github.com/onsi/ginkgo/v2 v2.26.0
20+
github.com/onsi/ginkgo/v2 v2.27.2
2121
github.com/onsi/gomega v1.38.2
2222
github.com/pkg/errors v0.9.1
2323
github.com/prometheus/client_golang v1.22.0
@@ -126,7 +126,6 @@ require (
126126
go.opentelemetry.io/otel/sdk v1.33.0 // indirect
127127
go.opentelemetry.io/otel/trace v1.33.0 // indirect
128128
go.opentelemetry.io/proto/otlp v1.4.0 // indirect
129-
go.uber.org/automaxprocs v1.6.0 // indirect
130129
go.uber.org/multierr v1.11.0 // indirect
131130
go.yaml.in/yaml/v3 v3.0.4 // indirect
132131
golang.org/x/crypto v0.41.0 // indirect

go.sum

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos
106106
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
107107
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
108108
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
109+
github.com/gkampitakis/ciinfo v0.3.2 h1:JcuOPk8ZU7nZQjdUhctuhQofk7BGHuIy0c9Ez8BNhXs=
110+
github.com/gkampitakis/ciinfo v0.3.2/go.mod h1:1NIwaOcFChN4fa/B0hEBdAb6npDlFL8Bwx4dfRLRqAo=
111+
github.com/gkampitakis/go-diff v1.3.2 h1:Qyn0J9XJSDTgnsgHRdz9Zp24RaJeKMUHg2+PDZZdC4M=
112+
github.com/gkampitakis/go-diff v1.3.2/go.mod h1:LLgOrpqleQe26cte8s36HTWcTmMEur6OPYerdAAS9tk=
113+
github.com/gkampitakis/go-snaps v0.5.15 h1:amyJrvM1D33cPHwVrjo9jQxX8g/7E2wYdZ+01KS3zGE=
114+
github.com/gkampitakis/go-snaps v0.5.15/go.mod h1:HNpx/9GoKisdhw9AFOBT1N7DBs9DiHo/hGheFGBZ+mc=
109115
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
110116
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
111117
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
@@ -123,6 +129,8 @@ github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+Gr
123129
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
124130
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
125131
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
132+
github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
133+
github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
126134
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
127135
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
128136
github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8=
@@ -186,6 +194,8 @@ github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
186194
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
187195
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
188196
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
197+
github.com/joshdk/go-junit v1.0.0 h1:S86cUKIdwBHWwA6xCmFlf3RTLfVXYQfvanM5Uh+K6GE=
198+
github.com/joshdk/go-junit v1.0.0/go.mod h1:TiiV0PqkaNfFXjEiyjWM3XXrhVyCa1K4Zfga6W52ung=
189199
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
190200
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
191201
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
@@ -210,6 +220,10 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
210220
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
211221
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
212222
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
223+
github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo=
224+
github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg=
225+
github.com/mfridman/tparse v0.18.0 h1:wh6dzOKaIwkUGyKgOntDW4liXSo37qg5AXbIhkMV3vE=
226+
github.com/mfridman/tparse v0.18.0/go.mod h1:gEvqZTuCgEhPbYk/2lS3Kcxg1GmTxxU7kTC8DvP0i/A=
213227
github.com/minio/md5-simd v1.1.0 h1:QPfiOqlZH+Cj9teu0t9b1nTBfPbyTl16Of5MeuShdK4=
214228
github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw=
215229
github.com/minio/minio-go/v7 v7.0.16 h1:GspaSBS8lOuEUCAqMe0W3UxSoyOA4b4F8PTspRVI+k4=
@@ -231,10 +245,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
231245
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
232246
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
233247
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
234-
github.com/onsi/ginkgo/v2 v2.25.3 h1:Ty8+Yi/ayDAGtk4XxmmfUy4GabvM+MegeB4cDLRi6nw=
235-
github.com/onsi/ginkgo/v2 v2.25.3/go.mod h1:43uiyQC4Ed2tkOzLsEYm7hnrb7UJTWHYNsuy3bG/snE=
236-
github.com/onsi/ginkgo/v2 v2.26.0 h1:1J4Wut1IlYZNEAWIV3ALrT9NfiaGW2cDCJQSFQMs/gE=
237-
github.com/onsi/ginkgo/v2 v2.26.0/go.mod h1:qhEywmzWTBUY88kfO0BRvX4py7scov9yR+Az2oavUzw=
248+
github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns=
249+
github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
238250
github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A=
239251
github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k=
240252
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
@@ -244,8 +256,6 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
244256
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
245257
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
246258
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
247-
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
248-
github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
249259
github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q=
250260
github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0=
251261
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
@@ -285,6 +295,14 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
285295
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
286296
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
287297
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
298+
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
299+
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
300+
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
301+
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
302+
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
303+
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
304+
github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
305+
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
288306
github.com/wk8/go-ordered-map/v2 v2.1.7 h1:aUZ1xBMdbvY8wnNt77qqo4nyT3y0pX4Usat48Vm+hik=
289307
github.com/wk8/go-ordered-map/v2 v2.1.7/go.mod h1:9Xvgm2mV2kSq2SAm0Y608tBmu8akTzI7c2bz7/G7ZN4=
290308
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
@@ -313,8 +331,6 @@ go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qq
313331
go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck=
314332
go.opentelemetry.io/proto/otlp v1.4.0 h1:TA9WRvW6zMwP+Ssb6fLoUIuirti1gGbP28GcKG1jgeg=
315333
go.opentelemetry.io/proto/otlp v1.4.0/go.mod h1:PPBWZIP98o2ElSqI35IHfu7hIhSwvc5N38Jw8pXuGFY=
316-
go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
317-
go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
318334
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
319335
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
320336
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=

test/appframework_aws/s1/appframework_aws_suite_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
. "github.com/onsi/ginkgo/v2"
2323
. "github.com/onsi/gomega"
2424

25+
"github.com/splunk/splunk-operator/pkg/splunk/enterprise"
2526
"github.com/splunk/splunk-operator/test/testenv"
2627
)
2728

@@ -60,6 +61,22 @@ func TestBasic(t *testing.T) {
6061

6162
var _ = BeforeSuite(func() {
6263
var err error
64+
65+
// Override script locations to use absolute paths for integration tests
66+
// These are relative to test/appframework_aws/s1/, so we go up 3 levels to project root
67+
enterprise.GetReadinessScriptLocation = func() string {
68+
fileLocation, _ := filepath.Abs("../../../tools/k8_probes/readinessProbe.sh")
69+
return fileLocation
70+
}
71+
enterprise.GetLivenessScriptLocation = func() string {
72+
fileLocation, _ := filepath.Abs("../../../tools/k8_probes/livenessProbe.sh")
73+
return fileLocation
74+
}
75+
enterprise.GetStartupScriptLocation = func() string {
76+
fileLocation, _ := filepath.Abs("../../../tools/k8_probes/startupProbe.sh")
77+
return fileLocation
78+
}
79+
6380
testenvInstance, err = testenv.NewDefaultTestEnv(testSuiteName)
6481
Expect(err).ToNot(HaveOccurred())
6582

test/testenv/s3utils.go

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package testenv
33
import (
44
"context"
55
"errors"
6+
"fmt"
67
"log"
78
"os"
89
"os/exec"
@@ -267,10 +268,28 @@ func DisableAppsToS3(downloadDir string, appFileList []string, s3TestDir string)
267268

268269
// Disable the app
269270
// - Get the name of the untarred app folder (as it could be different from the tgz file)
270-
wildcardpath := untarredCurrentAppFolder + "/*/./"
271-
bytepath, _ := exec.Command("/bin/sh", "-c", "cd "+wildcardpath+"; pwd").Output()
272-
untarredAppRootFolder := string(bytepath)
273-
untarredAppRootFolder = untarredAppRootFolder[:len(untarredAppRootFolder)-1] //removing \n at the end of folder path
271+
// Use filepath.ReadDir to reliably get the first directory
272+
entries, err := os.ReadDir(untarredCurrentAppFolder)
273+
if err != nil {
274+
log.Fatalln(err)
275+
return nil, err
276+
}
277+
278+
var appFolderName string
279+
for _, entry := range entries {
280+
if entry.IsDir() {
281+
appFolderName = entry.Name()
282+
break
283+
}
284+
}
285+
286+
if appFolderName == "" {
287+
err := fmt.Errorf("no app directory found in %s", untarredCurrentAppFolder)
288+
log.Fatalln(err)
289+
return nil, err
290+
}
291+
292+
untarredAppRootFolder := filepath.Join(untarredCurrentAppFolder, appFolderName)
274293

275294
// - Edit /default/app.conf (add "state = disabled" in [install] stanza)
276295
appConfFile := untarredAppRootFolder + "/default/app.conf"
@@ -295,8 +314,6 @@ func DisableAppsToS3(downloadDir string, appFileList []string, s3TestDir string)
295314
}
296315

297316
// Tar disabled app folder
298-
lastInd = strings.LastIndex(untarredAppRootFolder, "/")
299-
appFolderName := untarredAppRootFolder[lastInd+1:]
300317
tarDestination := disabledAppsFolder + "/" + key
301318
cmd = exec.Command("tar", "-czf", tarDestination, "--directory", untarredCurrentAppFolder, appFolderName)
302319
cmd.Run()

test/testenv/testenv.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525

2626
enterpriseApiV3 "github.com/splunk/splunk-operator/api/v3"
2727
enterpriseApi "github.com/splunk/splunk-operator/api/v4"
28+
"github.com/splunk/splunk-operator/internal/controller"
2829

2930
"github.com/go-logr/logr"
3031
"github.com/onsi/ginkgo/v2"
@@ -277,6 +278,44 @@ func NewTestEnv(name, commitHash, operatorImage, splunkImage, licenseFilePath st
277278
return nil, fmt.Errorf("kubeClient is nil")
278279
}
279280

281+
// Register controllers with the manager
282+
if err := (&controller.ClusterManagerReconciler{
283+
Client: kubeManager.GetClient(),
284+
Scheme: kubeManager.GetScheme(),
285+
}).SetupWithManager(kubeManager); err != nil {
286+
return nil, fmt.Errorf("unable to setup ClusterManagerReconciler: %w", err)
287+
}
288+
if err := (&controller.IndexerClusterReconciler{
289+
Client: kubeManager.GetClient(),
290+
Scheme: kubeManager.GetScheme(),
291+
}).SetupWithManager(kubeManager); err != nil {
292+
return nil, fmt.Errorf("unable to setup IndexerClusterReconciler: %w", err)
293+
}
294+
if err := (&controller.LicenseManagerReconciler{
295+
Client: kubeManager.GetClient(),
296+
Scheme: kubeManager.GetScheme(),
297+
}).SetupWithManager(kubeManager); err != nil {
298+
return nil, fmt.Errorf("unable to setup LicenseManagerReconciler: %w", err)
299+
}
300+
if err := (&controller.MonitoringConsoleReconciler{
301+
Client: kubeManager.GetClient(),
302+
Scheme: kubeManager.GetScheme(),
303+
}).SetupWithManager(kubeManager); err != nil {
304+
return nil, fmt.Errorf("unable to setup MonitoringConsoleReconciler: %w", err)
305+
}
306+
if err := (&controller.SearchHeadClusterReconciler{
307+
Client: kubeManager.GetClient(),
308+
Scheme: kubeManager.GetScheme(),
309+
}).SetupWithManager(kubeManager); err != nil {
310+
return nil, fmt.Errorf("unable to setup SearchHeadClusterReconciler: %w", err)
311+
}
312+
if err := (&controller.StandaloneReconciler{
313+
Client: kubeManager.GetClient(),
314+
Scheme: kubeManager.GetScheme(),
315+
}).SetupWithManager(kubeManager); err != nil {
316+
return nil, fmt.Errorf("unable to setup StandaloneReconciler: %w", err)
317+
}
318+
280319
// We need to start the manager to setup the cache. Otherwise, we have to
281320
// use apireader instead of kubeclient when retrieving resources
282321
go func() {

0 commit comments

Comments
 (0)