Merge pull request #96920 from bl-ue/fix-typo-112720-01

Fix typo in kubectl/.../attach_test.go

Kubernetes-commit: 927042c2cfc9ebb16e8521aa19b27b888ec3f1bd
This commit is contained in:
Kubernetes Publisher 2021-01-25 14:15:00 -08:00
commit 691a3747d0
4 changed files with 17 additions and 17 deletions

6
Godeps/Godeps.json generated
View File

@ -924,11 +924,11 @@
},
{
"ImportPath": "k8s.io/api",
"Rev": "c873f2e8ab25"
"Rev": "0d6bea24dc49"
},
{
"ImportPath": "k8s.io/apimachinery",
"Rev": "460d10991a52"
"Rev": "ee96543cc673"
},
{
"ImportPath": "k8s.io/cli-runtime",
@ -940,7 +940,7 @@
},
{
"ImportPath": "k8s.io/code-generator",
"Rev": "b01f4fbaae20"
"Rev": "468be548890f"
},
{
"ImportPath": "k8s.io/component-base",

10
go.mod
View File

@ -34,8 +34,8 @@ require (
github.com/stretchr/testify v1.6.1
golang.org/x/sys v0.0.0-20201112073958-5cba982894dd
gopkg.in/yaml.v2 v2.2.8
k8s.io/api v0.0.0-20210115125903-c873f2e8ab25
k8s.io/apimachinery v0.0.0-20210121071119-460d10991a52
k8s.io/api v0.0.0-20210125191325-0d6bea24dc49
k8s.io/apimachinery v0.0.0-20210125161515-ee96543cc673
k8s.io/cli-runtime v0.0.0-20210121193827-3659b9895efa
k8s.io/client-go v0.0.0-20210121071529-b72204b2445d
k8s.io/component-base v0.0.0-20210115210250-6b412b2ef0d8
@ -49,11 +49,11 @@ require (
)
replace (
k8s.io/api => k8s.io/api v0.0.0-20210115125903-c873f2e8ab25
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20210121071119-460d10991a52
k8s.io/api => k8s.io/api v0.0.0-20210125191325-0d6bea24dc49
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20210125161515-ee96543cc673
k8s.io/cli-runtime => k8s.io/cli-runtime v0.0.0-20210121193827-3659b9895efa
k8s.io/client-go => k8s.io/client-go v0.0.0-20210121071529-b72204b2445d
k8s.io/code-generator => k8s.io/code-generator v0.0.0-20210116045519-b01f4fbaae20
k8s.io/code-generator => k8s.io/code-generator v0.0.0-20210126154837-468be548890f
k8s.io/component-base => k8s.io/component-base v0.0.0-20210115210250-6b412b2ef0d8
k8s.io/component-helpers => k8s.io/component-helpers v0.0.0-20210114010638-f2e8fa560240
k8s.io/metrics => k8s.io/metrics v0.0.0-20210116051850-08fd6e46d1e4

6
go.sum
View File

@ -632,11 +632,11 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.0.0-20210115125903-c873f2e8ab25/go.mod h1:xpUvIW3IJYnKO2yMuT9r4zCZI1ppqiuEejNFI9eoqWo=
k8s.io/apimachinery v0.0.0-20210121071119-460d10991a52/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU=
k8s.io/api v0.0.0-20210125191325-0d6bea24dc49/go.mod h1:pYpfE+rQ/OEtfEnbDCVa4KDpCTlupgiW8eRb4fUr2NM=
k8s.io/apimachinery v0.0.0-20210125161515-ee96543cc673/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU=
k8s.io/cli-runtime v0.0.0-20210121193827-3659b9895efa/go.mod h1:7RVyptA6kHps1rcg2hjiWbF0PKq4Z7Ui0S59wRCKAms=
k8s.io/client-go v0.0.0-20210121071529-b72204b2445d/go.mod h1:qKpEpdeFNptkCaQgvKQRqiDpcEhyGLqp0w8ALpfvaxA=
k8s.io/code-generator v0.0.0-20210116045519-b01f4fbaae20/go.mod h1:4n8UGwhxQWSnXnDBVEtX8cKaE/oMp1ui3M7yFmjT1fo=
k8s.io/code-generator v0.0.0-20210126154837-468be548890f/go.mod h1:4n8UGwhxQWSnXnDBVEtX8cKaE/oMp1ui3M7yFmjT1fo=
k8s.io/component-base v0.0.0-20210115210250-6b412b2ef0d8/go.mod h1:ioM27aGQfNSdCppNxxKUoGHTWWEMcLSdPF2fyoTvGnU=
k8s.io/component-helpers v0.0.0-20210114010638-f2e8fa560240/go.mod h1:v7ICuF1mkF7h92ZDvx4Y1mRrTQmuD3isyKqt4uOFZLM=
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=

View File

@ -200,7 +200,7 @@ func TestAttach(t *testing.T) {
name, version, podPath, fetchPodPath, attachPath, container string
pod *corev1.Pod
remoteAttachErr bool
exepctedErr string
expectedErr string
}{
{
name: "pod attach",
@ -220,7 +220,7 @@ func TestAttach(t *testing.T) {
pod: attachPod(),
remoteAttachErr: true,
container: "bar",
exepctedErr: "attach error",
expectedErr: "attach error",
},
{
name: "container not found error",
@ -230,7 +230,7 @@ func TestAttach(t *testing.T) {
attachPath: "/api/" + version + "/namespaces/test/pods/foo/attach",
pod: attachPod(),
container: "foo",
exepctedErr: "cannot attach to the container: container not found (foo)",
expectedErr: "cannot attach to the container: container not found (foo)",
},
}
for _, test := range tests {
@ -290,15 +290,15 @@ func TestAttach(t *testing.T) {
}
err := options.Run()
if test.exepctedErr != "" && err.Error() != test.exepctedErr {
if test.expectedErr != "" && err.Error() != test.expectedErr {
t.Errorf("%s: Unexpected exec error: %v", test.name, err)
return
}
if test.exepctedErr == "" && err != nil {
if test.expectedErr == "" && err != nil {
t.Errorf("%s: Unexpected error: %v", test.name, err)
return
}
if test.exepctedErr != "" {
if test.expectedErr != "" {
return
}
if remoteAttach.url.Path != test.attachPath {