Skip to content

Commit

Permalink
Replace revisionHistoryLimit type check
Browse files Browse the repository at this point in the history
Sometimes Helm reports type float64 for integer numbers set in values.yaml.
This fix replaces the type check with a nil check.
  • Loading branch information
SchutteJan committed Mar 7, 2024
1 parent cd8a724 commit 1b1fd35
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion jupyterhub/templates/hub/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
labels:
{{- include "jupyterhub.labels" . | nindent 4 }}
spec:
{{- if typeIs "int" .Values.hub.revisionHistoryLimit }}
{{- if not (typeIs "<nil>" .Values.hub.revisionHistoryLimit) }}
revisionHistoryLimit: {{ .Values.hub.revisionHistoryLimit }}
{{- end }}
replicas: 1
Expand Down
2 changes: 1 addition & 1 deletion jupyterhub/templates/image-puller/_helpers-daemonset.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 100%
{{- if typeIs "int" .Values.prePuller.revisionHistoryLimit }}
{{- if not (typeIs "<nil>" .Values.prePuller.revisionHistoryLimit) }}
revisionHistoryLimit: {{ .Values.prePuller.revisionHistoryLimit }}
{{- end }}
template:
Expand Down
2 changes: 1 addition & 1 deletion jupyterhub/templates/proxy/autohttps/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
labels:
{{- include "jupyterhub.labels" . | nindent 4 }}
spec:
{{- if typeIs "int" .Values.proxy.traefik.revisionHistoryLimit }}
{{- if not (typeIs "<nil>" .Values.proxy.traefik.revisionHistoryLimit) }}
revisionHistoryLimit: {{ .Values.proxy.traefik.revisionHistoryLimit }}
{{- end }}
replicas: 1
Expand Down
2 changes: 1 addition & 1 deletion jupyterhub/templates/proxy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
{{- include "jupyterhub.labels" . | nindent 4 }}
spec:
{{- if typeIs "int" .Values.proxy.chp.revisionHistoryLimit }}
{{- if not (typeIs "<nil>" .Values.proxy.chp.revisionHistoryLimit) }}
revisionHistoryLimit: {{ .Values.proxy.chp.revisionHistoryLimit }}
{{- end }}
replicas: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ metadata:
{{- include "jupyterhub.labels" . | nindent 4 }}
spec:
podManagementPolicy: Parallel
{{- if typeIs "int" .Values.scheduling.userPlaceholder.revisionHistoryLimit }}
{{- if not (typeIs "<nil>" .Values.scheduling.userPlaceholder.revisionHistoryLimit) }}
revisionHistoryLimit: {{ .Values.scheduling.userPlaceholder.revisionHistoryLimit }}
{{- end }}
replicas: {{ .Values.scheduling.userPlaceholder.replicas }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
{{- include "jupyterhub.labels" . | nindent 4 }}
spec:
{{- if typeIs "int" .Values.scheduling.userScheduler.revisionHistoryLimit }}
{{- if not (typeIs "<nil>" .Values.scheduling.userScheduler.revisionHistoryLimit) }}
revisionHistoryLimit: {{ .Values.scheduling.userScheduler.revisionHistoryLimit }}
{{- end }}
replicas: {{ .Values.scheduling.userScheduler.replicas }}
Expand Down

0 comments on commit 1b1fd35

Please sign in to comment.