Skip to content

Commit

Permalink
allow specifying namespace for projectmappings in values.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
wr0ngway committed Jan 19, 2022
1 parent af961d1 commit 554a43e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion helm/kubetruth/templates/projectmappings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@
apiVersion: kubetruth.cloudtruth.com/v1
kind: ProjectMapping
metadata:
name: {{ include "kubetruth.fullname" $ }}-{{$k}}
{{- if contains "/" $k }}
{{- $name_parts := regexSplit "/" $k -1 }}
{{- $namespace := $name_parts | first }}
{{- $name := $name_parts | last }}
name: {{ include "kubetruth.fullname" $ }}-{{ $name }}
namespace: {{ $namespace }}
{{- else }}
name: {{ include "kubetruth.fullname" $ }}-{{ $k }}
namespace: {{ $.Release.Namespace }}
{{- end }}
labels:
{{- include "kubetruth.labels" $ | nindent 4 }}
spec:
Expand Down

0 comments on commit 554a43e

Please sign in to comment.