Support global.image value
This commit is contained in:
parent
a1528eda46
commit
9d37c9f2f1
5 changed files with 50 additions and 4 deletions
|
@ -37,7 +37,7 @@ spec:
|
||||||
|
|
||||||
containers:
|
containers:
|
||||||
- name: consul
|
- name: consul
|
||||||
image: "{{ .Values.client.image }}"
|
image: "{{ default .Values.global.image .Values.client.image }}"
|
||||||
env:
|
env:
|
||||||
- name: POD_IP
|
- name: POD_IP
|
||||||
valueFrom:
|
valueFrom:
|
||||||
|
|
|
@ -53,7 +53,7 @@ spec:
|
||||||
name: {{ template "consul.fullname" . }}-server-config
|
name: {{ template "consul.fullname" . }}-server-config
|
||||||
containers:
|
containers:
|
||||||
- name: consul
|
- name: consul
|
||||||
image: "{{ .Values.server.image }}"
|
image: "{{ default .Values.global.image .Values.server.image }}"
|
||||||
env:
|
env:
|
||||||
- name: POD_IP
|
- name: POD_IP
|
||||||
valueFrom:
|
valueFrom:
|
||||||
|
|
|
@ -42,6 +42,27 @@ load _helpers
|
||||||
[ "${actual}" = "false" ]
|
[ "${actual}" = "false" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "client/DaemonSet: image defaults to global.image" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
-x templates/client-daemonset.yaml \
|
||||||
|
--set 'global.image=foo' \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq -r '.spec.template.spec.containers[0].image' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "foo" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "client/DaemonSet: image can be overridden with client.image" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
-x templates/client-daemonset.yaml \
|
||||||
|
--set 'global.image=foo' \
|
||||||
|
--set 'client.image=bar' \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq -r '.spec.template.spec.containers[0].image' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "bar" ]
|
||||||
|
}
|
||||||
|
|
||||||
@test "client/DaemonSet: no updateStrategy when not updating" {
|
@test "client/DaemonSet: no updateStrategy when not updating" {
|
||||||
cd `chart_dir`
|
cd `chart_dir`
|
||||||
local actual=$(helm template \
|
local actual=$(helm template \
|
||||||
|
|
|
@ -42,6 +42,27 @@ load _helpers
|
||||||
[ "${actual}" = "false" ]
|
[ "${actual}" = "false" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "server/StatefulSet: image defaults to global.image" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
-x templates/server-statefulset.yaml \
|
||||||
|
--set 'global.image=foo' \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq -r '.spec.template.spec.containers[0].image' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "foo" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "server/StatefulSet: image can be overridden with server.image" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
-x templates/server-statefulset.yaml \
|
||||||
|
--set 'global.image=foo' \
|
||||||
|
--set 'server.image=bar' \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq -r '.spec.template.spec.containers[0].image' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "bar" ]
|
||||||
|
}
|
||||||
|
|
||||||
@test "server/StatefulSet: no updateStrategy when not updating" {
|
@test "server/StatefulSet: no updateStrategy when not updating" {
|
||||||
cd `chart_dir`
|
cd `chart_dir`
|
||||||
local actual=$(helm template \
|
local actual=$(helm template \
|
||||||
|
|
|
@ -14,9 +14,13 @@ global:
|
||||||
# Domain to register the Consul DNS server to listen for.
|
# Domain to register the Consul DNS server to listen for.
|
||||||
domain: consul
|
domain: consul
|
||||||
|
|
||||||
|
# Image is the name (and tag) of the Consul Docker image for clients and
|
||||||
|
# servers below. This can be overridden per component.
|
||||||
|
image: "consul:1.2.2"
|
||||||
|
|
||||||
server:
|
server:
|
||||||
enabled: "-"
|
enabled: "-"
|
||||||
image: "consul:1.2.2"
|
image: null
|
||||||
replicas: 3
|
replicas: 3
|
||||||
bootstrapExpect: 3 # Should <= replicas count
|
bootstrapExpect: 3 # Should <= replicas count
|
||||||
storage: 10Gi
|
storage: 10Gi
|
||||||
|
@ -61,7 +65,7 @@ server:
|
||||||
# DC where a single agent is deployed per node.
|
# DC where a single agent is deployed per node.
|
||||||
client:
|
client:
|
||||||
enabled: "-"
|
enabled: "-"
|
||||||
image: "consul:1.2.2"
|
image: null
|
||||||
join: null
|
join: null
|
||||||
|
|
||||||
# ConnectInject will enable the automatic Connect sidecar injector.
|
# ConnectInject will enable the automatic Connect sidecar injector.
|
||||||
|
|
Loading…
Reference in a new issue