Merge pull request 'fix-namespace-issue-oci' (#4) from fix-namespace-issue-oci into main
All checks were successful
Deploy / push (push) Successful in 3s

Reviewed-on: #4
This commit is contained in:
ties 2024-08-29 15:37:18 +00:00
commit 1fbc49bd60
2 changed files with 7 additions and 3 deletions

View File

@ -1,4 +1,4 @@
apiVersion: v2 apiVersion: v2
name: chart_template name: chart_template
description: chart_description description: chart_description
version: 0.0.4 version: 0.0.5

View File

@ -1,6 +1,8 @@
{{ $name := .Values.name }}
{{ $repository := .Values.subchartData.repository }} {{ $repository := .Values.subchartData.repository }}
{{- if hasPrefix "oci://" .Values.subchartData.repository }} {{- if hasPrefix "oci://" .Values.subchartData.repository }}
{{- $repository = printf "%s/%s" .Values.subchartData.repository .Values.name }} {{- $name = printf "%s/%s" .Values.subchartData.repository .Values.name }}
{{- $repository = "" }}
{{- end }} {{- end }}
apiVersion: helm.cattle.io/v1 apiVersion: helm.cattle.io/v1
kind: HelmChart kind: HelmChart
@ -8,8 +10,10 @@ metadata:
name: {{ .Values.name }} name: {{ .Values.name }}
namespace: {{ .Values.namespace }} namespace: {{ .Values.namespace }}
spec: spec:
chart: {{ .Values.name }} chart: {{ $name }}
{{- if $repository }}
repo: {{ $repository }} repo: {{ $repository }}
{{- end }}
targetNamespace: {{ .Values.namespace }} targetNamespace: {{ .Values.namespace }}
version: {{ .Values.subchartData.version }} version: {{ .Values.subchartData.version }}
valuesContent: |- valuesContent: |-