Skip to content

Commit

Permalink
fix ui.serviceNodePort schema (#537)
Browse files Browse the repository at this point in the history
UI service nodePort defaults to null, but is set as an integer
  • Loading branch information
tvoran committed Jun 1, 2021
1 parent 3afcb46 commit af25981
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
23 changes: 23 additions & 0 deletions test/unit/ui-service.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
}
5 changes: 4 additions & 1 deletion values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,10 @@
"type": "boolean"
},
"serviceNodePort": {
"type": "null"
"type": [
"null",
"integer"
]
},
"serviceType": {
"type": "string"
Expand Down

0 comments on commit af25981

Please sign in to comment.