diff --git a/pkg/cmd/get/customcolumn.go b/pkg/cmd/get/customcolumn.go index af99c3f6..f9f48176 100644 --- a/pkg/cmd/get/customcolumn.go +++ b/pkg/cmd/get/customcolumn.go @@ -162,8 +162,8 @@ func (s *CustomColumnsPrinter) PrintObj(obj runtime.Object, out io.Writer) error return fmt.Errorf(printers.InternalObjectPrinterErr) } - if w, found := out.(*tabwriter.Writer); !found { - w = printers.GetNewTabWriter(out) + if _, found := out.(*tabwriter.Writer); !found { + w := printers.GetNewTabWriter(out) out = w defer w.Flush() } diff --git a/pkg/cmd/get/get_test.go b/pkg/cmd/get/get_test.go index e3025d17..004b292a 100644 --- a/pkg/cmd/get/get_test.go +++ b/pkg/cmd/get/get_test.go @@ -55,7 +55,6 @@ import ( ) var ( - openapiSchemaPath = filepath.Join("..", "..", "..", "testdata", "openapi", "swagger.json") grace = int64(30) enableServiceLinks = corev1.DefaultEnableServiceLinks ) @@ -90,6 +89,7 @@ func testComponentStatusData() *corev1.ComponentStatusList { // Verifies that schemas that are not in the master tree of Kubernetes can be retrieved via Get. func TestGetUnknownSchemaObject(t *testing.T) { t.Skip("This test is completely broken. The first thing it does is add the object to the scheme!") + var openapiSchemaPath = filepath.Join("..", "..", "..", "testdata", "openapi", "swagger.json") tf := cmdtesting.NewTestFactory().WithNamespace("test") defer tf.Cleanup() _, _, codec := cmdtesting.NewExternalScheme() diff --git a/pkg/cmd/testing/fake.go b/pkg/cmd/testing/fake.go index 636ab639..9a6a7cf8 100644 --- a/pkg/cmd/testing/fake.go +++ b/pkg/cmd/testing/fake.go @@ -18,7 +18,6 @@ package testing import ( "bytes" - "errors" "fmt" "io/ioutil" "os" @@ -271,8 +270,6 @@ func convertExternalNamespacedType2ToInternalNamespacedType(in *ExternalNamespac return nil } -var errInvalidVersion = errors.New("not a version") - // ValidVersion of API var ValidVersion = "v1"