mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
Minor fixes
This commit is contained in:
committed by
Antoine Pelisse
parent
5949154ec5
commit
6b2e4682fe
@@ -176,7 +176,8 @@ func collectResourcePaths(t *testing.T, resourcename string, path *field.Path, n
|
||||
case reflect.Ptr:
|
||||
resourcePaths.Insert(collectResourcePaths(t, resourcename, path, name, tp.Elem()).List()...)
|
||||
case reflect.Struct:
|
||||
// Specifically skip ObjectMeta because it has recursive types
|
||||
// ObjectMeta is generic and therefore should never have a field with a specific resource's name;
|
||||
// it contains cycles so it's easiest to just skip it.
|
||||
if name == "ObjectMeta" {
|
||||
break
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ func TestDefaulting(t *testing.T) {
|
||||
{Group: "", Version: "v1", Kind: "ConfigMap"}: {},
|
||||
{Group: "", Version: "v1", Kind: "ConfigMapList"}: {},
|
||||
{Group: "", Version: "v1", Kind: "Endpoints"}: {},
|
||||
{Group: "", Version: "v1", Kind: "EndpointsList"}: {},
|
||||
{Group: "", Version: "v1", Kind: "Namespace"}: {},
|
||||
{Group: "", Version: "v1", Kind: "NamespaceList"}: {},
|
||||
{Group: "", Version: "v1", Kind: "Node"}: {},
|
||||
|
||||
@@ -247,6 +247,8 @@ func collectSecretPaths(t *testing.T, path *field.Path, name string, tp reflect.
|
||||
case reflect.Ptr:
|
||||
secretPaths.Insert(collectSecretPaths(t, path, name, tp.Elem()).List()...)
|
||||
case reflect.Struct:
|
||||
// ObjectMeta should not have any field with the word "secret" in it;
|
||||
// it contains cycles so it's easiest to just skip it.
|
||||
if name == "ObjectMeta" {
|
||||
break
|
||||
}
|
||||
|
||||
@@ -340,7 +340,8 @@ func collectResourcePaths(t *testing.T, resourcename string, path *field.Path, n
|
||||
case reflect.Ptr:
|
||||
resourcePaths.Insert(collectResourcePaths(t, resourcename, path, name, tp.Elem()).List()...)
|
||||
case reflect.Struct:
|
||||
// Specifically skip ObjectMeta because it has recursive types
|
||||
// ObjectMeta is generic and therefore should never have a field with a specific resource's name;
|
||||
// it contains cycles so it's easiest to just skip it.
|
||||
if name == "ObjectMeta" {
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user