Skip to content

Commit

Permalink
feat(ACP): add PDB
Browse files Browse the repository at this point in the history
  • Loading branch information
smerle33 committed Sep 28, 2023
1 parent 6a647c8 commit 9349f6b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/artifact-caching-proxy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v2
description: artifact-caching-proxy is a Nginx caching proxy in front of repo.jenkins-ci.org
name: artifact-caching-proxy
type: application
version: 0.14.0
version: 0.15.0
17 changes: 17 additions & 0 deletions charts/artifact-caching-proxy/tests/custom_values_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ suite: Tests with custom values
templates:
- ingress-health.yaml
- ingress.yaml
- pdb.yaml
tests:
- it: Should set a custom health check path when specified by values
template: ingress.yaml
Expand Down Expand Up @@ -50,3 +51,19 @@ tests:
path: metadata.annotations
value:
a-custom/annotation: "hello world"

- it: should ensure the pdb has correct spec
template: pdb.yaml
set:
replicaCount: 2
poddisruptionbudget.minAvailable: 2
poddisruptionbudget.maxUnavailable: 1
asserts:
- isKind:
of: PodDisruptionBudget
- equal:
path: spec.minAvailable
value: 2
- equal:
path: spec.selector.matchLabels['app.kubernetes.io/name']
value: "artifact-caching-proxy"
12 changes: 12 additions & 0 deletions charts/artifact-caching-proxy/tests/defaults_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ templates:
- nginx-proxy-configmap.yaml
- nginx-default-configmap.yaml
- statefulset.yaml
- pdb.yaml
tests:
- it: should not generate any ingress with default values
template: ingress.yaml
Expand Down Expand Up @@ -36,3 +37,14 @@ tests:
of: StatefulSet
- notExists:
path: spec.affinity
- equal:
path: metadata.labels["app.kubernetes.io/name"]
value: artifact-caching-proxy
- equal:
path: metadata.labels["app.kubernetes.io/managed-by"]
value: Helm
- it: should not generate any pdb with default values
template: pdb.yaml
asserts:
- hasDocuments:
count: 0

0 comments on commit 9349f6b

Please sign in to comment.