Skip to content

Commit

Permalink
Merge branch 'fix/helm-api-version-checks' into 'v3'
Browse files Browse the repository at this point in the history
helm: Fix K8S API version check

See merge request anders/ci-configuration!373
  • Loading branch information
antti-mikael committed Nov 22, 2023
2 parents aa6639b + 8ae6636 commit 1ffc558
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions helm/templates/05-ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if and (not .Values.ingress.disabled) (not .Values.jobsOnly) -}}
{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress") }}
{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1") }}
apiVersion: networking.k8s.io/v1
{{- else }}
apiVersion: networking.k8s.io/v1beta1
Expand Down Expand Up @@ -55,11 +55,11 @@ spec:
http:
paths:
- path: {{ $.Values.ingress.path }}
{{- if ($.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress") }}
{{- if ($.Capabilities.APIVersions.Has "networking.k8s.io/v1") }}
pathType: Prefix
{{- end }}
backend:
{{- if ($.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress") }}
{{- if ($.Capabilities.APIVersions.Has "networking.k8s.io/v1") }}
service:
name: {{ template "appname" $ }}-service
port:
Expand Down
2 changes: 1 addition & 1 deletion helm/templates/06-hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.hpa.enabled -}}
{{- if (.Capabilities.APIVersions.Has "autoscaling.apiserver.k8s.io/v2/HorizontalPodAutoscaler") }}
{{- if (.Capabilities.APIVersions.Has "autoscaling.apiserver.k8s.io/v2") }}
apiVersion: autoscaling/v2
{{- else }}
apiVersion: autoscaling/v2beta2
Expand Down

0 comments on commit 1ffc558

Please sign in to comment.