Retire mount.Exec for k8s.io/utils/exec

This patch removes mount.Exec entirely and instead uses the common
utility from k8s.io/utils/exec.

The fake exec implementation found in k8s.io/utils/exec differs a bit
than mount.Exec, with the ability to pre-script expected calls to
Command.CombinedOutput(), so tests that previously relied on a callback
mechanism to produce specific output have been updated to use that
mechanism.
This commit is contained in:
Travis Rhoden
2019-10-10 11:27:54 -06:00
parent e7ce8d8a6f
commit 367f879131
53 changed files with 449 additions and 324 deletions

View File

@@ -38,6 +38,8 @@ import (
"k8s.io/client-go/tools/record"
cloudprovider "k8s.io/cloud-provider"
"k8s.io/klog"
"k8s.io/utils/exec"
"k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/util/mount"
"k8s.io/kubernetes/pkg/volume/util/hostutil"
@@ -437,7 +439,7 @@ type VolumeHost interface {
DeleteServiceAccountTokenFunc() func(podUID types.UID)
// Returns an interface that should be used to execute any utilities in volume plugins
GetExec(pluginName string) mount.Exec
GetExec(pluginName string) exec.Interface
// Returns the labels on the node
GetNodeLabels() (map[string]string, error)