Commit Graph

12 Commits

Author SHA1 Message Date
Kir Kolyshkin a263ddda2d Fix typos found by codespell
Brought to you by

	make codespell

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2022-03-30 11:13:44 -07:00
Valentin Rothberg 095aded91c go fmt: use go 1.18 conditional-build syntax
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-03-18 11:04:40 +01:00
Paul Holzinger 60766b5e5e libnetwork: create pick subnets from subnet pool
When we create a bridge network and no subnet is given we will a free
one automatically. The current logic just took the first free /24
network after 10.89.0.0. Now we will instead use the default subnet pool
from containers.conf. The default value is still the same but users can
change it if they want. This also fixes a problem where podman network
create could pick a public ipv4 network when all 10.0.0.0/8 networks
were already used. Now it will error if no free subnet is found in the
subnet pools.

Fixes #930

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-02-15 15:30:42 +01:00
Paul Holzinger ff12fff79f netavark: add support for dns with internal
netavark + aardvark support this when we add a gateway ip to the config
so that aardvark can use this address to bind on it.
We only add the gateway when not internal or when dns is enabled. If
internal without dns we do not need the gw address.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-02-04 14:27:26 +01:00
Paul Holzinger 16febcdabe netavark: use aardvark-dns path from containers.conf
We need to use the configured path from containers.conf for the
aardvark-dns binary location.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-01-25 16:06:56 +01:00
Daniel J Walsh 3e33e53044 Run codespell on code
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-01-21 07:47:02 -05:00
Aditya R efe9d6bce1 libnetwork: support rootless network with netavark and relay runRoot with tmpfs
* Tells netavark if invocation is for `rootful` or `rootless`
  containers.
* Pass `tmpfs` based runRoot to netavark so it can write/read configs
  from there.

Signed-off-by: Aditya R <arajan@redhat.com>
2022-01-19 22:50:17 +05:30
Paul Holzinger c0ddc35864 libnetwork: add method to get the default network name
While we can store the default network name outside this network
interface it can become out of sync with the interface.

In buildah it can be useful to get the name from the interface.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-01-05 22:08:38 +01:00
Paul Holzinger 588325c4ae libnetwork: netavark use runrooot for ipam db
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>
2022-01-04 15:46:23 +01:00
Paul Holzinger 8893b57c6e libnetwork: remove unneeded Lockfile argument
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>
2022-01-04 15:46:23 +01:00
Paul Holzinger 4fcb18dca7 libnetwork: fix lint errors
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-12-17 14:24:21 +01:00
Paul Holzinger 002673d22f add libnetwork package
Copy the libpod/network packages from podman to here so we can use the
same code in buildah as well.

This is mostly a one to one copy only the import paths have been changed
and some errors were added.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-12-16 19:07:38 +01:00