Update go dependencies for kubernetes 1.16.0

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-09-19 11:01:00 -03:00
parent 280920980d
commit d7b530cb0a
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
510 changed files with 107206 additions and 52551 deletions

View file

@ -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...)