Skip to content

Commit c3b3aa6

Browse files
committed
CSPL-3972 Addressing TODOs
1 parent 84d8491 commit c3b3aa6

File tree

9 files changed

+220
-35
lines changed

9 files changed

+220
-35
lines changed

api/v4/ingestorcluster_types.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ type IngestorClusterSpec struct {
5252
// Helper types
5353
// Only SQS as of now
5454
type PushBusSpec struct {
55+
// +kubebuilder:validation:Enum=sqs_smartbus
56+
// +kubebuilder:default=sqs_smartbus
5557
Type string `json:"type"`
5658

5759
SQS SQSSpec `json:"sqs"`
@@ -62,32 +64,47 @@ type SQSSpec struct {
6264

6365
AuthRegion string `json:"authRegion"`
6466

67+
// +kubebuilder:validation:Pattern=`^https://`
6568
Endpoint string `json:"endpoint"`
6669

70+
// +kubebuilder:validation:Pattern=`^https://`
6771
LargeMessageStoreEndpoint string `json:"largeMessageStoreEndpoint"`
6872

73+
// +kubebuilder:validation:Pattern=`^s3://`
6974
LargeMessageStorePath string `json:"largeMessageStorePath"`
7075

7176
DeadLetterQueueName string `json:"deadLetterQueueName"`
7277

78+
// +kubebuilder:validation:Minimum=0
79+
// +kubebuilder:default=3
7380
MaxRetriesPerPart int `json:"maxRetriesPerPart"`
7481

82+
// +kubebuilder:validation:Enum=max_count
83+
// +kubebuilder:default=max_count
7584
RetryPolicy string `json:"retryPolicy"`
7685

86+
// +kubebuilder:validation:Pattern=`^[0-9]+s$`
87+
// +kubebuilder:default="5s"
7788
SendInterval string `json:"sendInterval"`
7889
}
7990

8091
type PipelineConfigSpec struct {
92+
// +kubebuilder:default=false
8193
RemoteQueueRuleset bool `json:"remoteQueueRuleset"`
8294

95+
// +kubebuilder:default=true
8396
RuleSet bool `json:"ruleSet"`
8497

98+
// +kubebuilder:default=false
8599
RemoteQueueTyping bool `json:"remoteQueueTyping"`
86100

101+
// +kubebuilder:default=false
87102
RemoteQueueOutput bool `json:"remoteQueueOutput"`
88103

104+
// +kubebuilder:default=true
89105
Typing bool `json:"typing"`
90106

107+
// +kubebuilder:default=true
91108
IndexerPipe bool `json:"indexerPipe,omitempty"`
92109
}
93110

@@ -116,6 +133,12 @@ type IngestorClusterStatus struct {
116133

117134
// Auxillary message describing CR status
118135
Message string `json:"message"`
136+
137+
// Pipeline configuration status
138+
PipelineConfig PipelineConfigSpec `json:"pipelineConfig"`
139+
140+
// Push Bus status
141+
PushBus PushBusSpec `json:"pushBus"`
119142
}
120143

121144
// +kubebuilder:object:root=true

api/v4/zz_generated.deepcopy.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/enterprise.splunk.com_indexerclusters.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5607,16 +5607,22 @@ spec:
56075607
pipelineConfig:
56085608
properties:
56095609
indexerPipe:
5610+
default: true
56105611
type: boolean
56115612
remoteQueueOutput:
5613+
default: false
56125614
type: boolean
56135615
remoteQueueRuleset:
5616+
default: false
56145617
type: boolean
56155618
remoteQueueTyping:
5619+
default: false
56165620
type: boolean
56175621
ruleSet:
5622+
default: true
56185623
type: boolean
56195624
typing:
5625+
default: true
56205626
type: boolean
56215627
type: object
56225628
pullBus:
@@ -5631,21 +5637,34 @@ spec:
56315637
deadLetterQueueName:
56325638
type: string
56335639
endpoint:
5640+
pattern: ^https://
56345641
type: string
56355642
largeMessageStoreEndpoint:
5643+
pattern: ^https://
56365644
type: string
56375645
largeMessageStorePath:
5646+
pattern: ^s3://
56385647
type: string
56395648
maxRetriesPerPart:
5649+
default: 3
5650+
minimum: 0
56405651
type: integer
56415652
queueName:
56425653
type: string
56435654
retryPolicy:
5655+
default: max_count
5656+
enum:
5657+
- max_count
56445658
type: string
56455659
sendInterval:
5660+
default: 5s
5661+
pattern: ^[0-9]+s$
56465662
type: string
56475663
type: object
56485664
type:
5665+
default: sqs_smartbus
5666+
enum:
5667+
- sqs_smartbus
56495668
type: string
56505669
type: object
56515670
readinessInitialDelaySeconds:

config/crd/bases/enterprise.splunk.com_ingestorclusters.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,16 +1584,22 @@ spec:
15841584
description: Pipeline configuration
15851585
properties:
15861586
indexerPipe:
1587+
default: true
15871588
type: boolean
15881589
remoteQueueOutput:
1590+
default: false
15891591
type: boolean
15901592
remoteQueueRuleset:
1593+
default: false
15911594
type: boolean
15921595
remoteQueueTyping:
1596+
default: false
15931597
type: boolean
15941598
ruleSet:
1599+
default: true
15951600
type: boolean
15961601
typing:
1602+
default: true
15971603
type: boolean
15981604
type: object
15991605
pushBus:
@@ -1606,21 +1612,34 @@ spec:
16061612
deadLetterQueueName:
16071613
type: string
16081614
endpoint:
1615+
pattern: ^https://
16091616
type: string
16101617
largeMessageStoreEndpoint:
1618+
pattern: ^https://
16111619
type: string
16121620
largeMessageStorePath:
1621+
pattern: ^s3://
16131622
type: string
16141623
maxRetriesPerPart:
1624+
default: 3
1625+
minimum: 0
16151626
type: integer
16161627
queueName:
16171628
type: string
16181629
retryPolicy:
1630+
default: max_count
1631+
enum:
1632+
- max_count
16191633
type: string
16201634
sendInterval:
1635+
default: 5s
1636+
pattern: ^[0-9]+s$
16211637
type: string
16221638
type: object
16231639
type:
1640+
default: sqs_smartbus
1641+
enum:
1642+
- sqs_smartbus
16241643
type: string
16251644
type: object
16261645
readinessInitialDelaySeconds:
@@ -4559,6 +4578,68 @@ spec:
45594578
- Terminating
45604579
- Error
45614580
type: string
4581+
pipelineConfig:
4582+
description: Pipeline configuration status
4583+
properties:
4584+
indexerPipe:
4585+
default: true
4586+
type: boolean
4587+
remoteQueueOutput:
4588+
default: false
4589+
type: boolean
4590+
remoteQueueRuleset:
4591+
default: false
4592+
type: boolean
4593+
remoteQueueTyping:
4594+
default: false
4595+
type: boolean
4596+
ruleSet:
4597+
default: true
4598+
type: boolean
4599+
typing:
4600+
default: true
4601+
type: boolean
4602+
type: object
4603+
pushBus:
4604+
description: Push Bus status
4605+
properties:
4606+
sqs:
4607+
properties:
4608+
authRegion:
4609+
type: string
4610+
deadLetterQueueName:
4611+
type: string
4612+
endpoint:
4613+
pattern: ^https://
4614+
type: string
4615+
largeMessageStoreEndpoint:
4616+
pattern: ^https://
4617+
type: string
4618+
largeMessageStorePath:
4619+
pattern: ^s3://
4620+
type: string
4621+
maxRetriesPerPart:
4622+
default: 3
4623+
minimum: 0
4624+
type: integer
4625+
queueName:
4626+
type: string
4627+
retryPolicy:
4628+
default: max_count
4629+
enum:
4630+
- max_count
4631+
type: string
4632+
sendInterval:
4633+
default: 5s
4634+
pattern: ^[0-9]+s$
4635+
type: string
4636+
type: object
4637+
type:
4638+
default: sqs_smartbus
4639+
enum:
4640+
- sqs_smartbus
4641+
type: string
4642+
type: object
45624643
readyReplicas:
45634644
description: Number of ready ingestor pods
45644645
format: int32

config/samples/enterprise_v4_ingestorcluster.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@ apiVersion: enterprise.splunk.com/v4
22
kind: IngestorCluster
33
metadata:
44
name: ingestorcluster-sample
5-
spec:
6-
# TODO(user): Add fields here
5+
finalizers:
6+
- "enterprise.splunk.com/delete-pvc"
7+
spec: {}
8+
# TODO(user): Add fields here

pkg/splunk/enterprise/indexercluster.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ func ApplyIndexerClusterManager(ctx context.Context, client splcommon.Controller
241241

242242
// no need to requeue if everything is ready
243243
if cr.Status.Phase == enterpriseApi.PhaseReady {
244-
// TODO: Make it work when HPA scales replicas - all new pods should get the configuration
245244
if cr.Spec.PullBus.Type != "" {
246245
err = mgr.handlePullBusOrPipelineConfigChange(ctx, cr, client)
247246
if err != nil {
@@ -506,8 +505,6 @@ func ApplyIndexerCluster(ctx context.Context, client splcommon.ControllerClient,
506505

507506
// no need to requeue if everything is ready
508507
if cr.Status.Phase == enterpriseApi.PhaseReady {
509-
// TODO: Make it work when HPA scales replicas - all new pods should get the configuration
510-
// If values for PullBus and PipelineConfig are provided, update config files accordingly
511508
if cr.Spec.PullBus.Type != "" {
512509
err = mgr.handlePullBusOrPipelineConfigChange(ctx, cr, client)
513510
if err != nil {

0 commit comments

Comments
 (0)