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 webhook for virtual workers #198

Merged

Conversation

SchSeba
Copy link
Collaborator

@SchSeba SchSeba commented Oct 28, 2021

this commit fix the validation webhook to support virtual workers using PCI passthrough

Signed-off-by: Sebastian Sch [email protected]

@SchSeba SchSeba requested a review from zshi-redhat October 28, 2021 13:48
@@ -285,5 +285,11 @@ func validateNicModel(selector *sriovnetworkv1.SriovNetworkNicSelector, iface *s
if sriovnetworkv1.IsSupportedModel(iface.Vendor, iface.DeviceID) {
return true
}

// if running on shiftstack and requested a netfilter check if the device ID for the VF is in supported list are allowed.
if selector.NetFilter != "" && selector.NetFilter == iface.NetFilter && sriovnetworkv1.IsVfSupportedModel(iface.Vendor, iface.DeviceID) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is netfilter always used in shift on stack?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that is the case @atyronesmith please confirm

Copy link
Contributor

@atyronesmith atyronesmith Oct 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sriov, it should be used. However, it is not strictly required. I thought about suggesting the use of virtual flag (passing it during process creation), but I went for simplicity. Maybe it would be better to use the virtual flag as the decision point for using the third column.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The more I think about it, I am convincing myself that the webhook process should use the virtual flag and that selector.Netfilter != "" should not be used as the deciding factor.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the virtual flag?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My fault. I forgot that the webhook doesn't include 'platformType' as it's not a daemon. PlatformType is set by looking for the network_data.json file on the workers. I guess a similar mechanism would need to be used for the webhook.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@atyronesmith can you give it another look please I use the node to check the environment

Copy link
Contributor

@atyronesmith atyronesmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reserving for a discussion...

@SchSeba SchSeba force-pushed the fix_webhook_for_shift_stack branch from a8a1b9c to 53c0db3 Compare October 31, 2021 12:54
this commit fix the validation webhook to support virtual workers using
PCI passthrough

Signed-off-by: Sebastian Sch <[email protected]>
@SchSeba SchSeba force-pushed the fix_webhook_for_shift_stack branch from 53c0db3 to 8f4d42f Compare October 31, 2021 12:55
@zshi-redhat
Copy link
Collaborator

The new version looks good to me.

Copy link
Contributor

@atyronesmith atyronesmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@pliurh pliurh merged commit a9c2b5a into k8snetworkplumbingwg:master Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants