fix an edge case

This commit is contained in:
Stavros kois
2023-02-13 19:18:35 +02:00
parent 56b151a140
commit 37d8562795
4 changed files with 37 additions and 33 deletions
@@ -12,8 +12,8 @@ service:
workload:
main:
type: StatefulSet
pod:
type: DaemonSet
podSpec:
containers:
main:
args:
@@ -21,8 +21,7 @@
{{- $hasEnabled = true -}}
{{/* And workload is primary */}}
{{- if and (hasKey $workload "primary") ($workload.primary) -}}
{{- if $workload.primary -}}
{{/* Fail if there is already a primary workload */}}
{{- if $hasPrimary -}}
{{- fail "Workload - Only one workload can be primary" -}}
@@ -35,9 +34,9 @@
{{- end -}}
{{/* Require at least one primary workload, if any enabled */}}
{{/* Require at one primary workload, if any enabled */}}
{{- if and $hasEnabled (not $hasPrimary) -}}
{{- fail "Workload - At least one enabled workload must be primary" -}}
{{- fail "Workload - One enabled workload must be primary" -}}
{{- end -}}
{{- end -}}
@@ -31,6 +31,11 @@
{{/* Short name is the one that defined on the chart, used on selectors */}}
{{- $_ := set $objectData "shortName" $name -}}
{{/* Set the podSpec so it doesn't fail on nil pointer */}}
{{- if not (hasKey $objectData "podSpec") -}}
{{ $_ := set $objectData "podSpec" dict }}
{{- end -}}
{{/* Call class to create the object */}}
{{- if eq $objectData.type "Deployment" -}}
{{- include "ix.v1.common.class.deployment" (dict "rootCtx" $ "objectData" $objectData) -}}
+27 -27
View File
@@ -149,7 +149,6 @@ workload:
enabled: true
primary: true
imageSelector: image
# TODO: Currently implementing
probes:
liveness:
enabled: true
@@ -163,32 +162,33 @@ workload:
enabled: true
type: http
port: "{{ .Values.service.main.ports.main.port }}"
securityContext:
runAsNonRoot: true
runAsUser: 568
runAsGroup: 568
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
privileged: false
capabilities:
add: []
drop:
- ALL
env: {}
envList: []
envFrom: []
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
initContainers:
init-cont-name:
enabled: false
type: install
# ...containerSpec
# # TODO: Currently implementing
# securityContext:
# runAsNonRoot: true
# runAsUser: 568
# runAsGroup: 568
# readOnlyRootFilesystem: true
# allowPrivilegeEscalation: false
# privileged: false
# capabilities:
# add: []
# drop:
# - ALL
# env: {}
# envList: []
# envFrom: []
# resources:
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
# initContainers:
# init-cont-name:
# enabled: false
# type: install
# # ...containerSpec
# TODO:
portal: {}