Skip to content

Commit

Permalink
Fix formatting of pdb and hpa templates (#657)
Browse files Browse the repository at this point in the history
  • Loading branch information
andytson-inviqa authored Jan 18, 2022
1 parent 2564a05 commit 8460e3a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/_base/helm/app/templates/horizontal-pod-autoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: {{ print $.Release.Name "-" $serviceName }}
name: {{ print $.Values.resourcePrefix $serviceName }}
labels:
{{- include "chart.labels" $ | nindent 4 }}
app.kubernetes.io/component: {{ $serviceName }}
app.service: {{ print $.Release.Name "-" $serviceName }}
app.service: {{ print $.Values.resourcePrefix $serviceName }}
annotations:
argocd.argoproj.io/sync-wave: "15"
spec:
{{- with (omit $autoscaling "enabled" "metrics") }}
{{- with (pick $autoscaling "behavior" "minReplicas" "maxReplicas") }}
{{- . | toYaml | nindent 2 }}
{{- end }}
metrics:
Expand All @@ -38,7 +38,7 @@ spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ print $.Release.Name "-" $serviceName }}
name: {{ print $.Values.resourcePrefix $serviceName }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions src/_base/helm/app/templates/pod-disruption-budgets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{- with $service }}
{{- if and (not (hasPrefix "." $serviceName)) .enabled }}
{{- $autoscaling := .autoscaling | default (dict "minReplicas" 0) -}}
{{- if or (gt (.replicas | default 1) 1) (and $autoscaling.enabled (gt $autoscaling.minReplicas 1)) }}
{{- if or (gt (.replicas | default 1 | int) 1) (and $autoscaling.enabled (gt ($autoscaling.minReplicas | int) 1)) }}
---
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
Expand All @@ -15,7 +15,7 @@ metadata:
annotations:
argocd.argoproj.io/sync-wave: "15"
spec:
minAvailable: {{- .minAvailable | default 1 }}
minAvailable: {{ .minAvailable | default 1 }}
selector:
matchLabels:
app.service: {{ print $.Values.resourcePrefix $serviceName }}
Expand Down

0 comments on commit 8460e3a

Please sign in to comment.