Skip to content
Open
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
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ require (
github.com/google/uuid v1.6.0
github.com/joho/godotenv v1.5.1
github.com/minio/minio-go/v7 v7.0.16
github.com/onsi/ginkgo/v2 v2.27.3
github.com/onsi/gomega v1.38.3
github.com/onsi/ginkgo/v2 v2.27.5
github.com/onsi/gomega v1.39.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.19.1
github.com/stretchr/testify v1.9.0
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,12 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/onsi/ginkgo/v2 v2.27.3 h1:ICsZJ8JoYafeXFFlFAG75a7CxMsJHwgKwtO+82SE9L8=
github.com/onsi/ginkgo/v2 v2.27.3/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
github.com/onsi/ginkgo/v2 v2.27.5 h1:ZeVgZMx2PDMdJm/+w5fE/OyG6ILo1Y3e+QX4zSR0zTE=
github.com/onsi/ginkgo/v2 v2.27.5/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
github.com/onsi/gomega v1.38.3 h1:eTX+W6dobAYfFeGC2PV6RwXRu/MyT+cQguijutvkpSM=
github.com/onsi/gomega v1.38.3/go.mod h1:ZCU1pkQcXDO5Sl9/VVEGlDyp+zm0m1cmeG5TOzLgdh4=
github.com/onsi/gomega v1.39.0 h1:y2ROC3hKFmQZJNFeGAMeHZKkjBL65mIZcvrLQBF9k6Q=
github.com/onsi/gomega v1.39.0/go.mod h1:ZCU1pkQcXDO5Sl9/VVEGlDyp+zm0m1cmeG5TOzLgdh4=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
Expand Down
2 changes: 2 additions & 0 deletions pkg/splunk/enterprise/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -1840,6 +1840,7 @@ func GetSmartstoreVolumesConfig(ctx context.Context, client splcommon.Controller
volumesConf = fmt.Sprintf(`%s
[volume:%s]
storageType = remote
use_sdk = true
path = s3://%s
remote.s3.access_key = %s
remote.s3.secret_key = %s
Expand All @@ -1851,6 +1852,7 @@ remote.s3.auth_region = %s
volumesConf = fmt.Sprintf(`%s
[volume:%s]
storageType = remote
use_sdk = true
path = s3://%s
remote.s3.endpoint = %s
remote.s3.auth_region = %s
Expand Down
39 changes: 39 additions & 0 deletions pkg/splunk/enterprise/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,45 @@ maxGlobalRawDataSizeMB = 5000
t.Errorf("expected: %s, returned: %s", expectedINIFormatString, indexesConfIni)
}
}

func TestGetSmartstoreVolumesConfigAddsUseSdk(t *testing.T) {
ctx := context.TODO()
cr := enterpriseApi.Standalone{
ObjectMeta: metav1.ObjectMeta{
Name: "standalone",
Namespace: "test",
},
}

client := spltest.NewMockClient()
secret, err := splutil.ApplyNamespaceScopedSecretObject(ctx, client, "test")
require.NoError(t, err)
secret.Data[s3AccessKey] = []byte("access")
secret.Data[s3SecretKey] = []byte("secret")
_, err = splctrl.ApplySecret(ctx, client, secret)
require.NoError(t, err)

smartstore := &enterpriseApi.SmartStoreSpec{
VolList: []enterpriseApi.VolumeSpec{
{
Name: "msos_s2s3_vol",
Endpoint: "https://s3.us-west-2.amazonaws.com",
Path: "testbucket",
Region: "us-west-2",
SecretRef: secret.Name,
},
},
}

conf, err := GetSmartstoreVolumesConfig(ctx, client, &cr, smartstore, map[string]string{})
require.NoError(t, err)
require.Contains(t, conf, "use_sdk = true")

smartstore.VolList[0].SecretRef = ""
conf, err = GetSmartstoreVolumesConfig(ctx, client, &cr, smartstore, map[string]string{})
require.NoError(t, err)
require.Contains(t, conf, "use_sdk = true")
}
func TestGetServerConfigEntries(t *testing.T) {

SmartStoreCacheManager := enterpriseApi.CacheManagerSpec{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"data": {
"conftoken": "1601945361",
"indexes.conf": "[default]\nrepFactor = auto\nmaxDataSize = auto\nhomePath = $SPLUNK_DB/$_index_name/db\ncoldPath = $SPLUNK_DB/$_index_name/colddb\nthawedPath = $SPLUNK_DB/$_index_name/thaweddb\n \n[volume:msos_s2s3_vol]\nstorageType = remote\npath = s3://testbucket-rs-london\nremote.s3.access_key = abcdJDckRkxhMEdmSk5FekFRRzBFOXV6bGNldzJSWE9IenhVUy80aa\nremote.s3.secret_key = g4NVp0a29PTzlPdGczWk1vekVUcVBSa0o4NkhBWWMvR1NadDV4YVEy\nremote.s3.endpoint = https://s3-eu-west-2.amazonaws.com\nremote.s3.auth_region = \n \n[salesdata1]\nremotePath = volume:msos_s2s3_vol/remotepath1\n\n[salesdata2]\nremotePath = volume:msos_s2s3_vol/remotepath2\n\n[salesdata3]\nremotePath = volume:msos_s2s3_vol/remotepath3\n",
"indexes.conf": "[default]\nrepFactor = auto\nmaxDataSize = auto\nhomePath = $SPLUNK_DB/$_index_name/db\ncoldPath = $SPLUNK_DB/$_index_name/colddb\nthawedPath = $SPLUNK_DB/$_index_name/thaweddb\n \n[volume:msos_s2s3_vol]\nstorageType = remote\nuse_sdk = true\npath = s3://testbucket-rs-london\nremote.s3.access_key = abcdJDckRkxhMEdmSk5FekFRRzBFOXV6bGNldzJSWE9IenhVUy80aa\nremote.s3.secret_key = g4NVp0a29PTzlPdGczWk1vekVUcVBSa0o4NkhBWWMvR1NadDV4YVEy\nremote.s3.endpoint = https://s3-eu-west-2.amazonaws.com\nremote.s3.auth_region = \n \n[salesdata1]\nremotePath = volume:msos_s2s3_vol/remotepath1\n\n[salesdata2]\nremotePath = volume:msos_s2s3_vol/remotepath2\n\n[salesdata3]\nremotePath = volume:msos_s2s3_vol/remotepath3\n",
"server.conf": ""
}
}
}
Loading