Test the fallbacks of WebhookSelectsNamespace #3672
Hi @a1h8. Thanks for your PR.
I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.
>[!TIP]
>We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
I understand the commands that are listed here.
<details>
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
</details>
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 85.47%. Comparing base (
14d2ca8) to head (7568c33).:warning: Report is 11 commits behind head on main.
<details><summary>Additional details and impacted files</summary>
@@ Coverage Diff @@
## main #3672 +/- ##
==========================================
+ Coverage 85.39% 85.47% +0.07%
==========================================
Files 203 205 +2
Lines 21279 21650 +371
==========================================
+ Hits 18172 18506 +334
- Misses 3103 3140 +37
Partials 4 4
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
</details>
/ok-to-test
Thanks!
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: <a href="https://github.com/kubernetes-sigs/security-profiles-operator/pull/3672#" title="Author self-approved">a1h8</a>, <a href="https://github.com/kubernetes-sigs/security-profiles-operator/pull/3672#pullrequestreview-5796555559" title="Approved">saschagrunert</a>
The full list of commands accepted by this bot can be found here.
The pull request process is described here
<details >
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
</details>
<!-- META={"approvers":[]} -->
saschagrunert
a1h8
What type of PR is this?
/kind cleanup
What this PR does / why we need it
WebhookSelectsNamespacedecides whether a profile binding applies to anamespace, but its fallbacks had no test coverage. This adds a table test
for each branch:
NamespaceSelectorcounts as selectedMutatingWebhookConfigurationcounts as selectedfalsewith the errorfalsewith the error, the onlybranch that fails closed
The failed lookups use
interceptor.FuncsonGet, the invalid selectorworks with the fake client as is.
Which issue(s) this PR fixes
Fixes #3654
Does this PR have test?
Yes, it only adds unit tests.
Special notes for your reviewer
None
Does this PR introduce a user-facing change?
``
release-note
``NONE