Skip to content

Commit 42331a4

Browse files
feat(gitops-operator): add debug flag
1 parent 9beab32 commit 42331a4

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,22 @@ securityContext:
7979
capabilities:
8080
drop:
8181
- "ALL"
82-
command: []
82+
command:
83+
- /manager
8384
extraArgs: []
8485
nodeSelector: {}
8586
tolerations: []
8687
extraVolumes: []
8788
extraVolumeMounts: []
8889
affinity: {}
8990

91+
debug:
92+
enabled: true
93+
image:
94+
registry: registry.k8s.io
95+
repository: pause
96+
tag: 3.10
97+
9098
resources:
9199
limits: {}
92100
requests:

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@ 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:
42+
{{- if not .Values.debug.enabled }}
3843
- name: manager
3944
securityContext:
4045
{{- toYaml .Values.securityContext | nindent 12 }}
@@ -45,12 +50,9 @@ spec:
4550
image: {{ include "codefresh-gitops-runtime.image.name" (dict "image" $imageContext "context" .) }}
4651
env: {{- include "codefresh-gitops-runtime.env-vars" (dict "Values" $mergedValues "context" .) | nindent 8 }}
4752
imagePullPolicy: {{ .Values.image.pullPolicy }}
48-
{{- if .Values.command }}
4953
command:
54+
{{- if .Values.command }}
5055
{{- .Values.command | toYaml | nindent 8 }}
51-
{{- else }}
52-
command:
53-
- /manager
5456
{{- end }}
5557
{{- with .Values.extraArgs }}
5658
args:
@@ -89,6 +91,12 @@ spec:
8991
{{- with .Values.extraVolumeMounts }}
9092
{{- toYaml . | nindent 8 }}
9193
{{- end }}
94+
{{- end }}
95+
{{- if .Values.debug.enabled }}
96+
- name: debug
97+
{{- $imageContext := deepCopy .Values.debug.image }}
98+
image: {{ include "codefresh-gitops-runtime.image.name" (dict "image" $imageContext "context" .) }}
99+
{{- end }}
92100
{{- with .Values.nodeSelector | default .Values.global.nodeSelector }}
93101
nodeSelector: {{ toYaml . | nindent 8 }}
94102
{{- end }}

0 commit comments

Comments
 (0)