Existing code uses "/run/netns"
|
const bindMountPath = "/run/netns" /* Bind mount path for named netns */ |
However, iproute
https://github.com/iproute2/iproute2/blob/d2a8ffe85ac64f91ee2aa7679a5046f321b54127/include/namespace.h#L13
#ifndef NETNS_RUN_DIR
#define NETNS_RUN_DIR "/var/run/netns"
and the man page https://man7.org/linux/man-pages/man8/ip-netns.8.html use "/var/run/netns"
I understand that changing this constant will cause compatibility issues since it will be almost sure someone depends on that behavior but as today all the *[By|From]Name functions does not work on the systems that does not use "/run/netns" , specially on Kubernetes systems that mounts the host path on a Pod, and use the iproute convention for portability
I do not know what will be the best solution, but I'm just documenting it, since it took me one hour of debugging to figure out and this can save some other peoples time :)
Existing code uses "/run/netns"
netns/netns_linux.go
Line 24 in 596a397
However,
iproutehttps://github.com/iproute2/iproute2/blob/d2a8ffe85ac64f91ee2aa7679a5046f321b54127/include/namespace.h#L13
and the man page https://man7.org/linux/man-pages/man8/ip-netns.8.html use "/var/run/netns"
I understand that changing this constant will cause compatibility issues since it will be almost sure someone depends on that behavior but as today all the *[By|From]Name functions does not work on the systems that does not use "/run/netns" , specially on Kubernetes systems that mounts the host path on a Pod, and use the
iprouteconvention for portabilityI do not know what will be the best solution, but I'm just documenting it, since it took me one hour of debugging to figure out and this can save some other peoples time :)