Update go dependencies for kubernetes 1.16.0
This commit is contained in:
parent
280920980d
commit
d7b530cb0a
510 changed files with 107206 additions and 52551 deletions
9
vendor/k8s.io/kubernetes/pkg/util/mount/exec.go
generated
vendored
9
vendor/k8s.io/kubernetes/pkg/util/mount/exec.go
generated
vendored
|
|
@ -18,11 +18,12 @@ package mount
|
|||
|
||||
import "k8s.io/utils/exec"
|
||||
|
||||
func NewOsExec() Exec {
|
||||
// NewOSExec returns a new Exec interface implementation based on exec()
|
||||
func NewOSExec() Exec {
|
||||
return &osExec{}
|
||||
}
|
||||
|
||||
// Real implementation of Exec interface that uses simple util.Exec
|
||||
// Real implementation of Exec interface that uses simple utils.Exec
|
||||
type osExec struct{}
|
||||
|
||||
var _ Exec = &osExec{}
|
||||
|
|
@ -32,16 +33,18 @@ func (e *osExec) Run(cmd string, args ...string) ([]byte, error) {
|
|||
return exe.Command(cmd, args...).CombinedOutput()
|
||||
}
|
||||
|
||||
// NewFakeExec returns a new FakeExec
|
||||
func NewFakeExec(run runHook) *FakeExec {
|
||||
return &FakeExec{runHook: run}
|
||||
}
|
||||
|
||||
// Fake for testing.
|
||||
// FakeExec for testing.
|
||||
type FakeExec struct {
|
||||
runHook runHook
|
||||
}
|
||||
type runHook func(cmd string, args ...string) ([]byte, error)
|
||||
|
||||
// Run executes the command using the optional runhook, if given
|
||||
func (f *FakeExec) Run(cmd string, args ...string) ([]byte, error) {
|
||||
if f.runHook != nil {
|
||||
return f.runHook(cmd, args...)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue