Skip to content
Merged
23 changes: 23 additions & 0 deletions charts/cf-common-test/tests/secret/controller_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: deployment spec
templates:
- templates/controller.yaml
values:
- values.yaml
tests:
- it: should have the envFrom secret in container spec
asserts:
- equal:
path: spec.template.spec.containers[0].envFrom[0]
value:
secretRef:
name: secret

- it: should NOT have the envFrom secret in container spec
set:
secrets:
secret:
envFrom: false
asserts:
- isEmpty:
path: spec.template.spec.containers[0].envFrom
17 changes: 17 additions & 0 deletions charts/cf-common-test/tests/secret/metadata_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,20 @@ tests:
app.kubernetes.io/name: cf-common-test
helm.sh/chart: cf-common-test-0.0.0
foo: bar

- it: Test secret name override
set:
secrets:
secret:
enabled: true
nameOverride: my-secret
stringData:
MY_VAR: value
asserts:
- hasDocuments:
count: 1
- isKind:
of: Secret
- equal:
path: metadata.name
value: my-secret
23 changes: 23 additions & 0 deletions charts/cf-common-test/tests/secret/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
controller:
enabled: true
type: deployment

container:
image:
registry: 839151377425.dkr.ecr.us-east-1.amazonaws.com/codefresh-inc
repository: codefresh/cf-api
tag: master
pullPolicy: Always

command:
- "/bin/sh"
args:
- "-c"
- "sleep infinity"

secrets:
secret:
enabled: true
nameOverride: secret
stringData:
FOO: "bar"
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.31.0
version: 0.32.0
type: library
keywords:
- codefresh
Expand Down
8 changes: 5 additions & 3 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.31.0](https://img.shields.io/badge/Version-0.31.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.32.0](https://img.shields.io/badge/Version-0.32.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)

## 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.31.0
version: 0.32.0
repository: https://chartmuseum.codefresh.io/cf-common
```

Expand Down Expand Up @@ -173,10 +173,12 @@ dependencies:
| rbac.enabled | bool | `false` | Enable RBAC resources |
| rbac.namespaced | bool | `true` | Restrict RBAC in a single namespace instead of cluster-wide scope |
| rbac.rules | list | `[]` | Create custom rules |
| secrets.secret | object | `{"annotation":{},"data":{},"enabled":false,"labels":{},"stringData":{},"type":"Opaque"}` | Secret name. Make sure to use the same name in `volumes` and `container.volumeMounts` |
| secrets.secret | object | `{"annotation":{},"data":{},"enabled":false,"envFrom":true,"labels":{},"nameOverride":"","stringData":{},"type":"Opaque"}` | Secret name. Make sure to use the same name in `volumes` and `container.volumeMounts` |
| secrets.secret.annotation | object | `{}` | Add additional annotations to the secret |
| secrets.secret.enabled | bool | `false` | Enable the secret |
| secrets.secret.envFrom | bool | `true` | Set the secret as envFrom for the container |
| secrets.secret.labels | object | `{}` | Add additional labels to the secret |
| secrets.secret.nameOverride | string | `""` | Override the secret name |
| secrets.secret.stringData | object | `{}` | Secret data content. Plain text (not base64). Helm template supported. Passed through `tpl`, should be configured as string |
| secrets.secret.type | string | `"Opaque"` | Set secret type (`Opaque`/`kubernetes.io/tls`) |
| service | object | See below | Configure services fo the chart. Additional services can be added by adding a dictionary key similar to the 'main' service. |
Expand Down
Loading
Loading