From b4939bd57f2dba5ebca9efcd42901457512e70e4 Mon Sep 17 00:00:00 2001 From: Offending Commit Date: Wed, 3 Jun 2026 11:14:47 -0500 Subject: [PATCH] fix(helm): pdb mutual exclusion, ingress null rules guard, hpa nil utilization guard --- charts/openconcho/templates/hpa.yaml | 2 ++ charts/openconcho/templates/ingress.yaml | 4 +++- charts/openconcho/templates/pdb.yaml | 7 +++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/charts/openconcho/templates/hpa.yaml b/charts/openconcho/templates/hpa.yaml index 4f86d9a..43a9b83 100644 --- a/charts/openconcho/templates/hpa.yaml +++ b/charts/openconcho/templates/hpa.yaml @@ -12,6 +12,7 @@ spec: name: {{ include "openconcho.fullname" . }} minReplicas: {{ .Values.autoscaling.minReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }} + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} metrics: - type: Resource resource: @@ -19,4 +20,5 @@ spec: target: type: Utilization averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} {{- end }} diff --git a/charts/openconcho/templates/ingress.yaml b/charts/openconcho/templates/ingress.yaml index e11a8a8..27404eb 100644 --- a/charts/openconcho/templates/ingress.yaml +++ b/charts/openconcho/templates/ingress.yaml @@ -19,6 +19,7 @@ spec: tls: {{- toYaml .Values.ingress.tls | nindent 4 }} {{- end }} + {{- if .Values.ingress.hosts }} rules: {{- range .Values.ingress.hosts }} - host: {{ .host | quote }} @@ -26,7 +27,7 @@ spec: paths: {{- range .paths }} - path: {{ .path }} - pathType: {{ .pathType }} + pathType: {{ .pathType | default "Prefix" }} backend: service: name: {{ $fullName }} @@ -34,4 +35,5 @@ spec: number: {{ $svcPort }} {{- end }} {{- end }} + {{- end }} {{- end }} diff --git a/charts/openconcho/templates/pdb.yaml b/charts/openconcho/templates/pdb.yaml index b28e59a..de4b44b 100644 --- a/charts/openconcho/templates/pdb.yaml +++ b/charts/openconcho/templates/pdb.yaml @@ -6,11 +6,10 @@ metadata: labels: {{- include "openconcho.labels" . | nindent 4 }} spec: - {{- if .Values.podDisruptionBudget.minAvailable }} - minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} - {{- end }} - {{- if .Values.podDisruptionBudget.maxUnavailable }} + {{- if not (kindIs "invalid" .Values.podDisruptionBudget.maxUnavailable) }} maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} + {{- else }} + minAvailable: {{ .Values.podDisruptionBudget.minAvailable | default 1 }} {{- end }} selector: matchLabels: