Skip to content

Commit 9be05b7

Browse files
committed
fix values.yaml schema for extraContainers
Using losisin/helm-values-schema-json#251 (comment)
1 parent 2c19f75 commit 9be05b7

File tree

4 files changed

+36
-9
lines changed

4 files changed

+36
-9
lines changed

Charts/fastcs/.schema.config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Define input, output and source for $refs relative to repository root for pre-commit
44
values:
55
- Charts/fastcs/values.yaml
6+
- Charts/fastcs/extra.values.yaml
67

78
output: Charts/fastcs/values.schema.json
89

Charts/fastcs/extra.values.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
################################################################################
2+
# values for lists of custom objects from values.yaml for schema generation
3+
################################################################################
4+
5+
# @schema description: Add arbitrary containers to the pod
6+
extraContainers:
7+
# @schema: description: A name for the additional container
8+
- name: container_name
9+
# @schema $ref: $k8s/container.json#/properties/image
10+
image: image_uri
11+
# @schema $ref: $k8s/container.json#/properties/command
12+
command:
13+
- command
14+
- arg1
15+
- arg2

Charts/fastcs/values.schema.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,26 @@
4646
"type": "boolean"
4747
},
4848
"extraContainers": {
49+
"description": "Add arbitrary containers to the pod",
4950
"type": "array",
5051
"items": {
51-
"type": "object"
52+
"type": "object",
53+
"properties": {
54+
"command": {
55+
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.3/container.json#/properties/command",
56+
"type": "array",
57+
"items": {
58+
"type": "string"
59+
}
60+
},
61+
"image": {
62+
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.33.3/container.json#/properties/image",
63+
"type": "string"
64+
},
65+
"name": {
66+
"type": "string"
67+
}
68+
}
5269
}
5370
},
5471
"global": {

Charts/fastcs/values.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,8 @@ service:
8585
ca_port: 5064
8686
pva_port: 5075
8787

88-
89-
# Add addtional containers specified by image and command
90-
#
91-
# should be of the form:
92-
# name: # A name for the additional container
93-
# image: # Container image URI
94-
# command: # Command to run in the container (as array of arguments)
95-
# @schema item: object
88+
# Add additional containers specified by image and command
89+
# see extra.values.yaml for the schema of this list of objects
9690
extraContainers: []
9791

9892
# @schema description: Add annotations to the pod

0 commit comments

Comments
 (0)