RuntimeConfig depends on the delegate configuration. The Netconf runtime
information should be merged with the delegate config and the result
added to each command that is sent to the delegates. That was being done
for all commands except for delPlugins.
Do not export MergeCNIRuntimeConfig and call it from
CreateCNIRuntimeConf that now accepts a delegate ptr.
Call it from delPlugins for each delegate
Signed-off-by: Billy McFall <22157057+Billy99@users.noreply.github.com>
Move Multus to use latest network-attachment-definition-client repo which
contains the device-info-spec changes.
Signed-off-by: Billy McFall <22157057+Billy99@users.noreply.github.com>
it can happen that a CNI Add operation is canceled because the
runtime sends a CNI Del too fast, so the pod was already deleted
when multus try to set the network status annotations.
Since multus is an executable and can not persist state, it can't
track the CNI requests that are done in parallel, but it can
assume that, if it was able to get the pod from the API, and in a
subsequent request the pod no longer exists, it is because it was
deleted.
Signed-off-by: Antonio Ojea <aojea@redhat.com>
This change introduces gopkg.in to allow everyone to use multus
code as library. Currently multus-cni uses version 'v3', hence
it hits go modules limitation, as #504 describes.
This change fix#504 with gopkg.in.
In cmdCheck and cmdDelete debug messages are logged even before logger
is initialized with its log level and file (done in types.LoadNetConf).
Because of this those debug messages are not logged into the file.
Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>
This changes introduce CNI RuntimeConfig for portmap, bandwidth,
ip and mac for latest specification. IP and Mac is previously
applied through CNI_ARGS, but it is changed to RuntimeConfig
for now.
This change introduces two fix about CNIVersion. One is to add CNIVersion into
delegated CNI conflist in case of DEL if CNIVersion is missing. ParseVersion() in libcni
checks cniVersion as mandatory field and sometimes user/daemonset miss it.
The latest flannel daemonset yaml (of flannel github) does not have CNIVersion, for example.
This change adds CNIVersion from multus config if cniVersion is missing (empty) in delegated
CNI config.
In addition, this fix also adds '--cni-version' in entrypoint.sh to add cniVersion in multus
config in case of '--multus-conf-file=auto'.
K8s with docker runtime, cmdDel() is invoked with empty network
namespace in case of restart node. Currently multus just returns
but CNI spec mention that we should invoke CNI plugin to cleanup.
This PR deletes "return nil" and proceeds to invoke CNI plugins
DEL. Fix#323.
This fixes#243 with following changes:
+ Optimize to fetch Pod from k8s client
+ Change to use cache always in DEL.
+ If failed to fetch the pod info from k8s clinet in deletion,
use cached delegates as emergency bailout
+ Add test cases for cache
Crash happens in code line `conf.Delegates[0] = delegate` in function TryLoadPodDelegates,
because len(conf.Delegates) is 0.
Signed-off-by: Huanle Han <hanhuanle@caicloud.io>
This change provides new configuration parameters, multusNamespace
and systemNamespaces for flexible namespace management.
The change addresses issue #252 and issue #253.
This changes introduce goreleaser, which does cross-compile and
package, as well as add version into go code. This change also
changes .travis.yml to allow to other users' forked repo.
conflistAdd() finds binaries differently than conflistDel().
Make the two call find binaries the same way.
Fixes#179
Signed-off-by: Michael Cambria <mcambria@redhat.com>