MonkeyCanCode commented on code in PR #626:
URL: https://github.com/apache/polaris/pull/626#discussion_r1938610656
##########
helm/polaris/templates/job.yaml:
##########
@@ -43,71 +43,89 @@ spec:
{{- tpl (toYaml .Values.podLabels) . | nindent 8 }}
{{- end }}
spec:
- {{- if and .Values.persistenceConfigSecret (index
.Values.polarisServerConfig.metaStoreManager "conf-file") }}
- initContainers:
- - name: init-config
- image: "{{ tpl .Values.toolsImage.repository . }}:{{ tpl
.Values.toolsImage.tag . }}"
- imagePullPolicy: {{ tpl .Values.toolsImage.pullPolicy . }}
- command: ["jar"]
- args: ["-cf", "/eclipselink-config/conf.jar", "-C", "/secret",
"persistence.xml"]
- {{- if .Values.securityContext}}
- securityContext:
- {{- tpl (toYaml .Values.securityContext) . | nindent 12 }}
- {{- end }}
- volumeMounts:
- - name: eclipselink-config-volume
- mountPath: /eclipselink-config
- - name: secret-volume
- mountPath: /secret
- {{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{- range .Values.imagePullSecrets }}
- name: {{ . | quote }}
{{- end }}
{{- end }}
serviceAccountName: {{ include "polaris.serviceAccountName" . }}
- {{- if .Values.podSecurityContext}}
+ {{- if .Values.podSecurityContext }}
securityContext:
{{- tpl (toYaml .Values.podSecurityContext) . | nindent 8 }}
{{- end }}
- containers:
- - name: {{ .Chart.Name }}
- {{- if .Values.securityContext}}
+ {{- if .Values.bootstrap.purge }}
+ initContainers:
+ - name: "polaris-purge"
+ {{- if .Values.containerSecurityContext }}
securityContext:
- {{- tpl (toYaml .Values.securityContext) . | nindent 12 }}
+ {{- tpl (toYaml .Values.containerSecurityContext) . | nindent 12 }}
{{- end }}
- image: "{{ tpl .Values.image.repository . }}:{{ tpl
.Values.image.tag . | default .Chart.Version }}"
- imagePullPolicy: {{ tpl .Values.image.pullPolicy . }}
- command: ["/app/bin/polaris-service"]
- args: ["bootstrap", "/app/config/polaris-server.yml"]
- {{- if .Values.bootstrapExtraEnv }}
+ image: "{{ tpl .Values.bootstrap.image.repository . }}:{{ tpl
.Values.bootstrap.image.tag . | default .Chart.Version }}"
+ imagePullPolicy: {{ tpl .Values.bootstrap.image.pullPolicy . }}
+ args:
+ - "purge"
+ {{- range $realm := .Values.bootstrap.realms }}
+ - --realm={{ tpl $realm $ }}
+ {{- end }}
env:
- {{- tpl (toYaml .Values.bootstrapExtraEnv) . | nindent 12 }}
- {{- end }}
+ {{- if .Values.bootstrap.extraEnv }}
+ {{- tpl (toYaml .Values.bootstrap.extraEnv) . | nindent 12 }}
+ {{- end }}
+ - name: "quarkus.log.file.enable"
+ value: "false"
volumeMounts:
- name: config-volume
- mountPath: /app/config/polaris-server.yml
- subPath: polaris-server.yml
- {{- if and .Values.persistenceConfigSecret (index
.Values.polarisServerConfig.metaStoreManager "conf-file") }}
- - name: eclipselink-config-volume
- mountPath: /eclipselink-config
+ mountPath: {{ trimSuffix "/" .Values.bootstrap.image.configDir }}
+ readOnly: true
+ - name: temp-dir
+ mountPath: /tmp
+ readOnly: false
+ {{- if .Values.resources }}
+ resources:
+ {{- tpl (toYaml .Values.resources) . | nindent 12 }}
+ {{- end }}
+ {{- end }}
+ containers:
+ - name: "polaris-bootstrap"
Review Comment:
Yes, I think that is fine too. May be better drop the support now before the
first release as oppose to later. I added bootstrap earlier as part of helm as
there was no different tool available for this and we had to packaged the
service config as part of the service binary (thinking about having different
binary for diff environments and bootstrap those manually will be really
tedious). Now as we have a dedicated tool for it, I also think it is a good
idea to drop this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]