[WIP] hco, net: Disable HCO network-resources-injector when SR-IOV deploys its own - #369
[WIP] hco, net: Disable HCO network-resources-injector when SR-IOV deploys its own#369nirdothan wants to merge 1 commit into
Conversation
Both the SR-IOV Network Operator and HCO can deploy a network-resources-injector mutating webhook. Having both active does not cause conflicts, but is wasteful. In such cases, it is better to keep the SR-IOV webhook and disble the HCO one, as the former has a wider scope of operation whereas the later only intercepts virt-launcher pods. Set HCO spec.deployment.deployNetworkResourcesInjector to false whenever SriovOperatorConfig/default has spec.enableInjector=true. When SR-IOV's injector is disabled (or its CRD is absent) the field is left unmanaged so HCO reverts to its own default via SSA ownership release. Reading a boolean from an arbitrary live object had no template helper, so add objectFieldBool and the accompanying static RBAC read on sriovoperatorconfigs. Signed-off-by: Nir Dothan <ndothan@redhat.com> Assisted by: Claude Sonnet 4.5 <noreply@anthropic.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @nirdothan. Thanks for your PR. I'm waiting for a openshift-virtualization member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
/cc @tiraboschi Checking the direction, looking for feedback.
|
|
/cc @orelmisan |
|
@nirdothan: GitHub didn't allow me to request PR reviews from the following users: orelmisan. Note that only openshift-virtualization members and repo collaborators can review this PR, and authors cannot review their own PRs. DetailsIn response to this:
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. |
|
/ok-to-test |
| {{- if objectFieldBool "sriovnetwork.openshift.io/v1" "SriovOperatorConfig" "sriov-network-operator" "default" "spec.enableInjector" }} | ||
| spec: | ||
| deployment: | ||
| deployNetworkResourcesInjector: false | ||
| {{- else }} | ||
| spec: {} | ||
| {{- end }} |
There was a problem hiding this comment.
HCO CR is ideally the entry-point for autopilot, not one of the managed assets. Can't we do the opposite and control SRIOV Operator setting spec.enableInjector: false there when we have the CNV one?
There was a problem hiding this comment.
No we can't. Especially because if any bugs or issues occur in sriov-operator, we don't want us to be responsible for switching off their injector.
But also, because they are not identical: we only target virt-launcher pods and they target all pods. This leaves out sriov pods that are not CNV.
|
PR needs rebase. DetailsInstructions 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. |
Both the SR-IOV Network Operator and HCO can deploy a network-resources-injector mutating webhook. Having both active does not cause conflicts, but is wasteful. In such cases, it is better to keep the SR-IOV webhook and disbles the HCO one, as the former has a wider scope of operation whereas the later only intercepts virt-launcher pods.
Set HCO spec.deployment.deployNetworkResourcesInjector to false whenever SriovOperatorConfig/default has spec.enableInjector=true. When SR-IOV's injector is disabled (or its CRD is absent) the field is left unmanaged so HCO reverts to its own default via SSA ownership release.
Reading a boolean from an arbitrary live object had no template helper, so add objectFieldBool and the accompanying static RBAC read on sriovoperatorconfigs.