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: do not exit when k8s' matchConditions are not available #901

Conversation

flavio
Copy link
Member

@flavio flavio commented Oct 1, 2024

Do not exit with an error when the matchConditions field is not available for ValidatingWebhookConfiguration and MutatingWebhookConfiguration.

The code is already structured to work when this feature is not available, hence we don't have to cause the controller to exit with an
error.

Fixes #900

Do not exit with an error when the `matchConditions` field is not
available for ValidatingWebhookConfiguration and
MutatingWebhookConfiguration.

The code is already structured to work when this feature is not
available, hence we don't have to cause the controller to exit with an
error.

Fixes kubewarden#900

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
@flavio flavio requested a review from a team as a code owner October 1, 2024 11:18
@flavio flavio self-assigned this Oct 1, 2024
@flavio flavio added the kind/bug label Oct 1, 2024
@flavio
Copy link
Member Author

flavio commented Oct 1, 2024

CC @williamlin-suse

Copy link

codecov bot commented Oct 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.65%. Comparing base (4be87f4) to head (f05f8aa).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #901      +/-   ##
==========================================
+ Coverage   70.53%   70.65%   +0.11%     
==========================================
  Files          30       30              
  Lines        2559     2559              
==========================================
+ Hits         1805     1808       +3     
+ Misses        584      582       -2     
+ Partials      170      169       -1     
Flag Coverage Δ
integration-tests 60.43% <ø> (+0.11%) ⬆️
unit-tests 39.21% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@flavio flavio merged commit 5a4df6b into kubewarden:main Oct 1, 2024
9 checks passed
@flavio flavio deleted the do-not-exit-when-admission-match-conditions-are-not-available branch October 1, 2024 11:26
@viccuad
Copy link
Member

viccuad commented Oct 1, 2024

For completion, the check performed in CheckAdmissionWebhookMatchConditions() may fail indeed, as we are using OpenAPIV3 to query the cluster. This Kubernetes feature is alpha since 1.23 (and may not be enabled), yet only GA since 1.27. But we shouldn't halt indeed if there's an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Kubewarden fails to run on k8s 1.23
3 participants