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

View File

@ -11,6 +11,7 @@ go_library(
deps = [
"//vendor/k8s.io/api/core/v1: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",
],
)

View File

@ -24,6 +24,7 @@ import (
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"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
var listMeta meta.List
var listMeta metav1.Common
objectMeta, err := meta.Accessor(obj)
if err != nil {
listMeta, err = meta.ListAccessor(obj)
listMeta, err = meta.CommonAccessor(obj)
if err != nil {
return nil, err
}