Skip to content

Commit

Permalink
fix: use liqo.selectorTemplate for label definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
aleoli authored and adamjensenbot committed Jan 9, 2025
1 parent ee19ff9 commit ceca09c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
9 changes: 8 additions & 1 deletion deployments/liqo/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,16 @@ labels:
Common Labels for Gateway Templates
*/}}
{{- define "liqo.labelsTemplate" -}}
{{ include "liqo.selectorLabelsTemplate" . }}
{{ include "liqo.selectorTemplate" . }}
helm.sh/chart: {{ quote (include "liqo.chart" .) }}
app.kubernetes.io/version: {{ quote (include "liqo.version" .) }}
{{- end }}

{{/*
Common Label Selector for Gateway Template
*/}}
{{- define "liqo.selectorTemplate" -}}
{{ include "liqo.selectorLabelsTemplate" . }}
app.kubernetes.io/managed-by: {{ quote .Release.Service }}
networking.liqo.io/component: "gateway"
networking.liqo.io/gateway-name: "{{"{{ .Name }}"}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
type: Recreate
selector:
matchLabels:
{{- include "liqo.labelsTemplate" $templateConfig | nindent 14 }}
{{- include "liqo.selectorTemplate" $templateConfig | nindent 14 }}
template:
metadata:
{{- include "liqo.metadataTemplate" $templateConfig | nindent 14 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
{{- end }}
spec:
selector:
{{- include "liqo.labelsTemplate" (merge (dict "isService" true) $templateConfig) | nindent 12 }}
{{- include "liqo.selectorTemplate" (merge (dict "isService" true) $templateConfig) | nindent 12 }}
type: "{{"{{ .Spec.Endpoint.ServiceType }}"}}"
ports:
- port: "{{"{{ .Spec.Endpoint.Port }}"}}"
Expand All @@ -57,7 +57,7 @@ spec:
type: Recreate
selector:
matchLabels:
{{- include "liqo.labelsTemplate" $templateConfig | nindent 14 }}
{{- include "liqo.selectorTemplate" $templateConfig | nindent 14 }}
template:
metadata:
{{- include "liqo.metadataTemplate" $templateConfig | nindent 14 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
{{- end }}
spec:
selector:
{{- include "liqo.labelsTemplate" (merge (dict "isService" true) $templateConfig) | nindent 12 }}
{{- include "liqo.selectorTemplate" (merge (dict "isService" true) $templateConfig) | nindent 12 }}
type: "{{"{{ .Spec.Endpoint.ServiceType }}"}}"
?loadBalancerIP: "{{"{{ .Spec.Endpoint.LoadBalancerIP }}"}}"
ports:
Expand All @@ -50,7 +50,7 @@ spec:
type: Recreate
selector:
matchLabels:
{{- include "liqo.labelsTemplate" $templateConfig | nindent 14 }}
{{- include "liqo.selectorTemplate" $templateConfig | nindent 14 }}
template:
metadata:
{{- include "liqo.metadataTemplate" $templateConfig | nindent 14 }}
Expand Down

0 comments on commit ceca09c

Please sign in to comment.