Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jan 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions staging/src/k8s.io/kubectl/pkg/cmd/attach/attach_test.go
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down