cozystack/packages/system/backup-controller/templates/deployment.yaml
Timofei Larkin 6b8c490b1d [backups] Fix malformed glob and split in template
## What this PR does

A malformed glob ("*" instead of "*.yaml") captured the .gitattributes
file and sent it to the templating engine. Using `split` instead of
`splitList` on a string returned a map instead of a list, so templating
broke on `mustLast`. This patch corrects the errors.

### Release note

```release-note
[backups] Fix template-breaking errors in the backup-controller Helm
chart.
```

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2025-12-10 11:55:37 +03:00

57 lines
1.6 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: backup-controller
labels:
app: backup-controller
spec:
replicas: {{ .Values.backupController.replicas }}
selector:
matchLabels:
app: backup-controller
template:
metadata:
labels:
app: backup-controller
spec:
tolerations:
- key: "node-role.kubernetes.io/control-plane"
operator: "Exists"
effect: "NoSchedule"
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoSchedule"
serviceAccountName: backup-controller
containers:
- name: backup-controller
image: "{{ .Values.backupController.image }}"
args:
- --leader-elect
{{- if .Values.backupController.metrics.enable }}
- --metrics-bind-address={{ .Values.backupController.metrics.bindAddress }}
{{- end }}
{{- if .Values.backupController.debug }}
- --zap-log-level=debug
{{- else }}
- --zap-log-level=info
{{- end }}
ports:
- name: metrics
containerPort: {{ splitList ":" .Values.backupController.metrics.bindAddress | mustLast }}
- name: health
containerPort: 8081
readinessProbe:
httpGet:
path: /readyz
port: health
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /healthz
port: health
initialDelaySeconds: 15
periodSeconds: 20
{{- with .Values.backupController.resources }}
resources: {{- . | toYaml | nindent 10 }}
{{- end }}