From af25981752b6850d343729053c104f0f82d9ab6d Mon Sep 17 00:00:00 2001 From: Theron Voran Date: Tue, 1 Jun 2021 10:41:02 -0700 Subject: [PATCH] fix ui.serviceNodePort schema (#537) UI service nodePort defaults to null, but is set as an integer --- test/unit/ui-service.bats | 23 +++++++++++++++++++++++ values.schema.json | 5 ++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/test/unit/ui-service.bats b/test/unit/ui-service.bats index 499f7326c..9dade3db3 100755 --- a/test/unit/ui-service.bats +++ b/test/unit/ui-service.bats @@ -300,3 +300,26 @@ load _helpers yq -r '.spec.selector["vault-active"]' | tee /dev/stderr) [ "${actual}" = 'true' ] } + +@test "ui/Service: default is no nodePort" { + cd `chart_dir` + + local actual=$(helm template \ + --show-only templates/ui-service.yaml \ + --set 'ui.enabled=true' \ + . | tee /dev/stderr | + yq -r '.spec.ports[0].nodePort' | tee /dev/stderr) + [ "${actual}" = "null" ] +} + +@test "ui/Service: can set nodePort" { + cd `chart_dir` + + local actual=$(helm template \ + --show-only templates/ui-service.yaml \ + --set 'ui.enabled=true' \ + --set 'ui.serviceNodePort=123' \ + . | tee /dev/stderr | + yq -r '.spec.ports[0].nodePort' | tee /dev/stderr) + [ "${actual}" = "123" ] +} diff --git a/values.schema.json b/values.schema.json index 87130e998..2535c1d9e 100644 --- a/values.schema.json +++ b/values.schema.json @@ -775,7 +775,10 @@ "type": "boolean" }, "serviceNodePort": { - "type": "null" + "type": [ + "null", + "integer" + ] }, "serviceType": { "type": "string"