From 1b1fd3520564f4b4831656326328fe298048b96f Mon Sep 17 00:00:00 2001 From: SchutteJan <4732389+SchutteJan@users.noreply.github.com> Date: Thu, 7 Mar 2024 10:27:42 +0100 Subject: [PATCH] Replace revisionHistoryLimit type check Sometimes Helm reports type float64 for integer numbers set in values.yaml. This fix replaces the type check with a nil check. --- jupyterhub/templates/hub/deployment.yaml | 2 +- jupyterhub/templates/image-puller/_helpers-daemonset.tpl | 2 +- jupyterhub/templates/proxy/autohttps/deployment.yaml | 2 +- jupyterhub/templates/proxy/deployment.yaml | 2 +- .../templates/scheduling/user-placeholder/statefulset.yaml | 2 +- jupyterhub/templates/scheduling/user-scheduler/deployment.yaml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/jupyterhub/templates/hub/deployment.yaml b/jupyterhub/templates/hub/deployment.yaml index d6e1c63ed8..d7a46bbb00 100644 --- a/jupyterhub/templates/hub/deployment.yaml +++ b/jupyterhub/templates/hub/deployment.yaml @@ -5,7 +5,7 @@ metadata: labels: {{- include "jupyterhub.labels" . | nindent 4 }} spec: - {{- if typeIs "int" .Values.hub.revisionHistoryLimit }} + {{- if not (typeIs "" .Values.hub.revisionHistoryLimit) }} revisionHistoryLimit: {{ .Values.hub.revisionHistoryLimit }} {{- end }} replicas: 1 diff --git a/jupyterhub/templates/image-puller/_helpers-daemonset.tpl b/jupyterhub/templates/image-puller/_helpers-daemonset.tpl index 610f8bde92..16213b09be 100644 --- a/jupyterhub/templates/image-puller/_helpers-daemonset.tpl +++ b/jupyterhub/templates/image-puller/_helpers-daemonset.tpl @@ -34,7 +34,7 @@ spec: type: RollingUpdate rollingUpdate: maxUnavailable: 100% - {{- if typeIs "int" .Values.prePuller.revisionHistoryLimit }} + {{- if not (typeIs "" .Values.prePuller.revisionHistoryLimit) }} revisionHistoryLimit: {{ .Values.prePuller.revisionHistoryLimit }} {{- end }} template: diff --git a/jupyterhub/templates/proxy/autohttps/deployment.yaml b/jupyterhub/templates/proxy/autohttps/deployment.yaml index f76f3efbfa..90feedd767 100644 --- a/jupyterhub/templates/proxy/autohttps/deployment.yaml +++ b/jupyterhub/templates/proxy/autohttps/deployment.yaml @@ -8,7 +8,7 @@ metadata: labels: {{- include "jupyterhub.labels" . | nindent 4 }} spec: - {{- if typeIs "int" .Values.proxy.traefik.revisionHistoryLimit }} + {{- if not (typeIs "" .Values.proxy.traefik.revisionHistoryLimit) }} revisionHistoryLimit: {{ .Values.proxy.traefik.revisionHistoryLimit }} {{- end }} replicas: 1 diff --git a/jupyterhub/templates/proxy/deployment.yaml b/jupyterhub/templates/proxy/deployment.yaml index 2b35382446..85220a86ef 100644 --- a/jupyterhub/templates/proxy/deployment.yaml +++ b/jupyterhub/templates/proxy/deployment.yaml @@ -7,7 +7,7 @@ metadata: labels: {{- include "jupyterhub.labels" . | nindent 4 }} spec: - {{- if typeIs "int" .Values.proxy.chp.revisionHistoryLimit }} + {{- if not (typeIs "" .Values.proxy.chp.revisionHistoryLimit) }} revisionHistoryLimit: {{ .Values.proxy.chp.revisionHistoryLimit }} {{- end }} replicas: 1 diff --git a/jupyterhub/templates/scheduling/user-placeholder/statefulset.yaml b/jupyterhub/templates/scheduling/user-placeholder/statefulset.yaml index e0f6f5958c..7f2c785b99 100644 --- a/jupyterhub/templates/scheduling/user-placeholder/statefulset.yaml +++ b/jupyterhub/templates/scheduling/user-placeholder/statefulset.yaml @@ -16,7 +16,7 @@ metadata: {{- include "jupyterhub.labels" . | nindent 4 }} spec: podManagementPolicy: Parallel - {{- if typeIs "int" .Values.scheduling.userPlaceholder.revisionHistoryLimit }} + {{- if not (typeIs "" .Values.scheduling.userPlaceholder.revisionHistoryLimit) }} revisionHistoryLimit: {{ .Values.scheduling.userPlaceholder.revisionHistoryLimit }} {{- end }} replicas: {{ .Values.scheduling.userPlaceholder.replicas }} diff --git a/jupyterhub/templates/scheduling/user-scheduler/deployment.yaml b/jupyterhub/templates/scheduling/user-scheduler/deployment.yaml index b021c17de8..e73c8ac688 100644 --- a/jupyterhub/templates/scheduling/user-scheduler/deployment.yaml +++ b/jupyterhub/templates/scheduling/user-scheduler/deployment.yaml @@ -6,7 +6,7 @@ metadata: labels: {{- include "jupyterhub.labels" . | nindent 4 }} spec: - {{- if typeIs "int" .Values.scheduling.userScheduler.revisionHistoryLimit }} + {{- if not (typeIs "" .Values.scheduling.userScheduler.revisionHistoryLimit) }} revisionHistoryLimit: {{ .Values.scheduling.userScheduler.revisionHistoryLimit }} {{- end }} replicas: {{ .Values.scheduling.userScheduler.replicas }}