jupyter-server / enterprise_gateway

A lightweight, multi-tenant, scalable and secure gateway that enables Jupyter Notebooks to share resources across distributed clusters such as Apache Spark, Kubernetes and others.
https://jupyter-enterprise-gateway.readthedocs.io/en/latest/
Other
615 stars 221 forks source link

Kernel CRD Application rejected due to empty env vars value #1222

Closed lresende closed 1 year ago

lresende commented 1 year ago

Description

When a declared env variable on the kernel CRD has no value, spark operator are rejecting applications:

HTTP response body: 
{
    "kind": "Status",
    "apiVersion": "v1",
    "metadata": {},
    "status": "Failure",
    "message": "SparkApplication.sparkoperator.k8s.io \"lresende-6975d2e5-bd58-4ac0-afdb-d1bbacbb7166\" is invalid: spec.driver.env.value: Invalid value: \"null\": spec.driver.env.value in body must be of type string: \"null\"",
    "reason": "Invalid",
    "details": {
        "name": "lresende-6975d2e5-bd58-4ac0-afdb-d1bbacbb7166",
        "group": "sparkoperator.k8s.io",
        "kind": "SparkApplication",
        "causes": [{
            "reason": "FieldValueInvalid",
            "message": "Invalid value: \"null\": spec.driver.env.value in body must be of type string: \"null\"",
            "field": "spec.driver.env.value"
        }]
    },
    "code": 422
}
lresende commented 1 year ago

Use default values on the template:

driver:
...
env:
  - name: FOO
     value: {{ kernel_foo|default('NO_VALUE') }}