From 3ab143bc18311ed8b69bcb5122f161413422141b Mon Sep 17 00:00:00 2001 From: Monis Khan Date: Tue, 8 Aug 2017 17:14:42 -0400 Subject: [PATCH] Update etcd path test to always use kindWhiteList Most types now have valid rest mappings because NewDefaultRESTMapperFromScheme no longer ignores certain import paths. Thus we can no longer use the lack of a valid REST mapping as an indicator for when to use kindWhiteList. Thus kindWhiteList now serves as a whitelist for all kinds and not just those that formally had no mapping. This does mean that we could whitelist kinds due to a name conflict, but that is unlikely as names such as GetOptions are not appropriate for new objects. Signed-off-by: Monis Khan --- test/integration/etcd/etcd_storage_path_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/integration/etcd/etcd_storage_path_test.go b/test/integration/etcd/etcd_storage_path_test.go index e9441a9085d..2ce3d0758ea 100644 --- a/test/integration/etcd/etcd_storage_path_test.go +++ b/test/integration/etcd/etcd_storage_path_test.go @@ -438,7 +438,7 @@ var ephemeralWhiteList = createEphemeralWhiteList( // -- ) -// Only add kinds to this list when there is no mapping from GVK to GVR (and thus there is no way to create the object) +// Only add kinds to this list when there is no way to create the object var kindWhiteList = sets.NewString( // k8s.io/kubernetes/pkg/api/v1 "DeleteOptions", @@ -496,14 +496,14 @@ func TestEtcdStoragePath(t *testing.T) { kind := gvk.Kind pkgPath := apiType.PkgPath() + if kindWhiteList.Has(kind) { + kindSeen.Insert(kind) + continue + } + mapping, err := mapper.RESTMapping(gvk.GroupKind(), gvk.Version) if err != nil { - kindSeen.Insert(kind) - if kindWhiteList.Has(kind) { - // t.Logf("skipping test for %s from %s because its GVK %s is whitelisted and has no mapping", kind, pkgPath, gvk) - } else { - t.Errorf("no mapping found for %s from %s but its GVK %s is not whitelisted", kind, pkgPath, gvk) - } + t.Errorf("unexpected error getting mapping for %s from %s with GVK %s: %v", kind, pkgPath, gvk, err) continue }