fix common 1.1.0 (#149)
This commit is contained in:
parent
d43f62aef6
commit
330b74d2b6
|
@ -43,9 +43,9 @@ class Test < ChartTest
|
||||||
values = {}
|
values = {}
|
||||||
chart.value values
|
chart.value values
|
||||||
jq('.spec.template.spec.containers[0].env[0].name', resource('Deployment')).must_equal 'PUID'
|
jq('.spec.template.spec.containers[0].env[0].name', resource('Deployment')).must_equal 'PUID'
|
||||||
jq('.spec.template.spec.containers[0].env[0].value', resource('Deployment')).must_equal 568
|
jq('.spec.template.spec.containers[0].env[0].value', resource('Deployment')).must_equal "568"
|
||||||
jq('.spec.template.spec.containers[0].env[1].name', resource('Deployment')).must_equal 'PGID'
|
jq('.spec.template.spec.containers[0].env[1].name', resource('Deployment')).must_equal 'PGID'
|
||||||
jq('.spec.template.spec.containers[0].env[1].value', resource('Deployment')).must_equal 568
|
jq('.spec.template.spec.containers[0].env[1].value', resource('Deployment')).must_equal "568"
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'set "static" environment variables' do
|
it 'set "static" environment variables' do
|
||||||
|
@ -56,9 +56,9 @@ class Test < ChartTest
|
||||||
}
|
}
|
||||||
chart.value values
|
chart.value values
|
||||||
jq('.spec.template.spec.containers[0].env[0].name', resource('Deployment')).must_equal 'PUID'
|
jq('.spec.template.spec.containers[0].env[0].name', resource('Deployment')).must_equal 'PUID'
|
||||||
jq('.spec.template.spec.containers[0].env[0].value', resource('Deployment')).must_equal 568
|
jq('.spec.template.spec.containers[0].env[0].value', resource('Deployment')).must_equal "568"
|
||||||
jq('.spec.template.spec.containers[0].env[1].name', resource('Deployment')).must_equal 'PGID'
|
jq('.spec.template.spec.containers[0].env[1].name', resource('Deployment')).must_equal 'PGID'
|
||||||
jq('.spec.template.spec.containers[0].env[1].value', resource('Deployment')).must_equal 568
|
jq('.spec.template.spec.containers[0].env[1].value', resource('Deployment')).must_equal "568"
|
||||||
jq('.spec.template.spec.containers[0].env[2].name', resource('Deployment')).must_equal values[:env].keys[0].to_s
|
jq('.spec.template.spec.containers[0].env[2].name', resource('Deployment')).must_equal values[:env].keys[0].to_s
|
||||||
jq('.spec.template.spec.containers[0].env[2].value', resource('Deployment')).must_equal values[:env].values[0].to_s
|
jq('.spec.template.spec.containers[0].env[2].value', resource('Deployment')).must_equal values[:env].values[0].to_s
|
||||||
end
|
end
|
||||||
|
@ -75,9 +75,9 @@ class Test < ChartTest
|
||||||
}
|
}
|
||||||
chart.value values
|
chart.value values
|
||||||
jq('.spec.template.spec.containers[0].env[0].name', resource('Deployment')).must_equal 'PUID'
|
jq('.spec.template.spec.containers[0].env[0].name', resource('Deployment')).must_equal 'PUID'
|
||||||
jq('.spec.template.spec.containers[0].env[0].value', resource('Deployment')).must_equal 568
|
jq('.spec.template.spec.containers[0].env[0].value', resource('Deployment')).must_equal "568"
|
||||||
jq('.spec.template.spec.containers[0].env[1].name', resource('Deployment')).must_equal 'PGID'
|
jq('.spec.template.spec.containers[0].env[1].name', resource('Deployment')).must_equal 'PGID'
|
||||||
jq('.spec.template.spec.containers[0].env[1].value', resource('Deployment')).must_equal 568
|
jq('.spec.template.spec.containers[0].env[1].value', resource('Deployment')).must_equal "568"
|
||||||
jq('.spec.template.spec.containers[0].env[2].name', resource('Deployment')).must_equal values[:envValueFrom].keys[0].to_s
|
jq('.spec.template.spec.containers[0].env[2].name', resource('Deployment')).must_equal values[:envValueFrom].keys[0].to_s
|
||||||
jq('.spec.template.spec.containers[0].env[2].valueFrom | keys[0]', resource('Deployment')).must_equal values[:envValueFrom].values[0].keys[0].to_s
|
jq('.spec.template.spec.containers[0].env[2].valueFrom | keys[0]', resource('Deployment')).must_equal values[:envValueFrom].values[0].keys[0].to_s
|
||||||
end
|
end
|
||||||
|
@ -93,9 +93,9 @@ class Test < ChartTest
|
||||||
}
|
}
|
||||||
chart.value values
|
chart.value values
|
||||||
jq('.spec.template.spec.containers[0].env[0].name', resource('Deployment')).must_equal 'PUID'
|
jq('.spec.template.spec.containers[0].env[0].name', resource('Deployment')).must_equal 'PUID'
|
||||||
jq('.spec.template.spec.containers[0].env[0].value', resource('Deployment')).must_equal 568
|
jq('.spec.template.spec.containers[0].env[0].value', resource('Deployment')).must_equal "568"
|
||||||
jq('.spec.template.spec.containers[0].env[1].name', resource('Deployment')).must_equal 'PGID'
|
jq('.spec.template.spec.containers[0].env[1].name', resource('Deployment')).must_equal 'PGID'
|
||||||
jq('.spec.template.spec.containers[0].env[1].value', resource('Deployment')).must_equal 568
|
jq('.spec.template.spec.containers[0].env[1].value', resource('Deployment')).must_equal "568"
|
||||||
jq('.spec.template.spec.containers[0].env[2].name', resource('Deployment')).must_equal values[:env].keys[0].to_s
|
jq('.spec.template.spec.containers[0].env[2].name', resource('Deployment')).must_equal values[:env].keys[0].to_s
|
||||||
jq('.spec.template.spec.containers[0].env[2].value', resource('Deployment')).must_equal values[:env].values[0].to_s
|
jq('.spec.template.spec.containers[0].env[2].value', resource('Deployment')).must_equal values[:env].values[0].to_s
|
||||||
jq('.spec.template.spec.containers[0].env[3].name', resource('Deployment')).must_equal values[:envTpl].keys[0].to_s
|
jq('.spec.template.spec.containers[0].env[3].name', resource('Deployment')).must_equal values[:envTpl].keys[0].to_s
|
||||||
|
@ -110,9 +110,9 @@ class Test < ChartTest
|
||||||
}
|
}
|
||||||
chart.value values
|
chart.value values
|
||||||
jq('.spec.template.spec.containers[0].env[0].name', resource('Deployment')).must_equal 'PUID'
|
jq('.spec.template.spec.containers[0].env[0].name', resource('Deployment')).must_equal 'PUID'
|
||||||
jq('.spec.template.spec.containers[0].env[0].value', resource('Deployment')).must_equal 568
|
jq('.spec.template.spec.containers[0].env[0].value', resource('Deployment')).must_equal "568"
|
||||||
jq('.spec.template.spec.containers[0].env[1].name', resource('Deployment')).must_equal 'PGID'
|
jq('.spec.template.spec.containers[0].env[1].name', resource('Deployment')).must_equal 'PGID'
|
||||||
jq('.spec.template.spec.containers[0].env[1].value', resource('Deployment')).must_equal 568
|
jq('.spec.template.spec.containers[0].env[1].value', resource('Deployment')).must_equal "568"
|
||||||
jq('.spec.template.spec.containers[0].env[2].name', resource('Deployment')).must_equal values[:envTpl].keys[0].to_s
|
jq('.spec.template.spec.containers[0].env[2].name', resource('Deployment')).must_equal values[:envTpl].keys[0].to_s
|
||||||
jq('.spec.template.spec.containers[0].env[2].value', resource('Deployment')).must_equal 'common-test-admin'
|
jq('.spec.template.spec.containers[0].env[2].value', resource('Deployment')).must_equal 'common-test-admin'
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@ apiVersion: v2
|
||||||
name: common
|
name: common
|
||||||
description: Function library for TrueCharts
|
description: Function library for TrueCharts
|
||||||
type: library
|
type: library
|
||||||
version: 1.1.0
|
version: 1.1.1
|
||||||
kubeVersion: ">=1.16.0-0"
|
kubeVersion: ">=1.16.0-0"
|
||||||
# upstream_version: 3.0.1
|
# upstream_version: 3.0.1
|
||||||
keywords:
|
keywords:
|
||||||
|
|
|
@ -17,9 +17,9 @@ The main container included in the controller.
|
||||||
{{- end }}
|
{{- end }}
|
||||||
env:
|
env:
|
||||||
- name: PUID
|
- name: PUID
|
||||||
value: {{ .Values.PUID }}
|
value: {{ .Values.PUID | quote }}
|
||||||
- name: PGID
|
- name: PGID
|
||||||
value: {{ .Values.PGID }}
|
value: {{ .Values.PGID | quote }}
|
||||||
{{- if or .Values.env .Values.envTpl .Values.envValueFrom .Values.envVariable }}
|
{{- if or .Values.env .Values.envTpl .Values.envValueFrom .Values.envVariable }}
|
||||||
{{- range $envVariable := .Values.environmentVariables }}
|
{{- range $envVariable := .Values.environmentVariables }}
|
||||||
{{- if and $envVariable.name $envVariable.value }}
|
{{- if and $envVariable.name $envVariable.value }}
|
||||||
|
|
Loading…
Reference in New Issue