Skip to content
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
145 changes: 145 additions & 0 deletions charts/cf-common-test/tests/deployment/spec_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,34 @@ tests:
value:
node-type: app

- it: Test global nodeSelector
values:
- values.yaml
set:
global:
nodeSelector:
alice: bob
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
alice: bob

- it: Test deployment nodeSelector with global nodeSelector
values:
- values.yaml
set:
global:
nodeSelector:
alice: bob
nodeSelector:
alice: bar
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
alice: bar

- it: Test deployments tolerations
values:
- values.yaml
Expand All @@ -163,6 +191,50 @@ tests:
key: codefresh.io
value: app

- it: Test global tolerations
values:
- values.yaml
set:
global:
tolerations:
- effect: NoSchedule
key: codefresh.io
value: app
asserts:
- contains:
path: spec.template.spec.tolerations
content:
effect: NoSchedule
key: codefresh.io
value: app

- it: Test deployment tolerations with global tolerations
values:
- values.yaml
set:
global:
tolerations:
- effect: NoSchedule
key: worker
value: true
tolerations:
- effect: NoSchedule
key: codefresh.io
value: app
asserts:
- contains:
path: spec.template.spec.tolerations
content:
effect: NoSchedule
key: codefresh.io
value: app
- contains:
path: spec.template.spec.tolerations
content:
effect: NoSchedule
key: worker
value: true

- it: Test deployments affinity
values:
- values.yaml
Expand All @@ -189,6 +261,79 @@ tests:
values:
- app

- it: Test global affinity
values:
- values.yaml
set:
global:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-type
operator: In
values:
- app
asserts:
- equal:
path: spec.template.spec.affinity
value:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-type
operator: In
values:
- app

- it: Test deployment affinity with global affinity
values:
- values.yaml
set:
global:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-type
operator: In
values:
- app
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: security
operator: In
values:
- S1
topologyKey: failure-domain.beta.kubernetes.io/zone
asserts:
- equal:
path: spec.template.spec.affinity
value:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-type
operator: In
values:
- app
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: security
operator: In
values:
- S1
topologyKey: failure-domain.beta.kubernetes.io/zone

- it: Test deployment with sidecar container
values:
- values.yaml
Expand Down
27 changes: 27 additions & 0 deletions charts/cf-common-test/tests/env-vars/extra_env_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/quintush/helm-unittest/master/schema/helm-testsuite.json
suite: extra env vars
templates:
- templates/controller.yaml
- templates/secret.yaml
tests:
- it: Test extraEnv env vars
values:
- values.yaml
template: templates/controller.yaml
set:
container:
env:
ALICE: BOB
extraEnv:
FOO: $(ALICE)
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: ALICE
value: BOB
- contains:
path: spec.template.spec.containers[0].env
content:
name: FOO
value: $(ALICE)
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.22.0
version: 0.23.0
type: library
keywords:
- codefresh
Expand Down
9 changes: 6 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.22.0](https://img.shields.io/badge/Version-0.22.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.23.0](https://img.shields.io/badge/Version-0.23.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.22.0
version: 0.23.0
repository: https://chartmuseum.codefresh.io/cf-common
```

Expand Down Expand Up @@ -106,11 +106,14 @@ dependencies:
| externalSecrets | list | `[]` | Create External Secrets |
| extraResources | list | `[]` | Array of extra objects to deploy with the release |
| fullNameOverride | string | `""` | String to fully override app name |
| global | object | `{"clusterDomain":"","controller":{},"env":{},"imagePullSecrets":[],"imageRegistry":""}` | Global parameters |
| global | object | `{"affinity":{},"clusterDomain":"","controller":{},"env":{},"imagePullSecrets":[],"imageRegistry":"","nodeSelector":{},"tolerations":[]}` | Global parameters |
| global.affinity | object | `{}` | Set global affinity constrains |
| global.clusterDomain | string | `""` | Cluster domain |
| global.env | object | `{}` | Global Env vars. NO precedence over `.Values.container.env` |
| global.imagePullSecrets | list | `[]` | Global Docker registry secret names as array |
| global.imageRegistry | string | `""` | Global Docker image registry |
| global.nodeSelector | object | `{}` | Set global node selection constrains |
| global.tolerations | list | `[]` | Set global tolerations constrains |
| hpa | object | See below | Configure autoscaling (Horizontal Pod Autoscaler) |
| hpa.enabled | bool | `false` | Enable HPA |
| hpa.maxReplicas | string | `nil` | Set maximum autoscaling replicas |
Expand Down
Loading
Loading