|
@@ -18,18 +18,16 @@ spec:
|
|
|
spec:
|
|
spec:
|
|
|
restartPolicy: OnFailure
|
|
restartPolicy: OnFailure
|
|
|
serviceAccountName: {{ template "openshift-console-plugin.patcherServiceAccountName" . }}
|
|
serviceAccountName: {{ template "openshift-console-plugin.patcherServiceAccountName" . }}
|
|
|
- {{- if .Values.plugin.jobs.patchConsoles.podSecurityContext }}
|
|
|
|
|
- securityContext:
|
|
|
|
|
- {{ tpl (toYaml .Values.plugin.jobs.patchConsoles.podSecurityContext | indent 8) . }}
|
|
|
|
|
|
|
+ {{- if and (.Values.plugin.securityContext.enabled) (.Values.plugin.jobs.patchConsoles.podSecurityContext.enabled) }}
|
|
|
|
|
+ securityContext: {{ tpl (toYaml (omit .Values.plugin.jobs.patchConsoles.podSecurityContext "enabled")) $ | nindent 8 }}
|
|
|
{{- end }}
|
|
{{- end }}
|
|
|
terminationGracePeriodSeconds: 400
|
|
terminationGracePeriodSeconds: 400
|
|
|
dnsPolicy: ClusterFirst
|
|
dnsPolicy: ClusterFirst
|
|
|
containers:
|
|
containers:
|
|
|
- name: {{ template "openshift-console-plugin.patcherName" . }}
|
|
- name: {{ template "openshift-console-plugin.patcherName" . }}
|
|
|
image: {{ required "Patcher image must be specified!" .Values.plugin.jobs.patchConsoles.image }}
|
|
image: {{ required "Patcher image must be specified!" .Values.plugin.jobs.patchConsoles.image }}
|
|
|
- {{- if .Values.plugin.jobs.patchConsoles.containerSecurityContext }}
|
|
|
|
|
- securityContext:
|
|
|
|
|
- {{ tpl (toYaml .Values.plugin.jobs.patchConsoles.containerSecurityContext | indent 8) . }}
|
|
|
|
|
|
|
+ {{- if and (.Values.plugin.disableSecurityContext) (.Values.plugin.jobs.patchConsoles.containerSecurityContext.enabled) }}
|
|
|
|
|
+ securityContext: {{ tpl (toYaml (omit .Values.plugin.jobs.patchConsoles.containerSecurityContext "enabled")) $ | nindent 12 }}
|
|
|
{{- end }}
|
|
{{- end }}
|
|
|
resources:
|
|
resources:
|
|
|
{{- toYaml .Values.plugin.jobs.patchConsoles.resources | nindent 12 }}
|
|
{{- toYaml .Values.plugin.jobs.patchConsoles.resources | nindent 12 }}
|
|
@@ -37,5 +35,8 @@ spec:
|
|
|
- /bin/bash
|
|
- /bin/bash
|
|
|
- -c
|
|
- -c
|
|
|
- |
|
|
- |
|
|
|
- oc patch consoles.operator.openshift.io cluster --patch '{ "spec": { "plugins": ["{{ template "openshift-console-plugin.name" . }}"] } }' --type=merge
|
|
|
|
|
|
|
+ existingPlugins=$(oc get consoles.operator.openshift.io cluster -o json | jq -c '.spec.plugins // []')
|
|
|
|
|
+ mergedPlugins=$(jq --argjson existingPlugins "${existingPlugins}" --argjson consolePlugin '["{{ template "openshift-console-plugin.name" . }}"]' -c -n '$existingPlugins + $consolePlugin | unique')
|
|
|
|
|
+ patchedPlugins=$(jq --argjson mergedPlugins $mergedPlugins -n -c '{ "spec": { "plugins": $mergedPlugins } }')
|
|
|
|
|
+ oc patch consoles.operator.openshift.io cluster --patch $patchedPlugins --type=merge
|
|
|
{{- end }}
|
|
{{- end }}
|