Allow overridable inject image, test images

This commit is contained in:
Mitchell Hashimoto 2018-08-21 10:25:37 -07:00
parent dc362ea4e4
commit 3a55af62fe
No known key found for this signature in database
GPG key ID: 744E147AA52F5B0A
3 changed files with 15 additions and 3 deletions

View file

@ -27,7 +27,7 @@ spec:
spec:
containers:
- name: sidecar-injector
image: us.gcr.io/mitchellh-k8s/consul-k8s:latest
image: "{{ .Values.connectInject.image }}"
env:
- name: NAMESPACE
valueFrom:

View file

@ -3,9 +3,20 @@ name_prefix() {
printf "consul"
}
# helm_install installs the Consul chart.
# helm_install installs the Consul chart. This will source overridable
# values from the "values.yaml" file in this directory. This can be set
# by CI or other environments to do test-specific overrides. Note that its
# easily possible to break tests this way so be careful.
helm_install() {
helm install --name consul --wait ${BATS_TEST_DIRNAME}/..
local values="${BATS_TEST_DIRNAME}/values.yaml"
if [ ! -f "${values}" ]; then
touch $values
fi
helm install -f ${values} \
--name consul \
--wait \
${BATS_TEST_DIRNAME}/..
}
# helm_delete deletes the Consul chart and all resources.

View file

@ -61,6 +61,7 @@ client:
# ConnectInject will enable the automatic Connect sidecar injector.
connectInject:
enabled: true
image: "us.gcr.io/mitchellh-k8s/consul-k8s:latest"
default: false # true will inject by default, otherwise requires annotation
caBundle: "" # empty will auto generate the bundle