Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cf-common): fix merge envs #74

Merged
merged 5 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading