Skip to content

Commit e7a6913

Browse files
fix(cf-common): fix merge envs (#74)
1 parent 084b783 commit e7a6913

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+377
-295
lines changed

charts/cf-common-test/tests/deployment/container_test.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,3 +327,79 @@ tests:
327327
- equal:
328328
path: spec.template.spec.containers[0].image
329329
value: myregistry.io/codefresh/cf-api:latest
330+
331+
- it: Test main container TPL env without overrides
332+
values:
333+
- values.yaml
334+
- tpl-values.yaml
335+
set:
336+
global:
337+
tpl: value
338+
asserts:
339+
- equal:
340+
path: spec.template.spec.containers[0].env[1].name
341+
value: TPL_VAR_ONE
342+
- equal:
343+
path: spec.template.spec.containers[0].env[1].value
344+
value: value
345+
346+
- it: Test main container TPL env with overrides
347+
values:
348+
- values.yaml
349+
- tpl-values.yaml
350+
set:
351+
global:
352+
tpl: value
353+
container:
354+
env:
355+
TPL_VAR_ONE:
356+
valueFrom:
357+
secretKeyRef:
358+
name: some-secret-one
359+
key: some-key-one
360+
env:
361+
TPL_VAR_TWO:
362+
valueFrom:
363+
secretKeyRef:
364+
name: some-secret-two
365+
key: some-key-two
366+
asserts:
367+
- contains:
368+
path: spec.template.spec.containers[0].env
369+
content:
370+
name: TPL_VAR_ONE
371+
valueFrom:
372+
secretKeyRef:
373+
name: some-secret-one
374+
key: some-key-one
375+
- contains:
376+
path: spec.template.spec.containers[0].env
377+
content:
378+
name: TPL_VAR_TWO
379+
valueFrom:
380+
secretKeyRef:
381+
name: some-secret-two
382+
key: some-key-two
383+
384+
- it: Test main container TPL env with overrides (backward compatibility)
385+
values:
386+
- values.yaml
387+
- tpl-values.yaml
388+
set:
389+
global:
390+
tpl: value
391+
env:
392+
TPL_VAR_ONE:
393+
valueFrom:
394+
secretKeyRef:
395+
name: some-secret-one
396+
key: some-key-one
397+
asserts:
398+
- contains:
399+
path: spec.template.spec.containers[0].env
400+
content:
401+
name: TPL_VAR_ONE
402+
valueFrom:
403+
secretKeyRef:
404+
name: some-secret-one
405+
key: some-key-one
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
container:
2+
env:
3+
TPL_VAR_ONE: '{{ .Values.global.tpl }}'
4+
5+
env:
6+
TPL_VAR_TWO: '{{ .Values.global.tpl }}'

charts/cf-common/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
appVersion: v0.0.0
33
description: Codefresh library chart
44
name: cf-common
5-
version: 0.17.0
5+
version: 0.17.1
66
type: library
77
keywords:
88
- codefresh

charts/cf-common/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Codefresh library chart
44

5-
![Version: 0.17.0](https://img.shields.io/badge/Version-0.17.0-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: v0.0.0](https://img.shields.io/badge/AppVersion-v0.0.0-informational?style=flat-square)
5+
![Version: 0.17.1](https://img.shields.io/badge/Version-0.17.1-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: v0.0.0](https://img.shields.io/badge/AppVersion-v0.0.0-informational?style=flat-square)
66

77
## Installing the Chart
88

@@ -18,7 +18,7 @@ Include this chart as a dependency in your `Chart.yaml` e.g.
1818
# Chart.yaml
1919
dependencies:
2020
- name: cf-common
21-
version: 0.17.0
21+
version: 0.17.1
2222
repository: https://chartmuseum.codefresh.io/cf-common
2323
```
2424

0 commit comments

Comments
 (0)