patch-consoles-job.yaml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. {{- if .Values.plugin.jobs.patchConsoles.enabled }}
  2. apiVersion: batch/v1
  3. kind: Job
  4. metadata:
  5. name: {{ template "openshift-console-plugin.patcherName" . }}
  6. namespace: {{ .Release.Namespace }}
  7. labels:
  8. {{- include "openshift-console-plugin.labels" . | nindent 4 }}
  9. annotations:
  10. helm.sh/hook: post-install,post-upgrade
  11. helm.sh/hook-delete-policy: before-hook-creation
  12. spec:
  13. parallelism: 1
  14. template:
  15. metadata:
  16. labels:
  17. {{- include "openshift-console-plugin.labels" . | nindent 8 }}
  18. spec:
  19. restartPolicy: OnFailure
  20. serviceAccountName: {{ template "openshift-console-plugin.patcherServiceAccountName" . }}
  21. {{- if .Values.plugin.jobs.patchConsoles.podSecurityContext }}
  22. securityContext:
  23. {{ tpl (toYaml .Values.plugin.jobs.patchConsoles.podSecurityContext | indent 8) . }}
  24. {{- end }}
  25. terminationGracePeriodSeconds: 400
  26. dnsPolicy: ClusterFirst
  27. containers:
  28. - name: {{ template "openshift-console-plugin.patcherName" . }}
  29. image: {{ required "Patcher image must be specified!" .Values.plugin.jobs.patchConsoles.image }}
  30. {{- if .Values.plugin.jobs.patchConsoles.containerSecurityContext }}
  31. securityContext:
  32. {{ tpl (toYaml .Values.plugin.jobs.patchConsoles.containerSecurityContext | indent 8) . }}
  33. {{- end }}
  34. resources:
  35. {{- toYaml .Values.plugin.jobs.patchConsoles.resources | nindent 12 }}
  36. command:
  37. - /bin/bash
  38. - -c
  39. - |
  40. oc patch consoles.operator.openshift.io cluster --patch '{ "spec": { "plugins": ["{{ template "openshift-console-plugin.name" . }}"] } }' --type=merge
  41. {{- end }}