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

Conversation

erikgb
Copy link
Contributor

@erikgb erikgb commented Nov 3, 2023

Related Issue(s)

Slack-thread: https://kubernetes.slack.com/archives/CLGR9BJU9/p1698916081905549

Description

This PR adds another precondition to pdb-minavailable-check policy - to ensure that 0 replicas workloads are not denied by the policy. We added this policy to our clusters and experienced a lot of false-positives on workloads with replicas: 0, and no PDBs in namespace. I think this happens because the context variable defaults to 0.

Checklist

  • I have read the policy contribution guidelines.
  • I have added test manifests and resources covering both positive and negative tests that prove this policy works as intended.
  • I have added the artifacthub-pkg.yml file and have verified it is complete and correct.

@chipzoller
Copy link
Contributor

Thanks for this! We do need DCO sign-off on all commits though.

@erikgb erikgb force-pushed the fix-pdb-minavailable-check-replicas-0 branch from 4bab978 to 65f920d Compare November 3, 2023 13:00
@chipzoller chipzoller self-requested a review November 3, 2023 13:30
@chipzoller chipzoller merged commit dca9803 into kyverno:main Nov 3, 2023
112 checks passed
erikgb added a commit to erikgb/policies that referenced this pull request Nov 3, 2023
erikgb added a commit to erikgb/policies that referenced this pull request Nov 3, 2023
chipzoller pushed a commit that referenced this pull request Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants