Skip to content

Commit 9607c1e

Browse files
author
igor.grzankowski
committed
Add check for replicas
1 parent 02bb2f1 commit 9607c1e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/splunk/enterprise/standalone.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ func getStandaloneStatefulSet(ctx context.Context, client splcommon.ControllerCl
297297

298298
// validateStandaloneSpec checks validity and makes default updates to a StandaloneSpec, and returns error if something is wrong.
299299
func validateStandaloneSpec(ctx context.Context, c splcommon.ControllerClient, cr *enterpriseApi.Standalone) error {
300+
if cr.Spec.Replicas < 0 {
301+
return fmt.Errorf("replicas must be >= 0")
302+
}
300303
if cr.Spec.Replicas == 0 {
301304
cr.Spec.Replicas = 1
302305
}

0 commit comments

Comments
 (0)