Remove dead code from pkg/kubelet/...

This commit is contained in:
Tim Allclair
2019-08-08 13:25:30 -07:00
parent 90df64b75b
commit 3f510c69f6
20 changed files with 15 additions and 108 deletions

View File

@@ -31,27 +31,15 @@ import (
pluginwatcherapi "k8s.io/kubernetes/pkg/kubelet/apis/pluginregistration/v1"
registerapi "k8s.io/kubernetes/pkg/kubelet/apis/pluginregistration/v1"
"k8s.io/kubernetes/pkg/kubelet/config"
"k8s.io/kubernetes/pkg/kubelet/pluginmanager/cache"
"k8s.io/kubernetes/pkg/kubelet/pluginmanager/pluginwatcher"
)
const (
testHostname = "test-hostname"
)
var (
socketDir string
deprecatedSocketDir string
supportedVersions = []string{"v1beta1", "v1beta2"}
)
// fake cache.PluginHandler
type PluginHandler interface {
ValidatePlugin(pluginName string, endpoint string, versions []string, foundInDeprecatedDir bool) error
RegisterPlugin(pluginName, endpoint string, versions []string) error
DeRegisterPlugin(pluginName string)
}
type fakePluginHandler struct {
validatePluginCalled bool
registerPluginCalled bool
@@ -113,20 +101,6 @@ func cleanup(t *testing.T) {
os.MkdirAll(deprecatedSocketDir, 0755)
}
func newWatcher(
t *testing.T, testDeprecatedDir bool,
desiredStateOfWorldCache cache.DesiredStateOfWorld) *pluginwatcher.Watcher {
depSocketDir := ""
if testDeprecatedDir {
depSocketDir = deprecatedSocketDir
}
w := pluginwatcher.NewWatcher(socketDir, depSocketDir, desiredStateOfWorldCache)
require.NoError(t, w.Start(wait.NeverStop))
return w
}
func waitForRegistration(t *testing.T, fakePluginHandler *fakePluginHandler) {
err := retryWithExponentialBackOff(
time.Duration(500*time.Millisecond),