kubewarden / kubewarden-controller

Manage admission policies in your Kubernetes cluster with ease
https://kubewarden.io
Apache License 2.0
182 stars 30 forks source link

feat: add PDB fields in the policy server spec. #698

Closed jvanz closed 2 months ago

jvanz commented 3 months ago

Description

Adds two new fields in the PolicyServerSpec: minAvailable and maxUnavailable. These fields are used to create a PodDisruptionBudget for the policy server pods. Both fields cannot be set together because Kubernetes does not allow setting both together in the PDB spec.

Fix https://github.com/kubewarden/kubewarden-controller/issues/692

Test

make test

NOTE: this is a draft PR because I would like to make it "ready for review" together with the Helm chart changes. However, you can review it already.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 66.66667% with 17 lines in your changes are missing coverage. Please review.

Project coverage is 50.56%. Comparing base (3fa9744) to head (91159f2).

Files Patch % Lines
internal/pkg/admission/reconciler.go 0.00% 11 Missing :warning:
...g/admission/policy-server-pod-disruption-budget.go 84.21% 3 Missing and 3 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #698 +/- ## ========================================== - Coverage 50.91% 50.56% -0.35% ========================================== Files 26 27 +1 Lines 1970 2021 +51 ========================================== + Hits 1003 1022 +19 - Misses 866 891 +25 - Partials 101 108 +7 ``` | [Flag](https://app.codecov.io/gh/kubewarden/kubewarden-controller/pull/698/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kubewarden) | Coverage Δ | | |---|---|---| | [integration-tests](https://app.codecov.io/gh/kubewarden/kubewarden-controller/pull/698/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kubewarden) | `68.61% <ø> (-3.14%)` | :arrow_down: | | [unit-tests](https://app.codecov.io/gh/kubewarden/kubewarden-controller/pull/698/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kubewarden) | `44.97% <66.66%> (+0.74%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kubewarden#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.