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(pdb-minavailable-check): ensure correct handling of 0 replicas workloads #800

Merged
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
2 changes: 1 addition & 1 deletion other/m-q/pdb-minavailable/artifacthub-pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ annotations:
kyverno/category: "Other"
kyverno/kubernetesVersion: "1.24"
kyverno/subject: "PodDisruptionBudget, Deployment, StatefulSet"
digest: bcb87ac5337aad2386c47726f85247202cdbaca62e62a6e96085adaddb7159e7
digest: f6f12d2b34642666ce110807b85756d86012a840a15f236c53e2a4866347b628
3 changes: 3 additions & 0 deletions other/m-q/pdb-minavailable/pdb-minavailable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ spec:
value:
- CREATE
- UPDATE
- key: "{{ request.object.spec.replicas || `1` }}"
operator: GreaterThan
value: 0
context:
- name: minavailable
apiCall:
Expand Down
32 changes: 26 additions & 6 deletions other/m-q/pdb-minavailable/ss-good.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ metadata:
spec:
selector:
matchLabels:
app: busybox
app: bb1
replicas: 2
template:
metadata:
labels:
app: busybox
app: bb1
spec:
terminationGracePeriodSeconds: 10
containers:
Expand All @@ -25,12 +25,12 @@ metadata:
spec:
selector:
matchLabels:
app: busybox
app: bb2
replicas: 1
template:
metadata:
labels:
app: busybox
app: bb2
spec:
terminationGracePeriodSeconds: 10
containers:
Expand All @@ -45,12 +45,32 @@ metadata:
spec:
selector:
matchLabels:
app: bb
app: bb3
replicas: 1
template:
metadata:
labels:
app: bb
app: bb3
spec:
terminationGracePeriodSeconds: 10
containers:
- name: busbyox
image: busybox:1.35
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: goodss04
namespace: pdb-minavailable-ns
spec:
selector:
matchLabels:
app: bb4
replicas: 0
template:
metadata:
labels:
app: bb4
spec:
terminationGracePeriodSeconds: 10
containers:
Expand Down
Loading