Commit Graph

63 Commits

Author SHA1 Message Date
maximshd
08a2623b8e Properly initialize kubeClient in SetNetworkStatus method (#283)
* Properly initialize kubeClient in SetNetworkStatus method

* Fix typo

* Update error message

* Extend logging for setNetworkStatus function
2019-03-20 08:08:48 -04:00
Tomofumi Hayashi
61416cbd40 Add 'verbose' option to logging minimum information (#275)
This change address #274 to add 'verbose option which outputs
minimum information (for usual runs with a bit information than
'error').
2019-03-07 11:00:46 -05:00
Tomofumi Hayashi
5dc774a547 Caches all pod delegates json for pods deletion without k8s info
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
2019-03-07 23:50:07 +09:00
Doug Smith
0010cd99ff
Merge pull request #236 from hanxueluo/master
fix crash caused by empty delegates when use clusterNetwork
2019-02-26 07:17:36 -05:00
dougbtv
9b41f7635d Allows cmdDel to finish if netns doesn't exist, omits deferred netns.Close() in such a case 2019-02-22 13:54:03 +00:00
Huanle Han
49d55d6f45 fix cmdDel crash when use pod annotation "v1.multus-cni.io/default-network"
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>
2019-02-11 18:18:36 +08:00
Tomofumi Hayashi
f0bc4fb475 Add multusNamespace/systemNamespaces config
This change provides new configuration parameters, multusNamespace
and systemNamespaces for flexible namespace management.
The change addresses issue #252 and issue #253.
2019-02-08 00:25:35 +09:00
Dan Williams
063a3593b8 multus: simplify teardown on add error and clarify error message
Signed-off-by: Dan Williams <dcbw@redhat.com>
2019-02-04 10:55:08 -06:00
Tomofumi Hayashi
6a46d54161 Add version into binary and fix .travis.yml to run forked repo.
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.
2019-01-11 00:00:43 +09:00
dougbtv
8d89700cac [bugfix] Delete all delegates instead of breaking out during deletion loop 2018-11-30 13:41:08 +00:00
Alona Kaplan
f4068d18bd Support IPRequest to specify IP address for interface 2018-11-30 00:16:11 +09:00
Tomofumi Hayashi
d1c8a3d93f Fix the log message. 2018-11-29 15:11:33 +09:00
Alona Kaplan
ec543570b5 Setting the MAC in CNI_ARGS shouldn't override the already existing CNI_ARGS 2018-11-12 17:13:37 +01:00
Tomofumi Hayashi
0812a8f7d7 Fix the way to set MAC. 2018-11-09 00:15:35 +09:00
Tomofumi Hayashi
3b073d7eb6 Add debug messasge for MAC. 2018-11-09 00:15:35 +09:00
Tomofumi Hayashi
deb2f2f64c Support MacRequest to specify MAC address for interface 2018-11-09 00:15:35 +09:00
Tomofumi Hayashi
5871c8744a Add clusterNetwork/defaultNetwork into multus
To support CRD/file/directory, add clusterNetwork/defaultNetwork
in multus.conf file.
2018-11-02 22:54:39 +09:00
Michael Cambria
aa7e000251 Make conflistDel() behave like conflistAdd()
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>
2018-11-02 02:50:28 +09:00
Doug Smith
21cdfe5485 Default network readiness fix conflicts after rebase 2018-10-11 11:27:18 +09:00
Mathieu Rohon
a4f5fd4bf0 Add portmap capability support
Signed-off-by: Mathieu Rohon <mathieu.rohon@orange.com>
2018-10-01 06:48:24 +02:00
rkamudhan
f0f1d506c4 fixing the cmddel fix code 2018-08-17 00:45:05 +01:00
rkamudhan
b01f784504 handling the multiple cmd del call from kubelet 2018-08-17 00:45:05 +01:00
Tomofumi Hayashi
6d3216c340 Add debug log for newly added functions. 2018-08-17 00:43:31 +01:00
Tomofumi Hayashi
7d3626a5c0 Add logging message for debug/error
This changes adds logging message:debug and error. fmt.Errorf() is
wrapped by logging.Errorf() hence all error message is also put to
log file. logging.Debugf() is called at almost function call, so
we could track the code by logging message.
2018-08-17 00:43:31 +01:00
rkamudhan
1ad25a890d adding error checking in network status creation as well 2018-08-01 16:03:25 +01:00
rkamudhan
d71fe3447f fixing multus runtime error for network status without pod network annotation 2018-08-01 16:03:25 +01:00
rkamudhan
8bb09518df adding network status features 2018-07-30 14:58:30 +01:00
rkamudhan
7372922617 adding conflist support 2018-07-27 23:43:17 +01:00
Dan Williams
42e6894962 k8sclient: use InClusterConfig() for kubeclient when run as daemonset
When multus is run inside a container, eg as a daemonset, we can use
InClusterConfig() to automatically get the service account token, the
CA certificate, and the apiserver address, all without a kubeconfig
file.
2018-07-27 12:08:24 +01:00
Dan Williams
ac9e46f712 multus/k8s: allow faking k8s client for unit tests 2018-06-20 18:20:57 +01:00
Dan Williams
f4f6a6cbed multus: rework cmdAdd/Del/Get calling to support testcases 2018-06-20 18:20:57 +01:00
Dan Williams
afa87024eb multus: pass exec interface to invoke package
Will help with unit tests.
2018-06-20 18:20:57 +01:00
Dan Williams
7597640a21 multus: update for CNI 0.7.0-alpha1 release 2018-06-20 18:20:57 +01:00
Dan Williams
92a8b1c1c9 vendor: update containernetworking/cni and add containernetworking/plugins
Updated containernetworking/cni moves pkg/ns to containernetworking/plugins
so we need that now too.
2018-06-20 18:20:57 +01:00
Dan Williams
61d212c59a multus/types: handle delegates as Go structs and other cleanups 2018-06-20 18:20:57 +01:00
Tomofumi Hayashi
ee8bf5785d Following group name changes in github.
This changes to track organization name change in github, from
Intel-Corp to intel.
2018-05-18 15:34:12 +09:00
Tomofumi Hayashi
215ddb5a1d Refine multus config file (masterplugin and always_use_default)
This fix removes 'masterplugin' and 'always_use_default' from
multus config file. default network, defined in
/etc/cni/net.d/*conf should be master and this network should be
used as default from network plumbing working group draft.
2018-05-11 17:39:43 +01:00
kuralamudhan ramakrishnan
fd79ef6505 Code refactoring and including conf dir in the CNI Conf file option
Change-Id: I2b35377356f2144fd3889bf5de7ac430a19edf89
Co-authored-by: Doug Smith <dougbtv@users.noreply.github.com>
Co-authored-by: Tomofumi Hayashi <s1061123@users.noreply.github.com>
Co-authored-by: Dan Williams <dcbw@users.noreply.github.com>
2018-05-09 18:23:08 +01:00
Tomofumi Hayashi
f0794119ba
Add error message for ifname collision (#74)
* Add error message for ifname collision

This changes introduce to validateIfName, to check the validation
for interface name, i.e. same name among two or more interfaces.
2018-05-09 15:33:44 +09:00
Tomofumi Hayashi
4eeb1fa43f Fix default case for CNIDir
In case of no-config for CNIDir, multus-cni does not set
defaultCNIDir into CNIDir hence multus-cni failed to create
container network. This change fixes it.
2018-05-08 15:24:49 +09:00
Tomofumi Hayashi
0bdadc7f39 Fix error type for NoK8sNetworkError
This fix changes type type for NoK8sNetworkError due to error handling, in #45.
Currently NoK8sNetworkError is not pointer type, just a string, hence we never
get *NoK8sNetworkError. This fix changes it based @One-ders patch.
2018-04-24 10:27:48 +01:00
Tomofumi Hayashi
362be285c9 Revert "Fix error type for NoK8sNetworkError"
This reverts commit 3245ed8577, due to
missing pull request process. will file it again as pull request.
2018-04-23 15:49:16 +09:00
Tomofumi Hayashi
3245ed8577 Fix error type for NoK8sNetworkError
This fix changes type type for NoK8sNetworkError due to error handling, in #45.
Currently NoK8sNetworkError is not pointer type, just a string, hence we never
get *NoK8sNetworkError. This fix changes it based @One-ders patch.
2018-04-23 15:48:04 +09:00
kuralamudhan ramakrishnan
f0a7612ebd code refractoring with separate k8s-client package
bug fix for #56 & #57

Change-Id: If4f3db4dd01ca3330d5d36b8a2e4c5740def910a
Co-authored-by: Doug Smith <dougbtv@users.noreply.github.com>
Co-authored-by: Tomofumi Hayashi <s1061123@users.noreply.github.com>
Co-authored-by: Dan Williams <dcbw@users.noreply.github.com>
2018-04-21 16:09:17 +01:00
kuralamudhan ramakrishnan
122dbfb345 adding type package in multus 2018-04-18 09:20:54 +01:00
Doug Smith
ceef90f8b6
Merge pull request #11 from redhat-nfvpe/dev/default_network
[npwg] Prototype for default network
2018-04-06 13:11:58 -04:00
dougbtv
dc111cbdac [npwg] Prototype for default network, addresses #2 2018-04-04 14:54:41 -04:00
Tomofumi Hayashi
ebb19edfc3 Prototype for namespace support, addresses #15 2018-04-03 16:09:46 +09:00
Tomofumi Hayashi
393d5f47e5 Add 'go fmt', golint and 'go vet' in CI
This change introduces go fmt/golint/go vet in CI pipeline to check
the code for each commit. In addition, this change changes code
to pass these checks.
2018-04-03 15:18:47 +09:00
Tomofumi Hayashi
8f7c57b22b Merge remote-tracking branch 'origin/develop' into dev/add_if_name 2018-03-23 15:19:54 +09:00