From 979fba1cb09a25c9d533ef32971cf86dbb8c3f2f Mon Sep 17 00:00:00 2001 From: "M. Habib Rosyad" Date: Mon, 10 Aug 2020 21:26:36 +0700 Subject: [PATCH] fix vendor/k8s.io/apimachinery/pkg/api/meta staticcheck --- hack/.staticcheck_failures | 1 - staging/src/k8s.io/apimachinery/pkg/api/meta/meta.go | 4 ---- .../k8s.io/apimachinery/pkg/api/meta/restmapper_test.go | 8 ++++---- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/hack/.staticcheck_failures b/hack/.staticcheck_failures index 1b2b9b8e0f6..89fdb52fdd9 100644 --- a/hack/.staticcheck_failures +++ b/hack/.staticcheck_failures @@ -7,7 +7,6 @@ test/integration/framework test/integration/garbagecollector test/integration/scheduler_perf vendor/k8s.io/apimachinery/pkg/api/apitesting/roundtrip -vendor/k8s.io/apimachinery/pkg/api/meta vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation vendor/k8s.io/apimachinery/pkg/runtime vendor/k8s.io/apimachinery/pkg/runtime/serializer/json diff --git a/staging/src/k8s.io/apimachinery/pkg/api/meta/meta.go b/staging/src/k8s.io/apimachinery/pkg/api/meta/meta.go index 9ca34c9fa9c..6a4116a040b 100644 --- a/staging/src/k8s.io/apimachinery/pkg/api/meta/meta.go +++ b/staging/src/k8s.io/apimachinery/pkg/api/meta/meta.go @@ -40,8 +40,6 @@ func CommonAccessor(obj interface{}) (metav1.Common, error) { switch t := obj.(type) { case List: return t, nil - case metav1.ListInterface: - return t, nil case ListMetaAccessor: if m := t.GetListMeta(); m != nil { return m, nil @@ -72,8 +70,6 @@ func ListAccessor(obj interface{}) (List, error) { switch t := obj.(type) { case List: return t, nil - case metav1.ListInterface: - return t, nil case ListMetaAccessor: if m := t.GetListMeta(); m != nil { return m, nil diff --git a/staging/src/k8s.io/apimachinery/pkg/api/meta/restmapper_test.go b/staging/src/k8s.io/apimachinery/pkg/api/meta/restmapper_test.go index 853404ad6c8..f168f033c70 100644 --- a/staging/src/k8s.io/apimachinery/pkg/api/meta/restmapper_test.go +++ b/staging/src/k8s.io/apimachinery/pkg/api/meta/restmapper_test.go @@ -588,23 +588,23 @@ func TestRESTMapperRESTMappingSelectsVersion(t *testing.T) { } // mismatch of version - mapping, err = mapper.RESTMapping(internalObjectGK, expectedGroupVersion2.Version) + _, err = mapper.RESTMapping(internalObjectGK, expectedGroupVersion2.Version) if err == nil { t.Errorf("unexpected non-error") } - mapping, err = mapper.RESTMapping(otherObjectGK, expectedGroupVersion1.Version) + _, err = mapper.RESTMapping(otherObjectGK, expectedGroupVersion1.Version) if err == nil { t.Errorf("unexpected non-error") } // not in the search versions - mapping, err = mapper.RESTMapping(otherObjectGK, expectedGroupVersion3.Version) + _, err = mapper.RESTMapping(otherObjectGK, expectedGroupVersion3.Version) if err == nil { t.Errorf("unexpected non-error") } // explicit search order - mapping, err = mapper.RESTMapping(otherObjectGK, expectedGroupVersion3.Version, expectedGroupVersion1.Version) + _, err = mapper.RESTMapping(otherObjectGK, expectedGroupVersion3.Version, expectedGroupVersion1.Version) if err == nil { t.Errorf("unexpected non-error") }