Skip to content

Commit 9fbcb4a

Browse files
committed
CSPL-3558 Fix helm tests
1 parent 4622102 commit 9fbcb4a

File tree

9 files changed

+121
-131
lines changed

9 files changed

+121
-131
lines changed

helm-chart/splunk-operator/templates/rbac/ingestorcluster_editor_role.yaml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
# Grants permissions to create, update, and delete resources within the enterprise.splunk.com.
55
# This role is intended for users who need to manage these resources
66
# but should not control RBAC or manage permissions for others.
7-
7+
{{- if .Values.splunkOperator.clusterWideAccess }}
88
apiVersion: rbac.authorization.k8s.io/v1
99
kind: ClusterRole
1010
metadata:
11-
name: ingestorcluster-editor-role
11+
name: {{ include "splunk-operator.operator.fullname" . }}-ingestorcluster-editor-role
1212
rules:
1313
- apiGroups:
1414
- enterprise.splunk.com
@@ -28,3 +28,28 @@ rules:
2828
- ingestorclusters/status
2929
verbs:
3030
- get
31+
{{- else }}
32+
apiVersion: rbac.authorization.k8s.io/v1
33+
kind: Role
34+
metadata:
35+
name: {{ include "splunk-operator.operator.fullname" . }}-ingestorcluster-editor-role
36+
rules:
37+
- apiGroups:
38+
- enterprise.splunk.com
39+
resources:
40+
- ingestorclusters
41+
verbs:
42+
- create
43+
- delete
44+
- get
45+
- list
46+
- patch
47+
- update
48+
- watch
49+
- apiGroups:
50+
- enterprise.splunk.com
51+
resources:
52+
- ingestorclusters/status
53+
verbs:
54+
- get
55+
{{- end }}

helm-chart/splunk-operator/templates/rbac/ingestorcluster_viewer_role.yaml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
# Grants read-only access to enterprise.splunk.com resources.
55
# This role is intended for users who need visibility into these resources
66
# without permissions to modify them. It is ideal for monitoring purposes and limited-access viewing.
7-
7+
{{- if .Values.splunkOperator.clusterWideAccess }}
88
apiVersion: rbac.authorization.k8s.io/v1
99
kind: ClusterRole
1010
metadata:
11-
name: ingestorcluster-viewer-role
11+
name: {{ include "splunk-operator.operator.fullname" . }}-ingestorcluster-viewer-role
1212
rules:
1313
- apiGroups:
1414
- enterprise.splunk.com
@@ -24,3 +24,24 @@ rules:
2424
- ingestorclusters/status
2525
verbs:
2626
- get
27+
{{- else }}
28+
apiVersion: rbac.authorization.k8s.io/v1
29+
kind: Role
30+
metadata:
31+
name: {{ include "splunk-operator.operator.fullname" . }}-ingestorcluster-viewer-role
32+
rules:
33+
- apiGroups:
34+
- enterprise.splunk.com
35+
resources:
36+
- ingestorclusters
37+
verbs:
38+
- get
39+
- list
40+
- watch
41+
- apiGroups:
42+
- enterprise.splunk.com
43+
resources:
44+
- ingestorclusters/status
45+
verbs:
46+
- get
47+
{{- end }}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestStep
4+
commands:
5+
- script: ../script/installoperator.sh
6+
background: false

kuttl/tests/helm/index-and-ingest-separation/01-assert.yaml

Lines changed: 17 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
apiVersion: enterprise.splunk.com/v4
44
kind: ClusterManager
55
metadata:
6-
name: cm-sep
6+
name: cm
77
status:
88
phase: Ready
99

@@ -12,7 +12,7 @@ status:
1212
apiVersion: apps/v1
1313
kind: StatefulSet
1414
metadata:
15-
name: splunk-cm-sep-cluster-manager
15+
name: splunk-cm-cluster-manager
1616
status:
1717
replicas: 1
1818

@@ -21,34 +21,16 @@ status:
2121
apiVersion: v1
2222
kind: Secret
2323
metadata:
24-
name: splunk-cm-sep-cluster-manager-secret-v1
24+
name: splunk-cm-cluster-manager-secret-v1
2525

2626
---
2727
# assert for indexer cluster custom resource to be ready
2828
apiVersion: enterprise.splunk.com/v4
2929
kind: IndexerCluster
3030
metadata:
31-
name: idxc-sep
32-
pipelineConfig:
33-
remoteQueueRuleset: false
34-
ruleSet: true
35-
remoteQueueTyping: false
36-
remoteQueueOutput: false
37-
typing: true
38-
indexerPipe: true
39-
pullBus:
40-
type: sqs_smartbus
41-
sqs:
42-
queueName: kkoziol-sqs-test
43-
authRegion: us-west-2
44-
endpoint: https://sqs.us-west-2.amazonaws.com
45-
largeMessageStoreEndpoint: https://s3.us-west-2.amazonaws.com
46-
largeMessageStorePath: s3://kkoziol-ingestion/smartbus-test-kkoziol
47-
deadLetterQueueName: kkoziol-sqs-dlq-test
48-
maxRetriesPerPart: 4
49-
retryPolicy: max_count
50-
sendInterval: 5s
51-
encodingFormat: s2s
31+
name: indexer
32+
spec:
33+
replicas: 3
5234
status:
5335
phase: Ready
5436
pipelineConfig:
@@ -57,16 +39,15 @@ status:
5739
remoteQueueTyping: false
5840
remoteQueueOutput: false
5941
typing: true
60-
indexerPipe: true
6142
pullBus:
6243
type: sqs_smartbus
6344
sqs:
64-
queueName: kkoziol-sqs-test
45+
queueName: sqs-test
6546
authRegion: us-west-2
6647
endpoint: https://sqs.us-west-2.amazonaws.com
6748
largeMessageStoreEndpoint: https://s3.us-west-2.amazonaws.com
68-
largeMessageStorePath: s3://kkoziol-ingestion/smartbus-test-kkoziol
69-
deadLetterQueueName: kkoziol-sqs-dlq-test
49+
largeMessageStorePath: s3://ingestion/smartbus-test
50+
deadLetterQueueName: sqs-dlq-test
7051
maxRetriesPerPart: 4
7152
retryPolicy: max_count
7253
sendInterval: 5s
@@ -77,7 +58,7 @@ status:
7758
apiVersion: apps/v1
7859
kind: StatefulSet
7960
metadata:
80-
name: splunk-idxc-sep-indexer
61+
name: splunk-indexer-indexer
8162
status:
8263
replicas: 3
8364

@@ -86,36 +67,16 @@ status:
8667
apiVersion: v1
8768
kind: Secret
8869
metadata:
89-
name: splunk-idxc-sep-indexer-secret-v1
70+
name: splunk-indexer-indexer-secret-v1
9071

9172
---
9273
# assert for indexer cluster custom resource to be ready
9374
apiVersion: enterprise.splunk.com/v4
9475
kind: IngestorCluster
9576
metadata:
96-
name: ingestor-sep
77+
name: ingestor
9778
spec:
9879
replicas: 3
99-
pipelineConfig:
100-
remoteQueueRuleset: false
101-
ruleSet: true
102-
remoteQueueTyping: false
103-
remoteQueueOutput: false
104-
typing: true
105-
indexerPipe: true
106-
pushBus:
107-
type: sqs_smartbus
108-
sqs:
109-
queueName: kkoziol-sqs-test
110-
authRegion: us-west-2
111-
endpoint: https://sqs.us-west-2.amazonaws.com
112-
largeMessageStoreEndpoint: https://s3.us-west-2.amazonaws.com
113-
largeMessageStorePath: s3://kkoziol-ingestion/smartbus-test-kkoziol
114-
deadLetterQueueName: kkoziol-sqs-dlq-test
115-
maxRetriesPerPart: 4
116-
retryPolicy: max_count
117-
sendInterval: 5s
118-
encodingFormat: s2s
11980
status:
12081
phase: Ready
12182
pipelineConfig:
@@ -128,12 +89,12 @@ status:
12889
pushBus:
12990
type: sqs_smartbus
13091
sqs:
131-
queueName: kkoziol-sqs-test
92+
queueName: sqs-test
13293
authRegion: us-west-2
13394
endpoint: https://sqs.us-west-2.amazonaws.com
13495
largeMessageStoreEndpoint: https://s3.us-west-2.amazonaws.com
135-
largeMessageStorePath: s3://kkoziol-ingestion/smartbus-test-kkoziol
136-
deadLetterQueueName: kkoziol-sqs-dlq-test
96+
largeMessageStorePath: s3://ingestion/smartbus-test
97+
deadLetterQueueName: sqs-dlq-test
13798
maxRetriesPerPart: 4
13899
retryPolicy: max_count
139100
sendInterval: 5s
@@ -144,7 +105,7 @@ status:
144105
apiVersion: apps/v1
145106
kind: StatefulSet
146107
metadata:
147-
name: splunk-ingestor-sep-ingestor
108+
name: splunk-ingestor-ingestor
148109
status:
149110
replicas: 3
150111

@@ -153,4 +114,4 @@ status:
153114
apiVersion: v1
154115
kind: Secret
155116
metadata:
156-
name: splunk-ingestor-sep-ingestor-secret-v1
117+
name: splunk-ingestor-ingestor-secret-v1

kuttl/tests/helm/index-and-ingest-separation/00-install-setup.yaml renamed to kuttl/tests/helm/index-and-ingest-separation/01-install-setup.yaml

File renamed without changes.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
# assert for ingestor cluster custom resource to be ready
3+
apiVersion: enterprise.splunk.com/v4
4+
kind: IngestorCluster
5+
metadata:
6+
name: ingestor
7+
spec:
8+
replicas: 4
9+
status:
10+
phase: Ready
11+
pipelineConfig:
12+
remoteQueueRuleset: false
13+
ruleSet: true
14+
remoteQueueTyping: false
15+
remoteQueueOutput: false
16+
typing: true
17+
pushBus:
18+
type: sqs_smartbus
19+
sqs:
20+
queueName: sqs-test
21+
authRegion: us-west-2
22+
endpoint: https://sqs.us-west-2.amazonaws.com
23+
largeMessageStoreEndpoint: https://s3.us-west-2.amazonaws.com
24+
largeMessageStorePath: s3://ingestion/smartbus-test
25+
deadLetterQueueName: sqs-dlq-test
26+
maxRetriesPerPart: 4
27+
retryPolicy: max_count
28+
sendInterval: 5s
29+
encodingFormat: s2s
30+
31+
---
32+
# check for stateful sets and replicas updated
33+
apiVersion: apps/v1
34+
kind: StatefulSet
35+
metadata:
36+
name: splunk-ingestor-ingestor
37+
status:
38+
replicas: 4

kuttl/tests/helm/index-and-ingest-separation/03-assert.yaml

Lines changed: 0 additions & 59 deletions
This file was deleted.

kuttl/tests/helm/index-and-ingest-separation/04-uninstall-setup.yaml renamed to kuttl/tests/helm/index-and-ingest-separation/03-uninstall-setup.yaml

File renamed without changes.

0 commit comments

Comments
 (0)