Refactor: Use helper for st2-config-vol volume/volumeMounts definitions by cognifloyd · Pull Request #198 · StackStorm/stackstorm-k8s
pull-request-size bot says that this PR is size/L because it deletes a lot of lines. In templates/deployments.yaml and templates/jobs.yaml I added two lines for every 9 lines I removed:
--- apiVersion: ... kind: ... metadata: ... spec: template: metadata: ... spec: ... containers: - name: ... ... volumeMounts: - - name: st2-config-vol - mountPath: /etc/st2/st2.docker.conf - subPath: st2.docker.conf - - name: st2-config-vol - mountPath: /etc/st2/st2.user.conf - subPath: st2.user.conf + {{- include "st2-config-volume-mounts" . | nindent 8 }} volumes: - - name: st2-config-vol - configMap: - name: {{ .Release.Name }}-st2-config + {{- include "st2-config-volume" . | nindent 8 }}
And then the template definition is just:
https://github.com/StackStorm/stackstorm-ha/blob/d330e353ab7a312cb7647c56e0bd441ee10b2509/templates/_helpers.tpl#L74-L87
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great.
cognifloyd
changed the title
Move st2-config-vol volume/volumeMounts definitions to helpers
Refactor: Use helper for st2-config-vol volume/volumeMounts definitions
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more much needed deduplication!
@armab This one is the next easiest PR to review. Please and thank you!
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters