Skip to content

Commit

Permalink
fix(cf-common): fix merge envs (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhail-klimko authored Jan 11, 2024
1 parent 084b783 commit e7a6913
Show file tree
Hide file tree
Showing 43 changed files with 377 additions and 295 deletions.
76 changes: 76 additions & 0 deletions charts/cf-common-test/tests/deployment/container_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,79 @@ tests:
- equal:
path: spec.template.spec.containers[0].image
value: myregistry.io/codefresh/cf-api:latest

- it: Test main container TPL env without overrides
values:
- values.yaml
- tpl-values.yaml
set:
global:
tpl: value
asserts:
- equal:
path: spec.template.spec.containers[0].env[1].name
value: TPL_VAR_ONE
- equal:
path: spec.template.spec.containers[0].env[1].value
value: value

- it: Test main container TPL env with overrides
values:
- values.yaml
- tpl-values.yaml
set:
global:
tpl: value
container:
env:
TPL_VAR_ONE:
valueFrom:
secretKeyRef:
name: some-secret-one
key: some-key-one
env:
TPL_VAR_TWO:
valueFrom:
secretKeyRef:
name: some-secret-two
key: some-key-two
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: TPL_VAR_ONE
valueFrom:
secretKeyRef:
name: some-secret-one
key: some-key-one
- contains:
path: spec.template.spec.containers[0].env
content:
name: TPL_VAR_TWO
valueFrom:
secretKeyRef:
name: some-secret-two
key: some-key-two

- it: Test main container TPL env with overrides (backward compatibility)
values:
- values.yaml
- tpl-values.yaml
set:
global:
tpl: value
env:
TPL_VAR_ONE:
valueFrom:
secretKeyRef:
name: some-secret-one
key: some-key-one
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: TPL_VAR_ONE
valueFrom:
secretKeyRef:
name: some-secret-one
key: some-key-one
6 changes: 6 additions & 0 deletions charts/cf-common-test/tests/deployment/tpl-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
container:
env:
TPL_VAR_ONE: '{{ .Values.global.tpl }}'

env:
TPL_VAR_TWO: '{{ .Values.global.tpl }}'
2 changes: 1 addition & 1 deletion charts/cf-common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: v0.0.0
description: Codefresh library chart
name: cf-common
version: 0.17.0
version: 0.17.1
type: library
keywords:
- codefresh
Expand Down
4 changes: 2 additions & 2 deletions charts/cf-common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Codefresh library chart

![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)
![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)

## Installing the Chart

Expand All @@ -18,7 +18,7 @@ Include this chart as a dependency in your `Chart.yaml` e.g.
# Chart.yaml
dependencies:
- name: cf-common
version: 0.17.0
version: 0.17.1
repository: https://chartmuseum.codefresh.io/cf-common
```
Expand Down
Loading

0 comments on commit e7a6913

Please sign in to comment.