File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 3535 {{- $_ := set $gitopsOperatorContext.Values.global.codefresh.tls.caCerts.secretKeyRef "key" (.Values.global.codefresh.tls.caCerts.secret.create | ternary (default "ca-bundle.crt" .Values.global.codefresh.tls.caCerts.secret.key) .Values.global.codefresh.tls.caCerts.secretKeyRef.key) }}
3636 {{- end }}
3737
38+ {{- if and (gt (int $gitopsOperatorContext.Values.replicaCount) 1 ) }}
39+ {{- $_ := set $gitopsOperatorContext.Values.env "LEADER_ELECT" "true" }}
40+ {{- else }}
41+ {{- $_ := set $gitopsOperatorContext.Values.env "LEADER_ELECT" "false" }}
42+ {{- end }}
43+
3844 {{- include "gitops-operator.resources" $gitopsOperatorContext}}
3945
4046{{- end }}
Original file line number Diff line number Diff line change 1+ suite : Test GitOps Operator
2+ templates :
3+ - gitops-operator.yaml
4+ - charts/gitops-operator/*
5+ tests :
6+ - it : should have LEADER_ELECT set to true if replicaCount is greater than 1
7+ values :
8+ - ./values/mandatory-values.yaml
9+ template : gitops-operator.yaml
10+ documentSelector :
11+ path : kind
12+ value : Deployment
13+ set :
14+ gitops-operator.replicaCount : 2
15+ asserts :
16+ - contains :
17+ path : spec.template.spec.containers[1].env
18+ content :
19+ name : LEADER_ELECT
20+ value : " true"
21+
22+ - it : should have LEADER_ELECT set to false if replicaCount is 1
23+ values :
24+ - ./values/mandatory-values.yaml
25+ template : gitops-operator.yaml
26+ documentSelector :
27+ path : kind
28+ value : Deployment
29+ set :
30+ gitops-operator.replicaCount : 1
31+ asserts :
32+ - contains :
33+ path : spec.template.spec.containers[1].env
34+ content :
35+ name : LEADER_ELECT
36+ value : " false"
You can’t perform that action at this time.
0 commit comments