Commit Graph

10 Commits

Author SHA1 Message Date
Lucas Pablo Calisi 4a929deddf fix(libnetwork): interface name length validation
Implements interface name length validation during network creation to prevent
netlink errors when names exceed the kernel's 15-character limit.

This prevents creation of networks with interface names that would cause failures
when running containers.

Signed-off-by: Lucas Pablo Calisi <lucas.calisi@mercadolibre.com>
2025-03-20 11:02:13 -03:00
Paul Holzinger 805e7ae406 update golangci-lint to 1.60.3
Contains fixes for new linters, removed depracted and removed linters
from the config.

Most notably because we use go 1.22 now we can get rid of the copy for
loop vars[1]. Also as of the go 1..2 we can use the new int range syntax
in for loops the new intrange linter checks that.

[1] https://go.dev/blog/loopvar-preview

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-09-03 15:57:02 +02:00
Paul Holzinger d240865a45 lint: update golangci-lint to v1.56.2
Adds a couple of new linters with many new warnings:
- perfsprint (fixed in code, excluded for tests)
- revive (fix the problems, disabled the dot import check as we use it
  for ginkgo)
- inamedparam (disabled because it is opinionated)
- testifylint (great linter but we have like 1000+ issues that I have no
  time fixing now)

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-03-05 18:10:32 +01:00
Jan Hendrik Farr 97e2561e60 add static routes
Signed-off-by: Jan Hendrik Farr <github@jfarr.cc>
2023-05-24 10:11:08 +00:00
Sascha Grunert 426d69c00f Switch to golang native error wrapping
`github.com/pkg/errors` is deprecated since quite some time so we now
use the native error wrapping for more idiomatic golang.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-07-12 10:54:07 +02:00
Paul Holzinger 111b33c197 libnetwork: export "driver" as constant
It is better to use a global const than having to type "driver" at every
place.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-03-17 14:11:34 +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 774087c6a7 libnetwork: only validate static ip when ipam is host-local
If the dhcp ipam driver is used podman does not know any subnets so we
cannot verify if the given static ip is in the subnet.

Fixes containers/podman#12762

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-01-10 16:29:38 +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