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

add netavark plugin support #509

Merged
merged 8 commits into from Apr 4, 2023
Merged

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Nov 29, 2022

Add a plugin system for netavark,
check the plugin-API.md file for a description.

see commits for details

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 29, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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

@b-m-f
Copy link

b-m-f commented Jan 11, 2023

Hi @Luap99,

happy new year. Hows the progress on this?
Should I start taking a deeper look to port over the WireGuard setup to the new plugin architecture?

@Luap99
Copy link
Member Author

Luap99 commented Jan 11, 2023

@b-m-f Sorry I have a lot going on at the moment, I try to get back to this soon. I will talk with the team to see how we can proceed with your PR.

@Luap99
Copy link
Member Author

Luap99 commented Jan 18, 2023

@baude @mheon @flouthoc PTAL

@mheon
Copy link
Member

mheon commented Jan 18, 2023

Can the WIP be dropped?

@Luap99
Copy link
Member Author

Luap99 commented Jan 18, 2023

Can the WIP be dropped?

I want to make sure this is not merged yet, I still need to test with c/common and podman. Also if we plan to do another release this week this should wait for the next one.
This code here is done I only plan to add some further documentation.

@b-m-f
Copy link

b-m-f commented Feb 1, 2023

@Luap99 should I start rebasing thr WireGuard changes onto this branch?

Im also wondering what to do about my PRs in the podman and containers/common repos.
Will they stay relevant when using the plugin system or will there be a new way of passing data down to netavark Plugins?

@b-m-f
Copy link

b-m-f commented Mar 22, 2023

@Luap99 , any updates?
Also not sure whether I should keep on rebasing #472 onto main?

Luap99 added a commit to Luap99/common that referenced this pull request Mar 30, 2023
Users can now suplly custom network drivers which will execute the
netavark plugin to create the network. Netavark will execute the pluign
to setup/teardown the netns.
see containers/netavark#509

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
@Luap99 Luap99 force-pushed the plugin branch 2 times, most recently from a33d6d6 to f23b1d1 Compare March 30, 2023 16:29
@Luap99 Luap99 changed the title WIP: add netavark plugin support add netavark plugin support Mar 30, 2023
@Luap99 Luap99 marked this pull request as ready for review March 30, 2023 16:29
@Luap99
Copy link
Member Author

Luap99 commented Mar 30, 2023

@b-m-f Please keep your PR rebased on main.

@mheon @flouthoc @baude PTAL, this should be ready from my side.

Luap99 added a commit to Luap99/common that referenced this pull request Mar 30, 2023
Netavark needs to get the actual list of directories from podman because
users can set them in contianers.conf.

Note that this change requires a netavark with
containers/netavark#509

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Luap99 added a commit to Luap99/common that referenced this pull request Apr 3, 2023
Users can now suplly custom network drivers which will execute the
netavark plugin to create the network. Netavark will execute the pluign
to setup/teardown the netns.
see containers/netavark#509

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Luap99 added a commit to Luap99/common that referenced this pull request Apr 3, 2023
Netavark needs to get the actual list of directories from podman because
users can set them in contianers.conf.

Note that this change requires a netavark with
containers/netavark#509
To allow better backwards compat we only pass the new argument when we
need. Also added the missing ipvlan driver to the supported driver list.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
@Luap99
Copy link
Member Author

Luap99 commented Apr 4, 2023

@flouthoc @mheon @baude reping

Add a function to move an interface in a new netns.

This will be needed by the example plugin which I will add in the
folloing commits.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Add a function to return the addresses for all interfaces in the
namespace.

This will be used by the example plugin.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Add a rust plugin trait which can be used to create plugins without any
extra boilerplate code. See the following commits for an example of how
to use this.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
plugin-API.md Outdated Show resolved Hide resolved
@baude
Copy link
Member

baude commented Apr 4, 2023

this is great work ... LGTM thanks @Luap99

Create a simple netavark plugin which is used to move a host interface
into the contianer interface.

Use the examples make target to compile it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Make a plugin which always errors to test failure paths.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This contains the core netavark logic to actually execute custom plugins.
This adds a new --plugin-directory option which can be set multiple
times to give a list of directories that will be searched for the
plugin.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Plugins are allowed to log on stderr, add a small pluign to test it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Luap99 added a commit to Luap99/common that referenced this pull request Apr 4, 2023
Users can now suplly custom network drivers which will execute the
netavark plugin to create the network. Netavark will execute the pluign
to setup/teardown the netns.
see containers/netavark#509

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Luap99 added a commit to Luap99/common that referenced this pull request Apr 4, 2023
Netavark needs to get the actual list of directories from podman because
users can set them in contianers.conf.

Note that this change requires a netavark with
containers/netavark#509
To allow better backwards compat we only pass the new argument when we
need. Also added the missing ipvlan driver to the supported driver list.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
@mheon
Copy link
Member

mheon commented Apr 4, 2023

/lgtm

Nice work.

@openshift-ci openshift-ci bot added the lgtm label Apr 4, 2023
@openshift-merge-robot openshift-merge-robot merged commit 258951c into containers:main Apr 4, 2023
24 checks passed
@Luap99 Luap99 deleted the plugin branch April 4, 2023 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants