kubewarden / kubewarden-controller

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

refactor: certificates generation package and secrets #777

Closed fabriziosestito closed 3 days ago

fabriziosestito commented 1 week ago

Description

This PR refactors the generation utilities in the admissionregistration package, removing duplication and simplifying the current implementation. It renames admissionregistration in certs and reactors the existing reconciler unit test in integration tests clauses.

Additional info

Fixes: #775, #664

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 81.57895% with 14 lines in your changes missing coverage. Please review.

Project coverage is 72.97%. Comparing base (e3750b2) to head (c5a217e).

Files Patch % Lines
internal/pkg/admission/policy-server-ca-secret.go 73.33% 6 Missing and 2 partials :warning:
internal/pkg/certs/certs.go 86.36% 3 Missing and 3 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #777 +/- ## ========================================== - Coverage 74.05% 72.97% -1.09% ========================================== Files 28 26 -2 Lines 1808 1780 -28 ========================================== - Hits 1339 1299 -40 - Misses 353 366 +13 + Partials 116 115 -1 ``` | [Flag](https://app.codecov.io/gh/kubewarden/kubewarden-controller/pull/777/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/777/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kubewarden) | `60.61% <81.57%> (-1.28%)` | :arrow_down: | | [unit-tests](https://app.codecov.io/gh/kubewarden/kubewarden-controller/pull/777/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kubewarden) | `37.87% <0.00%> (-12.33%)` | :arrow_down: | 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.

fabriziosestito commented 4 days ago

@flavio I've addressed the comments in https://github.com/kubewarden/kubewarden-controller/pull/777/commits/c3cbdf4e9759e6e0fa2900d2343bcde0865cfe43.

I tracked all the naming-related comments in: https://github.com/kubewarden/kubewarden-controller/issues/782

fabriziosestito commented 4 days ago

Blocked: waiting for 1.14 release