mirror of
https://github.com/outbackdingo/cozystack.git
synced 2026-01-28 18:18:41 +00:00
fix host
This commit is contained in:
@@ -7,18 +7,18 @@ metadata:
|
||||
{{- if hasPrefix "tenant-" .Release.Namespace }}
|
||||
{{- $existingNS := lookup "v1" "Namespace" "" .Release.Namespace }}
|
||||
{{- if $existingNS }}
|
||||
labels:
|
||||
annotations:
|
||||
{{- if .Values.host }}
|
||||
namespace.cozystack.io/host: "{{ .Values.host }}"
|
||||
{{- else }}
|
||||
{{ $parentHost := index $existingNS.metadata.labels "namespace.cozystack.io/host" | required (printf "namespace %s has no namespace.cozystack.io/host label" $.Release.Namespace) }}
|
||||
namespace.cozystack.io/host: "{{ trimPrefix "tenant-" (include "tenant.name" .) }}.{{ $parentHost }}"
|
||||
{{ $parentHost := index $existingNS.metadata.annotations "namespace.cozystack.io/host" | required (printf "namespace %s has no namespace.cozystack.io/host annotation" $.Release.Namespace) }}
|
||||
namespace.cozystack.io/host: "{{ splitList "-" (include "tenant.name" .) | last }}.{{ $parentHost }}"
|
||||
{{- end }}
|
||||
{{- range $x := list "etcd" "monitoring" "ingress" }}
|
||||
{{- if (index $.Values $x) }}
|
||||
namespace.cozystack.io/{{ $x }}: "{{ include "tenant.name" $ }}"
|
||||
{{- else }}
|
||||
namespace.cozystack.io/{{ $x }}: "{{ index $existingNS.metadata.labels (printf "namespace.cozystack.io/%s" $x) | required (printf "namespace %s has no namespace.cozystack.io/%s label" $.Release.Namespace $x) }}"
|
||||
namespace.cozystack.io/{{ $x }}: "{{ index $existingNS.metadata.annotations (printf "namespace.cozystack.io/%s" $x) | required (printf "namespace %s has no namespace.cozystack.io/%s annotation" $.Release.Namespace $x) }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ownerReferences:
|
||||
|
||||
Reference in New Issue
Block a user