Skip to content

Commit

Permalink
update import
Browse files Browse the repository at this point in the history
  • Loading branch information
ymqytw committed Jul 20, 2017
1 parent 088141c commit 3dfc8bf
Show file tree
Hide file tree
Showing 83 changed files with 464 additions and 449 deletions.
2 changes: 1 addition & 1 deletion cmd/kube-proxy/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ import (
"k8s.io/kubernetes/pkg/proxy/winuserspace"
"k8s.io/kubernetes/pkg/util/configz"
utildbus "k8s.io/kubernetes/pkg/util/dbus"
"k8s.io/kubernetes/pkg/util/exec"
utiliptables "k8s.io/kubernetes/pkg/util/iptables"
utilnetsh "k8s.io/kubernetes/pkg/util/netsh"
utilnode "k8s.io/kubernetes/pkg/util/node"
Expand All @@ -71,6 +70,7 @@ import (
"k8s.io/kubernetes/pkg/util/resourcecontainer"
utilsysctl "k8s.io/kubernetes/pkg/util/sysctl"
"k8s.io/kubernetes/pkg/version/verflag"
"k8s.io/utils/exec"

"github.com/golang/glog"
"github.com/prometheus/client_golang/prometheus"
Expand Down
2 changes: 1 addition & 1 deletion cmd/kubemark/hollow-node.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ import (
"k8s.io/kubernetes/pkg/kubelet/cm"
"k8s.io/kubernetes/pkg/kubelet/dockershim/libdocker"
"k8s.io/kubernetes/pkg/kubemark"
fakeexec "k8s.io/kubernetes/pkg/util/exec"
fakeiptables "k8s.io/kubernetes/pkg/util/iptables/testing"
fakesysctl "k8s.io/kubernetes/pkg/util/sysctl/testing"
_ "k8s.io/kubernetes/pkg/version/prometheus" // for version metric registration
fakeexec "k8s.io/utils/exec/testing"

"github.com/golang/glog"
"github.com/spf13/pflag"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cloudprovider/providers/openstack/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (
"strings"

"github.com/golang/glog"
"k8s.io/kubernetes/pkg/util/exec"
"k8s.io/kubernetes/pkg/util/mount"
"k8s.io/utils/exec"
)

// metadataUrl is URL to OpenStack metadata server. It's hardcoded IPv4
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubectl/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ import (
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/kubectl/resource"
uexec "k8s.io/kubernetes/pkg/util/exec"
"k8s.io/kubernetes/pkg/util/i18n"
"k8s.io/kubernetes/pkg/util/interrupt"
uexec "k8s.io/utils/exec"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubectl/cmd/util/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import (
"k8s.io/kubernetes/pkg/kubectl"
"k8s.io/kubernetes/pkg/kubectl/resource"
"k8s.io/kubernetes/pkg/printers"
utilexec "k8s.io/kubernetes/pkg/util/exec"
utilexec "k8s.io/utils/exec"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions pkg/kubectl/cmd/util/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi"
apitesting "k8s.io/kubernetes/pkg/api/testing"
uexec "k8s.io/kubernetes/pkg/util/exec"
"k8s.io/utils/exec"
)

func TestMerge(t *testing.T) {
Expand Down Expand Up @@ -266,7 +266,7 @@ func TestCheckNoResourceMatchError(t *testing.T) {
func TestCheckExitError(t *testing.T) {
testCheckError(t, []checkErrTestCase{
{
uexec.CodeExitError{Err: fmt.Errorf("pod foo/bar terminated"), Code: 42},
exec.CodeExitError{Err: fmt.Errorf("pod foo/bar terminated"), Code: 42},
"pod foo/bar terminated",
42,
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/dockershim/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (

"k8s.io/client-go/tools/remotecommand"
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
utilexec "k8s.io/kubernetes/pkg/util/exec"
"k8s.io/kubernetes/pkg/util/term"
utilexec "k8s.io/utils/exec"

"k8s.io/kubernetes/pkg/kubelet/dockershim/libdocker"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/dockershim/remote/docker_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
internalapi "k8s.io/kubernetes/pkg/kubelet/apis/cri"
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
"k8s.io/kubernetes/pkg/kubelet/dockershim"
utilexec "k8s.io/kubernetes/pkg/util/exec"
utilexec "k8s.io/utils/exec"
)

// DockerService is the interface implement CRI remote service server.
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ import (
"k8s.io/kubernetes/pkg/kubelet/volumemanager"
"k8s.io/kubernetes/pkg/security/apparmor"
utildbus "k8s.io/kubernetes/pkg/util/dbus"
utilexec "k8s.io/kubernetes/pkg/util/exec"
kubeio "k8s.io/kubernetes/pkg/util/io"
utilipt "k8s.io/kubernetes/pkg/util/iptables"
"k8s.io/kubernetes/pkg/util/mount"
nodeutil "k8s.io/kubernetes/pkg/util/node"
"k8s.io/kubernetes/pkg/util/oom"
"k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/plugin/pkg/scheduler/algorithm/predicates"
utilexec "k8s.io/utils/exec"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/network/cni/cni.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"k8s.io/kubernetes/pkg/apis/componentconfig"
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
"k8s.io/kubernetes/pkg/kubelet/network"
utilexec "k8s.io/kubernetes/pkg/util/exec"
utilexec "k8s.io/utils/exec"
)

const (
Expand Down
13 changes: 7 additions & 6 deletions pkg/kubelet/network/cni/cni_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ import (
"k8s.io/kubernetes/pkg/kubelet/network/cni/testing"
"k8s.io/kubernetes/pkg/kubelet/network/hostport"
networktest "k8s.io/kubernetes/pkg/kubelet/network/testing"
utilexec "k8s.io/kubernetes/pkg/util/exec"
"k8s.io/utils/exec"
fakeexec "k8s.io/utils/exec/testing"
)

func installPluginUnderTest(t *testing.T, testVendorCNIDirPrefix, testNetworkConfigPath, vendorName string, plugName string) {
Expand Down Expand Up @@ -159,10 +160,10 @@ func TestCNIPlugin(t *testing.T) {

podIP := "10.0.0.2"
podIPOutput := fmt.Sprintf("4: eth0 inet %s/24 scope global dynamic eth0\\ valid_lft forever preferred_lft forever", podIP)
fakeCmds := []utilexec.FakeCommandAction{
func(cmd string, args ...string) utilexec.Cmd {
return utilexec.InitFakeCmd(&utilexec.FakeCmd{
CombinedOutputScript: []utilexec.FakeCombinedOutputAction{
fakeCmds := []fakeexec.FakeCommandAction{
func(cmd string, args ...string) exec.Cmd {
return fakeexec.InitFakeCmd(&fakeexec.FakeCmd{
CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{
func() ([]byte, error) {
return []byte(podIPOutput), nil
},
Expand All @@ -171,7 +172,7 @@ func TestCNIPlugin(t *testing.T) {
},
}

fexec := &utilexec.FakeExec{
fexec := &fakeexec.FakeExec{
CommandScript: fakeCmds,
LookPathFunc: func(file string) (string, error) {
return fmt.Sprintf("/fake-bin/%s", file), nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/network/hairpin/hairpin.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"strconv"

"github.com/golang/glog"
"k8s.io/kubernetes/pkg/util/exec"
"k8s.io/utils/exec"
)

const (
Expand Down
13 changes: 7 additions & 6 deletions pkg/kubelet/network/hairpin/hairpin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import (
"strings"
"testing"

"k8s.io/kubernetes/pkg/util/exec"
"k8s.io/utils/exec"
fakeexec "k8s.io/utils/exec/testing"
)

func TestFindPairInterfaceOfContainerInterface(t *testing.T) {
Expand Down Expand Up @@ -54,15 +55,15 @@ func TestFindPairInterfaceOfContainerInterface(t *testing.T) {
},
}
for _, test := range tests {
fcmd := exec.FakeCmd{
CombinedOutputScript: []exec.FakeCombinedOutputAction{
fcmd := fakeexec.FakeCmd{
CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{
func() ([]byte, error) { return []byte(test.output), test.err },
},
}
fexec := exec.FakeExec{
CommandScript: []exec.FakeCommandAction{
fexec := fakeexec.FakeExec{
CommandScript: []fakeexec.FakeCommandAction{
func(cmd string, args ...string) exec.Cmd {
return exec.InitFakeCmd(&fcmd, cmd, args...)
return fakeexec.InitFakeCmd(&fcmd, cmd, args...)
},
},
LookPathFunc: func(file string) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/network/kubenet/kubenet_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ import (
"k8s.io/kubernetes/pkg/util/bandwidth"
utildbus "k8s.io/kubernetes/pkg/util/dbus"
utilebtables "k8s.io/kubernetes/pkg/util/ebtables"
utilexec "k8s.io/kubernetes/pkg/util/exec"
utiliptables "k8s.io/kubernetes/pkg/util/iptables"
utilsysctl "k8s.io/kubernetes/pkg/util/sysctl"
utilexec "k8s.io/utils/exec"
)

const (
Expand Down
31 changes: 16 additions & 15 deletions pkg/kubelet/network/kubenet/kubenet_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ import (
hostporttest "k8s.io/kubernetes/pkg/kubelet/network/hostport/testing"
nettest "k8s.io/kubernetes/pkg/kubelet/network/testing"
"k8s.io/kubernetes/pkg/util/bandwidth"
"k8s.io/kubernetes/pkg/util/exec"
ipttest "k8s.io/kubernetes/pkg/util/iptables/testing"
sysctltest "k8s.io/kubernetes/pkg/util/sysctl/testing"
"k8s.io/utils/exec"
fakeexec "k8s.io/utils/exec/testing"
)

// test it fulfills the NetworkPlugin interface
Expand Down Expand Up @@ -79,11 +80,11 @@ func TestGetPodNetworkStatus(t *testing.T) {
//TODO: add test cases for retrieving ip inside container network namespace
}

fakeCmds := make([]exec.FakeCommandAction, 0)
fakeCmds := make([]fakeexec.FakeCommandAction, 0)
for _, t := range testCases {
// the fake commands return the IP from the given index, or an error
fCmd := exec.FakeCmd{
CombinedOutputScript: []exec.FakeCombinedOutputAction{
fCmd := fakeexec.FakeCmd{
CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{
func() ([]byte, error) {
ip, ok := podIPMap[kubecontainer.ContainerID{ID: t.id}]
if !ok {
Expand All @@ -94,10 +95,10 @@ func TestGetPodNetworkStatus(t *testing.T) {
},
}
fakeCmds = append(fakeCmds, func(cmd string, args ...string) exec.Cmd {
return exec.InitFakeCmd(&fCmd, cmd, args...)
return fakeexec.InitFakeCmd(&fCmd, cmd, args...)
})
}
fexec := exec.FakeExec{
fexec := fakeexec.FakeExec{
CommandScript: fakeCmds,
LookPathFunc: func(file string) (string, error) {
return fmt.Sprintf("/fake-bin/%s", file), nil
Expand Down Expand Up @@ -128,8 +129,8 @@ func TestGetPodNetworkStatus(t *testing.T) {
// TestTeardownCallsShaper tests that a `TearDown` call does call
// `shaper.Reset`
func TestTeardownCallsShaper(t *testing.T) {
fexec := &exec.FakeExec{
CommandScript: []exec.FakeCommandAction{},
fexec := &fakeexec.FakeExec{
CommandScript: []fakeexec.FakeCommandAction{},
LookPathFunc: func(file string) (string, error) {
return fmt.Sprintf("/fake-bin/%s", file), nil
},
Expand Down Expand Up @@ -162,22 +163,22 @@ func TestTeardownCallsShaper(t *testing.T) {

// TestInit tests that a `Init` call with an MTU sets the MTU
func TestInit_MTU(t *testing.T) {
var fakeCmds []exec.FakeCommandAction
var fakeCmds []fakeexec.FakeCommandAction
{
// modprobe br-netfilter
fCmd := exec.FakeCmd{
CombinedOutputScript: []exec.FakeCombinedOutputAction{
fCmd := fakeexec.FakeCmd{
CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{
func() ([]byte, error) {
return make([]byte, 0), nil
},
},
}
fakeCmds = append(fakeCmds, func(cmd string, args ...string) exec.Cmd {
return exec.InitFakeCmd(&fCmd, cmd, args...)
return fakeexec.InitFakeCmd(&fCmd, cmd, args...)
})
}

fexec := &exec.FakeExec{
fexec := &fakeexec.FakeExec{
CommandScript: fakeCmds,
LookPathFunc: func(file string) (string, error) {
return fmt.Sprintf("/fake-bin/%s", file), nil
Expand Down Expand Up @@ -254,8 +255,8 @@ func TestTearDownWithoutRuntime(t *testing.T) {
fhost.Runtime = nil
mockcni := &mock_cni.MockCNI{}

fexec := &exec.FakeExec{
CommandScript: []exec.FakeCommandAction{},
fexec := &fakeexec.FakeExec{
CommandScript: []fakeexec.FakeCommandAction{},
LookPathFunc: func(file string) (string, error) {
return fmt.Sprintf("/fake-bin/%s", file), nil
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/network/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import (
"k8s.io/kubernetes/pkg/apis/componentconfig"
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
"k8s.io/kubernetes/pkg/kubelet/network/hostport"
utilexec "k8s.io/kubernetes/pkg/util/exec"
utilsysctl "k8s.io/kubernetes/pkg/util/sysctl"
utilexec "k8s.io/utils/exec"
)

const DefaultPluginName = "kubernetes.io/no-op"
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/prober/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"k8s.io/kubernetes/pkg/kubelet/status"
statustest "k8s.io/kubernetes/pkg/kubelet/status/testing"
"k8s.io/kubernetes/pkg/probe"
"k8s.io/kubernetes/pkg/util/exec"
"k8s.io/utils/exec"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/prober/prober.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
execprobe "k8s.io/kubernetes/pkg/probe/exec"
httprobe "k8s.io/kubernetes/pkg/probe/http"
tcprobe "k8s.io/kubernetes/pkg/probe/tcp"
"k8s.io/kubernetes/pkg/util/exec"
"k8s.io/utils/exec"

"github.com/golang/glog"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/prober/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
"k8s.io/kubernetes/pkg/kubelet/status"
statustest "k8s.io/kubernetes/pkg/kubelet/status/testing"
"k8s.io/kubernetes/pkg/probe"
"k8s.io/kubernetes/pkg/util/exec"
"k8s.io/utils/exec"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/remote/remote_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
internalapi "k8s.io/kubernetes/pkg/kubelet/apis/cri"
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
"k8s.io/kubernetes/pkg/kubelet/util"
utilexec "k8s.io/kubernetes/pkg/util/exec"
utilexec "k8s.io/utils/exec"
)

// RemoteRuntimeService is a gRPC implementation of internalapi.RuntimeService.
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/rkt/rkt.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ import (
"k8s.io/kubernetes/pkg/kubelet/types"
"k8s.io/kubernetes/pkg/kubelet/util/format"
"k8s.io/kubernetes/pkg/securitycontext"
utilexec "k8s.io/kubernetes/pkg/util/exec"
"k8s.io/kubernetes/pkg/util/selinux"
utilstrings "k8s.io/kubernetes/pkg/util/strings"
"k8s.io/kubernetes/pkg/util/term"
utilexec "k8s.io/utils/exec"
)

const (
Expand Down
7 changes: 4 additions & 3 deletions pkg/kubelet/rkt/rkt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ import (
"k8s.io/kubernetes/pkg/kubelet/network/kubenet"
nettest "k8s.io/kubernetes/pkg/kubelet/network/testing"
"k8s.io/kubernetes/pkg/kubelet/types"
utilexec "k8s.io/kubernetes/pkg/util/exec"
"k8s.io/utils/exec"
fakeexec "k8s.io/utils/exec/testing"
"strings"
)

Expand Down Expand Up @@ -1415,8 +1416,8 @@ func TestGenerateRunCommand(t *testing.T) {
HostName: tt.hostName,
Err: tt.err,
}
rkt.execer = &utilexec.FakeExec{CommandScript: []utilexec.FakeCommandAction{func(cmd string, args ...string) utilexec.Cmd {
return utilexec.InitFakeCmd(&utilexec.FakeCmd{}, cmd, args...)
rkt.execer = &fakeexec.FakeExec{CommandScript: []fakeexec.FakeCommandAction{func(cmd string, args ...string) exec.Cmd {
return fakeexec.InitFakeCmd(&fakeexec.FakeCmd{}, cmd, args...)
}}}

// a command should be created of this form, but the returned command shouldn't be called (asserted by having no expectations on it)
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/server/remotecommand/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
remotecommandconsts "k8s.io/apimachinery/pkg/util/remotecommand"
"k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/client-go/tools/remotecommand"
utilexec "k8s.io/kubernetes/pkg/util/exec"
utilexec "k8s.io/utils/exec"
)

// Executor knows how to execute a command in a container in a pod.
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubemark/hollow_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ import (
"k8s.io/kubernetes/pkg/proxy"
proxyconfig "k8s.io/kubernetes/pkg/proxy/config"
"k8s.io/kubernetes/pkg/proxy/iptables"
utilexec "k8s.io/kubernetes/pkg/util/exec"
utiliptables "k8s.io/kubernetes/pkg/util/iptables"
utilnode "k8s.io/kubernetes/pkg/util/node"
utilpointer "k8s.io/kubernetes/pkg/util/pointer"
utilsysctl "k8s.io/kubernetes/pkg/util/sysctl"
utilexec "k8s.io/utils/exec"

"github.com/golang/glog"
)
Expand Down
Loading

0 comments on commit 3dfc8bf

Please sign in to comment.