Merge pull request #50204 from smarterclayton/move_list_to_metav1

Automatic merge from submit-queue (batch tested with PRs 50711, 50742, 50204)

Move List (the type) into metav1 but preserve the exposed type

Make a list something that other components can use without depending on the core API. This does not change the public API exposure of `List` (it is still in `v1`) but makes the interface common across both.

Kubernetes-commit: 49ed2a3115d33a78291c92b3ffda5acbe59e6d4a
This commit is contained in:
Kubernetes Publisher 2017-08-16 02:50:26 -07:00
commit ae992f7e2c
3 changed files with 52 additions and 50 deletions

96
Godeps/Godeps.json generated
View File

@ -448,195 +448,195 @@
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/equality", "ImportPath": "k8s.io/apimachinery/pkg/api/equality",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/errors", "ImportPath": "k8s.io/apimachinery/pkg/api/errors",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/meta", "ImportPath": "k8s.io/apimachinery/pkg/api/meta",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/resource", "ImportPath": "k8s.io/apimachinery/pkg/api/resource",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery", "ImportPath": "k8s.io/apimachinery/pkg/apimachinery",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered", "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1alpha1", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1alpha1",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion", "ImportPath": "k8s.io/apimachinery/pkg/conversion",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion/unstructured", "ImportPath": "k8s.io/apimachinery/pkg/conversion/unstructured",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/fields", "ImportPath": "k8s.io/apimachinery/pkg/fields",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/labels", "ImportPath": "k8s.io/apimachinery/pkg/labels",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime", "ImportPath": "k8s.io/apimachinery/pkg/runtime",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/selection", "ImportPath": "k8s.io/apimachinery/pkg/selection",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/types", "ImportPath": "k8s.io/apimachinery/pkg/types",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/cache", "ImportPath": "k8s.io/apimachinery/pkg/util/cache",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/clock", "ImportPath": "k8s.io/apimachinery/pkg/util/clock",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/diff", "ImportPath": "k8s.io/apimachinery/pkg/util/diff",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/errors", "ImportPath": "k8s.io/apimachinery/pkg/util/errors",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/framer", "ImportPath": "k8s.io/apimachinery/pkg/util/framer",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream", "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy", "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr", "ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/json", "ImportPath": "k8s.io/apimachinery/pkg/util/json",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/net", "ImportPath": "k8s.io/apimachinery/pkg/util/net",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand", "ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime", "ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/sets", "ImportPath": "k8s.io/apimachinery/pkg/util/sets",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation", "ImportPath": "k8s.io/apimachinery/pkg/util/validation",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/wait", "ImportPath": "k8s.io/apimachinery/pkg/util/wait",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml", "ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/version", "ImportPath": "k8s.io/apimachinery/pkg/version",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/watch", "ImportPath": "k8s.io/apimachinery/pkg/watch",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
"Rev": "3a1539060031fbcbf14733578685f59f6bda16d8" "Rev": "9273620d03b25c6f8e3343d4d0f96f5934d07a9f"
}, },
{ {
"ImportPath": "k8s.io/kube-openapi/pkg/common", "ImportPath": "k8s.io/kube-openapi/pkg/common",

View File

@ -11,6 +11,7 @@ go_library(
deps = [ deps = [
"//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
], ],
) )

View File

@ -24,6 +24,7 @@ import (
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
) )
@ -61,10 +62,10 @@ func GetReference(scheme *runtime.Scheme, obj runtime.Object) (*v1.ObjectReferen
} }
// An object that implements only List has enough metadata to build a reference // An object that implements only List has enough metadata to build a reference
var listMeta meta.List var listMeta metav1.Common
objectMeta, err := meta.Accessor(obj) objectMeta, err := meta.Accessor(obj)
if err != nil { if err != nil {
listMeta, err = meta.ListAccessor(obj) listMeta, err = meta.CommonAccessor(obj)
if err != nil { if err != nil {
return nil, err return nil, err
} }