Skip to content

Commit 9984c52

Browse files
Add support for Helm Chart v3 schema (SchemaStore#5179)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent f655f15 commit 9984c52

File tree

5 files changed

+91
-3
lines changed

5 files changed

+91
-3
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"apiVersion": "v2",
3+
"dependencies": [
4+
{
5+
"name": "nginx"
6+
},
7+
{
8+
"depends-on": ["nginx"],
9+
"name": "bar"
10+
}
11+
],
12+
"name": "invalid-chart",
13+
"version": "1.0.0"
14+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# yaml-language-server: $schema=../../schemas/json/chart.json
2+
apiVersion: v2
3+
name: invalid-chart
4+
version: 1.0.0
5+
dependencies:
6+
- name: nginx
7+
- name: bar
8+
depends-on:
9+
- nginx

src/schemas/json/chart.json

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"additionalProperties": false,
55
"properties": {
66
"apiVersion": {
7-
"description": "The apiVersion field should be v2 for Helm charts that require at least Helm 3. Charts supporting previous Helm versions have an apiVersion set to v1 and are still installable by Helm 3.",
8-
"enum": ["v1", "v2"]
7+
"description": "The apiVersion field should be v2 for Helm charts that require at least Helm 3. Charts supporting previous Helm versions have an apiVersion set to v1 and are still installable by Helm 3. v3 is experimental.",
8+
"enum": ["v1", "v2", "v3"]
99
},
1010
"name": {
1111
"description": "The name of the chart",
@@ -117,6 +117,13 @@
117117
"alias": {
118118
"description": "Alias to be used for the chart. Useful when you have to add the same chart multiple times",
119119
"type": "string"
120+
},
121+
"depends-on": {
122+
"description": "A list of subcharts (by name or alias) that need to be ready before this subchart can be installed. Only available when apiVersion is v3.",
123+
"type": "array",
124+
"items": {
125+
"type": "string"
126+
}
120127
}
121128
}
122129
}
@@ -165,6 +172,10 @@
165172
"type": "string"
166173
},
167174
"properties": {
175+
"helm.sh/depends-on/subcharts": {
176+
"description": "A JSON array of subchart names (by name or alias) that must be fully deployed and in a ready state before the current chart resources can be installed.",
177+
"type": "string"
178+
},
168179
"artifacthub.io/changes": {
169180
"description": "This annotation is used to provide some details about the changes introduced by a given chart version. Artifact Hub can generate and display a ChangeLog based on the entries in the changes field in all your chart versions.\nThis annotation can be provided using two different formats: using a plain list of strings with the description of the change or using a list of objects with some extra structured information (see example below). Please feel free to use the one that better suits your needs. The UI experience will be slightly different depending on the choice. When using the list of objects option the valid supported kinds are added, changed, deprecated, removed, fixed and security.",
170181
"type": "string"
@@ -228,5 +239,26 @@
228239
},
229240
"required": ["apiVersion", "name", "version"],
230241
"title": "Helm Chart.yaml",
231-
"type": "object"
242+
"type": "object",
243+
"if": {
244+
"properties": {
245+
"apiVersion": {
246+
"const": "v3"
247+
}
248+
}
249+
},
250+
"then": {},
251+
"else": {
252+
"properties": {
253+
"dependencies": {
254+
"type": "array",
255+
"items": {
256+
"type": "object",
257+
"properties": {
258+
"depends-on": false
259+
}
260+
}
261+
}
262+
}
263+
}
232264
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"annotations": {
3+
"helm.sh/depends-on/subcharts": "[\"bar\", \"rabbitmq\"]"
4+
},
5+
"apiVersion": "v3",
6+
"dependencies": [
7+
{
8+
"name": "nginx"
9+
},
10+
{
11+
"name": "rabbitmq"
12+
},
13+
{
14+
"depends-on": ["nginx", "rabbitmq"],
15+
"name": "bar"
16+
}
17+
],
18+
"name": "foo",
19+
"version": "1.0.0"
20+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# yaml-language-server: $schema=../../schemas/json/chart.json
2+
apiVersion: v3
3+
name: foo
4+
version: 1.0.0
5+
annotations:
6+
helm.sh/depends-on/subcharts: '["bar", "rabbitmq"]'
7+
dependencies:
8+
- name: nginx
9+
- name: rabbitmq
10+
- name: bar
11+
depends-on:
12+
- nginx
13+
- rabbitmq

0 commit comments

Comments
 (0)