@@ -909,6 +909,13 @@ the global .Values.autoscaling block, but a per-service Override block (passed a
909909.Override, e.g. .Values.nginx.autoscaling) can override any subset of
910910enabled / minReplicas / maxReplicas / targetCPUUtilizationPercentage /
911911targetMemoryUtilizationPercentage. Keys absent from Override inherit the global.
912+
913+ The block below intentionally preserves the newline immediately before
914+ "apiVersion" (the last override `{{- end }}` is NOT right-trimmed). Callers place
915+ a descriptive "# ... autoscaler" comment right before this include; without the
916+ leading newline Helm's whitespace trimming glues apiVersion onto that comment
917+ line, silently commenting it out and producing "error validating data: apiVersion
918+ not set" on upgrade. Mirrors the leading newline that oneuptime.service relies on.
912919*/ }}
913920{{- define " oneuptime.autoscaler" }}
914921{{- $g := .Values.autoscaling | default dict -}}
@@ -923,7 +930,7 @@ targetMemoryUtilizationPercentage. Keys absent from Override inherit the global.
923930{{- $targetCPU := $g .targetCPUUtilizationPercentage -}}
924931{{- if hasKey $o " targetCPUUtilizationPercentage" -}}{{- $targetCPU = $o .targetCPUUtilizationPercentage -}}{{- end -}}
925932{{- $targetMemory := $g .targetMemoryUtilizationPercentage -}}
926- {{- if hasKey $o " targetMemoryUtilizationPercentage" -}}{{- $targetMemory = $o .targetMemoryUtilizationPercentage -}}{{- end - }}
933+ {{- if hasKey $o " targetMemoryUtilizationPercentage" -}}{{- $targetMemory = $o .targetMemoryUtilizationPercentage -}}{{- end }}
927934apiVersion: autoscaling/v2
928935kind: HorizontalPodAutoscaler
929936metadata:
0 commit comments