One of my helm charts let users configure various variable put into hull.config.specific
. It works well, except for the imagePullPolicy
. Below is part of the chart's value :
hull:
config:
specific:
image:
pullPolicy: Never
objects:
deployment:
nginx:
pod:
containers:
nginx:
imagePullPolicy: _HT*hull.config.specific.image.pullPolicy
When doing a helm template
, I've got a schema validation error :
Error: values don't meet the specifications of the schema(s) in the following chart(s):
hull:
- (root): Must validate at least one schema (anyOf)
- objects.deployment.nginx: Must validate at least one schema (anyOf)
- objects.deployment.nginx.pod.containers.nginx: Must validate at least one schema (anyOf)
- objects.deployment.nginx.pod.containers.nginx.imagePullPolicy: objects.deployment.nginx.pod.containers.nginx.imagePullPolicy must be one of the following: "Always", "IfNotPresent", "Never"
- objects.deployment.nginx.pod.containers.nginx: Must validate all the schemas (allOf)
- objects.deployment.nginx.pod: Must validate all the schemas (allOf)
- objects.deployment.nginx: Must validate all the schemas (allOf)
I've taken a look at hull's values.schema.json
, and there is the following for imagePullPolicy
:
"imagePullPolicy": {
"description": "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images\n\nPossible enum values:\n - `\"Always\"` means that kubelet always attempts to pull the latest image. Container will fail If the pull fails.\n - `\"IfNotPresent\"` means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails.\n - `\"Never\"` means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present",
"enum": [
"Always",
"IfNotPresent",
"Never"
],
"anyOf": [
{
"$ref": "#/definitions/hull.Transformation.Pattern"
},
{
"type": "string"
}
]
}
I'm not 100% knowledgeable, but shouldn't the enum
part be inside the anyOf
? I've tried changing this to the following, and it seems to work fine. I'll open a pull request with these changes.
"imagePullPolicy": {
"description": "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images\n\nPossible enum values:\n - `\"Always\"` means that kubelet always attempts to pull the latest image. Container will fail If the pull fails.\n - `\"IfNotPresent\"` means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails.\n - `\"Never\"` means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present",
"anyOf": [
{
"$ref": "#/definitions/hull.Transformation.Pattern"
},
{
"enum": [
"Always",
"IfNotPresent",
"Never"
]
}
]
},