From a2e583a86cf01f8ae1a237f888aafcd7c67a8b60 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Fri, 9 Sep 2016 11:38:52 +0100 Subject: [PATCH] Move default directory for exec plugin into exec plugin --- pkg/apis/componentconfig/v1alpha1/defaults.go | 5 ----- pkg/kubelet/network/exec/exec.go | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/apis/componentconfig/v1alpha1/defaults.go b/pkg/apis/componentconfig/v1alpha1/defaults.go index b06b766c99b..72736b22254 100644 --- a/pkg/apis/componentconfig/v1alpha1/defaults.go +++ b/pkg/apis/componentconfig/v1alpha1/defaults.go @@ -249,11 +249,6 @@ func SetDefaults_KubeletConfiguration(obj *KubeletConfiguration) { if obj.MinimumGCAge == zeroDuration { obj.MinimumGCAge = unversioned.Duration{Duration: 0} } - // For backwards-compat NetworkPluginDir is consulted as source of CNI config - // but CNIConfDir is preferred; don't set this default if CNI is in use. - if obj.NetworkPluginDir == "" && obj.NetworkPluginName != "cni" { - obj.NetworkPluginDir = "/usr/libexec/kubernetes/kubelet-plugins/net/exec/" - } if obj.NonMasqueradeCIDR == "" { obj.NonMasqueradeCIDR = "10.0.0.0/8" } diff --git a/pkg/kubelet/network/exec/exec.go b/pkg/kubelet/network/exec/exec.go index 9eb33738e45..e0d813627a9 100644 --- a/pkg/kubelet/network/exec/exec.go +++ b/pkg/kubelet/network/exec/exec.go @@ -85,11 +85,16 @@ const ( setUpCmd = "setup" tearDownCmd = "teardown" statusCmd = "status" + defaultDir = "/usr/libexec/kubernetes/kubelet-plugins/net/exec/" ) func ProbeNetworkPlugins(pluginDir string) []network.NetworkPlugin { execPlugins := []network.NetworkPlugin{} + if pluginDir == "" { + pluginDir = defaultDir + } + files, _ := ioutil.ReadDir(pluginDir) for _, f := range files { // only directories are counted as plugins