Skip to content

Commit baabd74

Browse files
feat(gitops-operator): add debug flag (#883)
* feat(gitops-operator): add debug flag * feat(gitops-operator): add debug flag * feat(gitops-operator): add debug flag * feat(gitops-operator): add debug flag * feat(gitops-operator): add debug flag * feat(gitops-operator): add debug flag * feat(gitops-operator): add debug flag * feat(gitops-operator): add debug flag * exclude probes in debug mode --------- Co-authored-by: scme0 <scott.merchant@octopus.com>
1 parent c397178 commit baabd74

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

charts/gitops-runtime/templates/_components/gitops-operator/_default_values.tpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ extraVolumes: []
8787
extraVolumeMounts: []
8888
affinity: {}
8989

90+
debug:
91+
enabled: false
92+
image:
93+
registry: registry.k8s.io
94+
repository: pause
95+
tag: 3.10
96+
9097
resources:
9198
limits: {}
9299
requests:

charts/gitops-runtime/templates/_components/gitops-operator/_deployment.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,28 @@ spec:
3333
{{- end }}
3434
serviceAccountName: {{ include "gitops-operator.serviceAccountName" . }}
3535
securityContext:
36+
{{- if .Values.debug.enabled }}
37+
runAsNonRoot: false
38+
{{- else }}
3639
{{- toYaml .Values.podSecurityContext | nindent 8 }}
40+
{{- end }}
3741
containers:
38-
- name: manager
42+
- name: {{ ternary "debug" "manager" .Values.debug.enabled }}
3943
securityContext:
4044
{{- toYaml .Values.securityContext | nindent 12 }}
4145
{{- $imageContext := deepCopy .Values.image }}
4246
{{- if not (get $imageContext "tag") }}
4347
{{- $_ := set $imageContext "tag" .Chart.AppVersion }}
4448
{{- end }}
49+
{{- if .Values.debug.enabled }}
50+
{{- $imageContext = deepCopy .Values.debug.image }}
51+
{{- end }}
4552
image: {{ include "codefresh-gitops-runtime.image.name" (dict "image" $imageContext "context" .) }}
4653
env: {{- include "codefresh-gitops-runtime.env-vars" (dict "Values" $mergedValues "context" .) | nindent 8 }}
4754
imagePullPolicy: {{ .Values.image.pullPolicy }}
48-
{{- if .Values.command }}
49-
command:
50-
{{- .Values.command | toYaml | nindent 8 }}
51-
{{- else }}
55+
{{- with .Values.command }}
5256
command:
53-
- /manager
57+
{{- . | toYaml | nindent 8 }}
5458
{{- end }}
5559
{{- with .Values.extraArgs }}
5660
args:
@@ -61,6 +65,7 @@ spec:
6165
containerPort: 8080
6266
- name: http-health
6367
containerPort: 8081
68+
{{- if not .Values.debug.enabled }}
6469
readinessProbe:
6570
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
6671
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
@@ -79,6 +84,7 @@ spec:
7984
httpGet:
8085
port: http-health
8186
path: /healthz
87+
{{- end }}
8288
resources:
8389
{{- toYaml .Values.resources | nindent 12 }}
8490
volumeMounts:

0 commit comments

Comments
 (0)