Skip to content

Commit

Permalink
Move List (the type) into metav1 but preserve the exposed type
Browse files Browse the repository at this point in the history
  • Loading branch information
smarterclayton committed Aug 16, 2017
1 parent d72ffcd commit 1b3836d
Show file tree
Hide file tree
Showing 25 changed files with 684 additions and 753 deletions.
1 change: 1 addition & 0 deletions pkg/api/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ go_library(
"//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apimachinery/announced:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apimachinery/registered:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/conversion:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/fields:go_default_library",
Expand Down
1 change: 1 addition & 0 deletions pkg/api/ref/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ go_library(
deps = [
"//pkg/api: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",
],
)
Expand Down
5 changes: 3 additions & 2 deletions pkg/api/ref/ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"strings"

"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/kubernetes/pkg/api"
)
Expand Down Expand Up @@ -61,10 +62,10 @@ func GetReference(scheme *runtime.Scheme, obj runtime.Object) (*api.ObjectRefere
}

// 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
}
Expand Down
10 changes: 2 additions & 8 deletions pkg/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ package api

import (
"k8s.io/apimachinery/pkg/api/resource"
metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/intstr"
)
Expand Down Expand Up @@ -3626,13 +3626,7 @@ type EventList struct {
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// List holds a list of objects, which may not be known by the server.
type List struct {
metav1.TypeMeta
// +optional
metav1.ListMeta

Items []runtime.Object
}
type List metainternalversion.List

// A type of object that is limited
type LimitType string
Expand Down
Loading

0 comments on commit 1b3836d

Please sign in to comment.