Skip to content

Commit

Permalink
Fix: github action failure
Browse files Browse the repository at this point in the history
  • Loading branch information
jebinjeb committed Jul 8, 2023
1 parent 15319a2 commit 6376b48
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 12 deletions.
2 changes: 1 addition & 1 deletion charts/agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.9
version: 0.1.10

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
25 changes: 23 additions & 2 deletions charts/agent/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "agent.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
Expand All @@ -16,6 +23,9 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
Expand All @@ -33,9 +43,20 @@ spec:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

30 changes: 25 additions & 5 deletions charts/agent/templates/ingress_bridge.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
{{- if .Values.container_bridge.enabled }}
{{- if .Values.container_bridge.ingress.enabled -}}
{{- if .Values.git_bridge.ingress.enabled -}}
{{- $fullName := include "agent.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- if and .Values.container_bridge.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.container_bridge.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.container_bridge.ingress.annotations "kubernetes.io/ingress.class" .Values.container_bridge.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}-container
name: {{ $fullName }}
labels:
{{- include "agent.labels" . | nindent 4 }}
{{- with .Values.container_bridge.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.container_bridge.ingress.tls }}
{{- if and .Values.container_bridge.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.container_bridge.ingress.className }}
{{- end }}
{{- if .Values.git_bridge.ingress.tls }}
tls:
{{- range .Values.container_bridge.ingress.tls }}
- hosts:
Expand All @@ -34,10 +44,20 @@ spec:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}-container
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}-container
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
28 changes: 24 additions & 4 deletions charts/agent/templates/ingress_git.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{{- if .Values.git_bridge.enabled }}
{{- if .Values.container_bridge.ingress.enabled -}}
{{- if .Values.git_bridge.ingress.enabled -}}
{{- $fullName := include "agent.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- if and .Values.git_bridge.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.git_bridge.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.git_bridge.ingress.annotations "kubernetes.io/ingress.class" .Values.git_bridge.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
Expand All @@ -17,6 +24,9 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.git_bridge.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.git_bridge.ingress.className }}
{{- end }}
{{- if .Values.git_bridge.ingress.tls }}
tls:
{{- range .Values.git_bridge.ingress.tls }}
Expand All @@ -34,10 +44,20 @@ spec:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}-git
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}-git
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit 6376b48

Please sign in to comment.