mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-05 03:16:21 -03:00
fix(common): ensure no loadbalancer reservation is made and ingress is not connected to ingresscontroller with Stop-All set
This commit is contained in:
@@ -15,4 +15,4 @@ maintainers:
|
||||
name: common
|
||||
sources: null
|
||||
type: library
|
||||
version: 16.2.21
|
||||
version: 16.2.22
|
||||
|
||||
@@ -24,6 +24,12 @@ objectData: The object data to be used to render the Ingress.
|
||||
{{- include "tc.v1.common.lib.ingress.integration.certManager" (dict "rootCtx" $rootCtx "objectData" $objectData) -}}
|
||||
{{- include "tc.v1.common.lib.ingress.integration.traefik" (dict "rootCtx" $rootCtx "objectData" $objectData) -}}
|
||||
{{- include "tc.v1.common.lib.ingress.integration.homepage" (dict "rootCtx" $rootCtx "objectData" $objectData) }}
|
||||
|
||||
{{/* When Stop All is set, force ingressClass "stopped" to yeet ingress from the ingresscontroller */}}
|
||||
{{- $ingressClassName := (tpl $objectData.ingressClassName $rootCtx) -}}
|
||||
{{- if (include "tc.v1.common.lib.util.stopAll" $rootCtx) -}}
|
||||
{{- $ingressClassName = "stopped" -}}
|
||||
{{- end -}}
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
@@ -42,7 +48,7 @@ metadata:
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if $objectData.ingressClassName }}
|
||||
ingressClassName: {{ tpl $objectData.ingressClassName $rootCtx }}
|
||||
ingressClassName: {{ $ingressClassName }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range $h := $objectData.hosts }}
|
||||
|
||||
@@ -51,7 +51,13 @@ objectData: The service data, that will be used to render the Service object.
|
||||
{{- $svcType = "ClusterIP" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* When Stop All is set, force ClusterIP as well */}}
|
||||
{{- if (include "tc.v1.common.lib.util.stopAll" $rootCtx) -}}
|
||||
{{- $svcType = "ClusterIP" -}}
|
||||
{{- end -}}
|
||||
{{- $_ := set $objectData "type" $svcType }}
|
||||
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
|
||||
Reference in New Issue
Block a user