feat(common): Release 2.0.0-beta.2 (#176)

This commit is contained in:
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 2023-09-14 15:40:49 +02:00 committed by GitHub
parent ed407c00df
commit 9928235b84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
80 changed files with 1306 additions and 161 deletions

View file

@ -19,7 +19,7 @@ runtimeClassName: {{ . | trim }}
schedulerName: {{ . | trim }}
{{- end -}}
{{- with ($controllerObject.pod.securityContext) }}
securityContext: {{ . | trim | nindent 2 }}
securityContext: {{ . | toYaml | nindent 2 }}
{{- end -}}
{{- with ($controllerObject.pod.hostname) }}
hostname: {{ . | trim }}
@ -29,13 +29,13 @@ hostNetwork: {{ $controllerObject.pod.hostNetwork }}
hostPID: {{ $controllerObject.pod.hostPID }}
dnsPolicy: {{ include "bjw-s.common.lib.pod.field.dnsPolicy" (dict "ctx" $ctx) | trim }}
{{- with $controllerObject.pod.dnsConfig }}
dnsConfig: {{ . | trim | nindent 2 }}
dnsConfig: {{ . | toYaml | nindent 2 }}
{{- end -}}
{{- with $controllerObject.pod.hostAliases }}
hostAliases: {{ . | trim | nindent 2 }}
hostAliases: {{ . | toYaml | nindent 2 }}
{{- end -}}
{{- with $controllerObject.pod.imagePullSecrets }}
imagePullSecrets: {{ . | trim | nindent 2 }}
imagePullSecrets: {{ . | toYaml | nindent 2 }}
{{- end -}}
{{- with $controllerObject.pod.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ . | trim }}
@ -44,16 +44,16 @@ terminationGracePeriodSeconds: {{ . | trim }}
restartPolicy: {{ . | trim }}
{{- end -}}
{{- with $controllerObject.pod.nodeSelector }}
nodeSelector: {{ . | trim | nindent 2 }}
nodeSelector: {{ . | toYaml | nindent 2 }}
{{- end -}}
{{- with $controllerObject.pod.affinity }}
affinity: {{ . | trim | nindent 2 }}
affinity: {{ . | toYaml | nindent 2 }}
{{- end -}}
{{- with $controllerObject.pod.topologySpreadConstraints }}
topologySpreadConstraints: {{ . | trim | nindent 2 }}
topologySpreadConstraints: {{ . | toYaml | nindent 2 }}
{{- end -}}
{{- with $controllerObject.pod.tolerations }}
tolerations: {{ . | trim | nindent 2 }}
tolerations: {{ . | toYaml | nindent 2 }}
{{- end }}
{{- with (include "bjw-s.common.lib.pod.field.initContainers" (dict "ctx" $ctx) | trim) }}
initContainers: {{ . | nindent 2 }}

View file

@ -6,6 +6,7 @@ Returns the value for containers
{{- $controllerObject := .ctx.controllerObject -}}
{{- /* Default to empty list */ -}}
{{- $orderedContainers := dict -}}
{{- $containers := list -}}
{{- /* Fetch configured containers for this controller */ -}}
@ -19,7 +20,13 @@ Returns the value for containers
{{- /* Generate the Container spec */ -}}
{{- $renderedContainer := include "bjw-s.common.lib.container.spec" (dict "rootContext" $rootContext "controllerObject" $controllerObject "containerObject" $containerObject) | fromYaml -}}
{{- $containers = append $containers $renderedContainer -}}
{{- $containerOrder := (dig "order" 99 $containerValues) -}}
{{- $_ := set $orderedContainers (printf "%v-%s" $containerOrder $key) $renderedContainer -}}
{{- end -}}
{{- range $key, $containerValues := $orderedContainers -}}
{{- $containers = append $containers $containerValues -}}
{{- end -}}
{{- if not (empty $containers) -}}

View file

@ -6,19 +6,34 @@ Returns the value for initContainers
{{- $controllerObject := .ctx.controllerObject -}}
{{- /* Default to empty list */ -}}
{{- $orderedContainers := dict -}}
{{- $containers := list -}}
{{- /* Fetch configured containers for this controller */ -}}
{{- range $key, $containerValues := $controllerObject.initContainers -}}
{{- /* Create object from the container values */ -}}
{{- $containerObject := (include "bjw-s.common.lib.container.valuesToObject" (dict "rootContext" $ "id" $key "values" $containerValues)) | fromYaml -}}
{{- /* Enable container by default, but allow override */ -}}
{{- $containerEnabled := true -}}
{{- if hasKey $containerValues "enabled" -}}
{{- $containerEnabled = $containerValues.enabled -}}
{{- end -}}
{{- /* Perform validations on the Container before rendering */ -}}
{{- include "bjw-s.common.lib.container.validate" (dict "rootContext" $ "object" $containerObject) -}}
{{- if $containerEnabled -}}
{{- /* Create object from the container values */ -}}
{{- $containerObject := (include "bjw-s.common.lib.container.valuesToObject" (dict "rootContext" $ "id" $key "values" $containerValues)) | fromYaml -}}
{{- /* Generate the Container spec */ -}}
{{- $renderedContainer := include "bjw-s.common.lib.container.spec" (dict "rootContext" $rootContext "containerObject" $containerObject) | fromYaml -}}
{{- $containers = append $containers $renderedContainer -}}
{{- /* Perform validations on the Container before rendering */ -}}
{{- include "bjw-s.common.lib.container.validate" (dict "rootContext" $ "object" $containerObject) -}}
{{- /* Generate the Container spec */ -}}
{{- $renderedContainer := include "bjw-s.common.lib.container.spec" (dict "rootContext" $rootContext "containerObject" $containerObject) | fromYaml -}}
{{- $containerOrder := (dig "order" 99 $containerValues) -}}
{{- $_ := set $orderedContainers (printf "%v-%s" $containerOrder $key) $renderedContainer -}}
{{- end -}}
{{- end -}}
{{- range $key, $containerValues := $orderedContainers -}}
{{- $containers = append $containers $containerValues -}}
{{- end -}}
{{- if not (empty $containers) -}}