Skip to content

Commit 2af9061

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

10 files changed

+237
-39
lines changed

api/v4/ingestorcluster_types.go

Lines changed: 27 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,51 @@ 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"`
89+
90+
// +kubebuilder:validation:Enum=s2s
91+
// +kubebuilder:default=s2s
92+
EncodingFormat string `json:"encodingFormat"`
7893
}
7994

8095
type PipelineConfigSpec struct {
96+
// +kubebuilder:default=false
8197
RemoteQueueRuleset bool `json:"remoteQueueRuleset"`
8298

99+
// +kubebuilder:default=true
83100
RuleSet bool `json:"ruleSet"`
84101

102+
// +kubebuilder:default=false
85103
RemoteQueueTyping bool `json:"remoteQueueTyping"`
86104

105+
// +kubebuilder:default=false
87106
RemoteQueueOutput bool `json:"remoteQueueOutput"`
88107

108+
// +kubebuilder:default=true
89109
Typing bool `json:"typing"`
90110

111+
// +kubebuilder:default=true
91112
IndexerPipe bool `json:"indexerPipe,omitempty"`
92113
}
93114

@@ -116,6 +137,12 @@ type IngestorClusterStatus struct {
116137

117138
// Auxillary message describing CR status
118139
Message string `json:"message"`
140+
141+
// Pipeline configuration status
142+
PipelineConfig PipelineConfigSpec `json:"pipelineConfig"`
143+
144+
// Push Bus status
145+
PushBus PushBusSpec `json:"pushBus"`
119146
}
120147

121148
// +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: 24 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:
@@ -5630,22 +5636,40 @@ spec:
56305636
type: string
56315637
deadLetterQueueName:
56325638
type: string
5639+
encodingFormat:
5640+
default: s2s
5641+
enum:
5642+
- s2s
5643+
type: string
56335644
endpoint:
5645+
pattern: ^https://
56345646
type: string
56355647
largeMessageStoreEndpoint:
5648+
pattern: ^https://
56365649
type: string
56375650
largeMessageStorePath:
5651+
pattern: ^s3://
56385652
type: string
56395653
maxRetriesPerPart:
5654+
default: 3
5655+
minimum: 0
56405656
type: integer
56415657
queueName:
56425658
type: string
56435659
retryPolicy:
5660+
default: max_count
5661+
enum:
5662+
- max_count
56445663
type: string
56455664
sendInterval:
5665+
default: 5s
5666+
pattern: ^[0-9]+s$
56465667
type: string
56475668
type: object
56485669
type:
5670+
default: sqs_smartbus
5671+
enum:
5672+
- sqs_smartbus
56495673
type: string
56505674
type: object
56515675
readinessInitialDelaySeconds:

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

Lines changed: 91 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:
@@ -1605,22 +1611,40 @@ spec:
16051611
type: string
16061612
deadLetterQueueName:
16071613
type: string
1614+
encodingFormat:
1615+
default: s2s
1616+
enum:
1617+
- s2s
1618+
type: string
16081619
endpoint:
1620+
pattern: ^https://
16091621
type: string
16101622
largeMessageStoreEndpoint:
1623+
pattern: ^https://
16111624
type: string
16121625
largeMessageStorePath:
1626+
pattern: ^s3://
16131627
type: string
16141628
maxRetriesPerPart:
1629+
default: 3
1630+
minimum: 0
16151631
type: integer
16161632
queueName:
16171633
type: string
16181634
retryPolicy:
1635+
default: max_count
1636+
enum:
1637+
- max_count
16191638
type: string
16201639
sendInterval:
1640+
default: 5s
1641+
pattern: ^[0-9]+s$
16211642
type: string
16221643
type: object
16231644
type:
1645+
default: sqs_smartbus
1646+
enum:
1647+
- sqs_smartbus
16241648
type: string
16251649
type: object
16261650
readinessInitialDelaySeconds:
@@ -4559,6 +4583,73 @@ spec:
45594583
- Terminating
45604584
- Error
45614585
type: string
4586+
pipelineConfig:
4587+
description: Pipeline configuration status
4588+
properties:
4589+
indexerPipe:
4590+
default: true
4591+
type: boolean
4592+
remoteQueueOutput:
4593+
default: false
4594+
type: boolean
4595+
remoteQueueRuleset:
4596+
default: false
4597+
type: boolean
4598+
remoteQueueTyping:
4599+
default: false
4600+
type: boolean
4601+
ruleSet:
4602+
default: true
4603+
type: boolean
4604+
typing:
4605+
default: true
4606+
type: boolean
4607+
type: object
4608+
pushBus:
4609+
description: Push Bus status
4610+
properties:
4611+
sqs:
4612+
properties:
4613+
authRegion:
4614+
type: string
4615+
deadLetterQueueName:
4616+
type: string
4617+
encodingFormat:
4618+
default: s2s
4619+
enum:
4620+
- s2s
4621+
type: string
4622+
endpoint:
4623+
pattern: ^https://
4624+
type: string
4625+
largeMessageStoreEndpoint:
4626+
pattern: ^https://
4627+
type: string
4628+
largeMessageStorePath:
4629+
pattern: ^s3://
4630+
type: string
4631+
maxRetriesPerPart:
4632+
default: 3
4633+
minimum: 0
4634+
type: integer
4635+
queueName:
4636+
type: string
4637+
retryPolicy:
4638+
default: max_count
4639+
enum:
4640+
- max_count
4641+
type: string
4642+
sendInterval:
4643+
default: 5s
4644+
pattern: ^[0-9]+s$
4645+
type: string
4646+
type: object
4647+
type:
4648+
default: sqs_smartbus
4649+
enum:
4650+
- sqs_smartbus
4651+
type: string
4652+
type: object
45624653
readyReplicas:
45634654
description: Number of ready ingestor pods
45644655
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)