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

libnetwork: add function to get the default network backend #872

Merged

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Jan 3, 2022

When the network backend is unset in the config we have to to figure out
if we need CNI or netavark. New installs should use netavark while
existing installs should continue to use CNI to prevent breaking
systems.

We use the following conditions to determine what backend to use:

  1. read ${graphroot}/defaultNetworkBackend
  2. find netavark binary (if not installed use CNI)
  3. check containers, images and CNI networks and if there are some
    we have an existing install and should continue to use CNI

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 3, 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

@openshift-ci openshift-ci bot added the approved label Jan 3, 2022
@Luap99 Luap99 force-pushed the default-network-interface branch 2 times, most recently from 1df9945 to 2fce8d4 Compare January 3, 2022 16:16
@Luap99 Luap99 marked this pull request as ready for review January 4, 2022 14:23
@Luap99
Copy link
Member Author

Luap99 commented Jan 4, 2022

@mheon @baude @rhatdan @flouthoc PTAL

@Luap99
Copy link
Member Author

Luap99 commented Jan 4, 2022

I also added this to containers/podman#12642 but it looks like there is some not networking related regression in c/common which is causing failures in podman.

When the network backend is unset in the config we have to to figure out
if we need CNI or netavark. New installs should use netavark while
existing installs should continue to use CNI to prevent breaking
systems.

We use the following conditions to determine what backend to use:
1. read ${graphroot}/defaultNetworkBackend
2. find netavark binary (if not installed use CNI)
3. check containers, images and CNI networks and if there are some
   we have an existing install and should continue to use CNI

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
If the caller can decide the lockfile path it is just more likely that
there is a lock missmatch due different lock names. We should always
just use the config dir and use a lock with a static name.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
We should not use XDG_RUNTIME_DIR for the ipam db. This directory is
shared but we need the ipam db per storage. We can use the runroot for
this. It should be a tmpfs to reset the ipam assignments after a reboot.

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

rhatdan commented Jan 4, 2022

LGTM

The HardwareAddr type must bbe the actual value and not a pointer
otherwise the marshal logic will not use this function. Added a test to
confirm that this works.

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

baude commented Jan 5, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Jan 5, 2022
@openshift-merge-robot openshift-merge-robot merged commit ad5932c into containers:main Jan 5, 2022
@Luap99 Luap99 deleted the default-network-interface branch January 5, 2022 19:24
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.

5 participants