Skip to content

Commit 8c70fde

Browse files
crds: divide chart templates into subcharts
1 parent f35e2f7 commit 8c70fde

File tree

8 files changed

+41
-7
lines changed

8 files changed

+41
-7
lines changed

charts/victoria-metrics-operator-crds/Chart.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,13 @@ annotations:
3333
url: https://docs.victoriametrics.com/operator/
3434
- name: Changelog
3535
url: https://docs.victoriametrics.com/operator/changelog/
36+
dependencies:
37+
- name: crds
38+
version: "0.0.*"
39+
alias: vm
40+
- name: crds
41+
version: "0.0.*"
42+
alias: vl
43+
- name: crds
44+
version: "0.0.*"
45+
alias: vt
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: crds
3+
description: A subchart stores victoriametrics operator CRDs.
4+
type: application
5+
version: 0.0.0
6+
appVersion: "0.0.0"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
build:
3+
list: never
4+
publishResources: false
5+
render: never
6+
sitemap:
7+
disable: true
8+
---
9+
# Subchart for VictoriaMetrics Operator CRDs
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../victoria-metrics-operator/crd.yaml
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
{{- $files := .Files }}
2+
{{- $name := .Chart.Name }}
23
{{- $crds := $files.Get "crd.yaml" | splitList "---" }}
34
{{- $extra := dict "metadata" (dict "annotations" .Values.annotations "labels" .Values.labels) -}}
45
{{- range $crds }}
56
{{- $crd := merge (fromYaml .) $extra }}
6-
{{- range $attrKey, $attrValue := $crd }}
7-
{{- $attrKey }}: {{ toJson $attrValue }}
8-
{{- printf "\n" -}}
9-
{{ end }}
10-
{{- print "\n---\n" }}
7+
{{- if hasPrefix $name $crd.metadata.name }}
8+
{{- range $attrKey, $attrValue := $crd }}
9+
{{- $attrKey }}: {{ toJson $attrValue }}
10+
{{- printf "\n" -}}
11+
{{ end }}
12+
{{- print "\n---\n" }}
13+
{{- end }}
1114
{{- end }}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
annotations: {}

charts/victoria-metrics-operator-crds/crd.yaml

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
# -- VM operator CRD annotations
2-
annotations: {}
2+
vm:
3+
annotations: {}
4+
vl:
5+
annotations: {}
6+
vt:
7+
annotations: {}

0 commit comments

Comments
 (0)