Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Set check_update_interval for healthchecks #674

Merged
merged 1 commit into from Nov 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions templates/client-config-configmap.yaml
Expand Up @@ -20,4 +20,13 @@ data:
"enable_central_service_config": true
}
{{- end }}

{{- if (and .Values.connectInject.enabled .Values.connectInject.healthChecks.enabled) }}
{{/* We set check_update_interval to 0s so that check output is immediately viewable
in the UI. */}}
config.json: |-
{
"check_update_interval": "0s"
}
{{- end }}
{{- end }}
Expand Up @@ -71,3 +71,26 @@ load _helpers
yq '.data["central-config.json"] | length > 0' | tee /dev/stderr)
[ "${actual}" = "false" ]
}

#--------------------------------------------------------------------
# connectInject.healthChecks

@test "client/ConfigMap: check_update_interval is not set by default" {
cd `chart_dir`
local actual=$(helm template \
-s templates/client-config-configmap.yaml \
. | tee /dev/stderr |
yq '.data["config.json"] | length > 0' | tee /dev/stderr)
[ "${actual}" = "false" ]
}

@test "client/ConfigMap: check_update_interval is set when health checks enabled" {
cd `chart_dir`
local actual=$(helm template \
-s templates/client-config-configmap.yaml \
--set 'connectInject.enabled=true' \
--set 'connectInject.healthChecks.enabled=true' \
. | tee /dev/stderr |
yq '.data["config.json"] | contains("check_update_interval")' | tee /dev/stderr)
[ "${actual}" = "true" ]
}