refactor: use metav1.ObjectMeta in other types

This commit is contained in:
Clayton Coleman 2017-01-16 22:38:19 -05:00
parent 5a5d31555b
commit 9a2a50cda7
No known key found for this signature in database
GPG Key ID: 3D16906B4F1C5CB3
822 changed files with 11914 additions and 9290 deletions

View File

@ -32,6 +32,7 @@ go_library(
"//vendor:github.com/prometheus/client_golang/prometheus",
"//vendor:github.com/spf13/cobra",
"//vendor:github.com/spf13/pflag",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/util/wait",
"//vendor:k8s.io/apiserver/pkg/healthz",
],

View File

@ -25,6 +25,7 @@ import (
"strconv"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apiserver/pkg/healthz"
"k8s.io/kubernetes/cmd/cloud-controller-manager/app/options"
@ -158,7 +159,7 @@ func Run(s *options.CloudControllerManagerServer, cloud cloudprovider.Interface)
// Lock required for leader election
rl := resourcelock.EndpointsLock{
EndpointsMeta: v1.ObjectMeta{
EndpointsMeta: metav1.ObjectMeta{
Namespace: "kube-system",
Name: "cloud-controller-manager",
},

View File

@ -16,10 +16,7 @@ limitations under the License.
package apiregistration
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kapi "k8s.io/kubernetes/pkg/api"
)
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// APIServiceList is a list of APIService objects.
type APIServiceList struct {

View File

@ -26,8 +26,7 @@ import (
"fmt"
codec1978 "github.com/ugorji/go/codec"
pkg1_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
pkg3_types "k8s.io/apimachinery/pkg/types"
pkg2_v1 "k8s.io/kubernetes/pkg/api/v1"
pkg2_types "k8s.io/apimachinery/pkg/types"
"reflect"
"runtime"
time "time"
@ -64,10 +63,9 @@ func init() {
}
if false { // reference the types, but skip this branch at build/run time
var v0 pkg1_v1.TypeMeta
var v1 pkg3_types.UID
var v2 pkg2_v1.ObjectMeta
var v3 time.Time
_, _, _, _ = v0, v1, v2, v3
var v1 pkg2_types.UID
var v2 time.Time
_, _, _ = v0, v1, v2
}
}
@ -1340,7 +1338,13 @@ func (x *APIService) CodecEncodeSelf(e *codec1978.Encoder) {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq2[2] {
yy10 := &x.ObjectMeta
yy10.CodecEncodeSelf(e)
yym11 := z.EncBinary()
_ = yym11
if false {
} else if z.HasExtensions() && z.EncExt(yy10) {
} else {
z.EncFallback(yy10)
}
} else {
r.EncodeNil()
}
@ -1350,7 +1354,13 @@ func (x *APIService) CodecEncodeSelf(e *codec1978.Encoder) {
r.EncodeString(codecSelferC_UTF81234, string("metadata"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
yy12 := &x.ObjectMeta
yy12.CodecEncodeSelf(e)
yym13 := z.EncBinary()
_ = yym13
if false {
} else if z.HasExtensions() && z.EncExt(yy12) {
} else {
z.EncFallback(yy12)
}
}
}
if yyr2 || yy2arr2 {
@ -1474,24 +1484,30 @@ func (x *APIService) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
}
case "metadata":
if r.TryDecodeAsNil() {
x.ObjectMeta = pkg2_v1.ObjectMeta{}
x.ObjectMeta = pkg1_v1.ObjectMeta{}
} else {
yyv8 := &x.ObjectMeta
yyv8.CodecDecodeSelf(d)
yym9 := z.DecBinary()
_ = yym9
if false {
} else if z.HasExtensions() && z.DecExt(yyv8) {
} else {
z.DecFallback(yyv8, false)
}
}
case "spec":
if r.TryDecodeAsNil() {
x.Spec = APIServiceSpec{}
} else {
yyv9 := &x.Spec
yyv9.CodecDecodeSelf(d)
yyv10 := &x.Spec
yyv10.CodecDecodeSelf(d)
}
case "status":
if r.TryDecodeAsNil() {
x.Status = APIServiceStatus{}
} else {
yyv10 := &x.Status
yyv10.CodecDecodeSelf(d)
yyv11 := &x.Status
yyv11.CodecDecodeSelf(d)
}
default:
z.DecStructFieldNotFound(-1, yys3)
@ -1504,16 +1520,16 @@ func (x *APIService) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
var yyj11 int
var yyb11 bool
var yyhl11 bool = l >= 0
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
var yyj12 int
var yyb12 bool
var yyhl12 bool = l >= 0
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -1521,21 +1537,21 @@ func (x *APIService) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Kind = ""
} else {
yyv12 := &x.Kind
yym13 := z.DecBinary()
_ = yym13
yyv13 := &x.Kind
yym14 := z.DecBinary()
_ = yym14
if false {
} else {
*((*string)(yyv12)) = r.DecodeString()
*((*string)(yyv13)) = r.DecodeString()
}
}
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -1543,38 +1559,44 @@ func (x *APIService) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.APIVersion = ""
} else {
yyv14 := &x.APIVersion
yym15 := z.DecBinary()
_ = yym15
yyv15 := &x.APIVersion
yym16 := z.DecBinary()
_ = yym16
if false {
} else {
*((*string)(yyv14)) = r.DecodeString()
*((*string)(yyv15)) = r.DecodeString()
}
}
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.ObjectMeta = pkg2_v1.ObjectMeta{}
x.ObjectMeta = pkg1_v1.ObjectMeta{}
} else {
yyv16 := &x.ObjectMeta
yyv16.CodecDecodeSelf(d)
}
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
yyv17 := &x.ObjectMeta
yym18 := z.DecBinary()
_ = yym18
if false {
} else if z.HasExtensions() && z.DecExt(yyv17) {
} else {
yyb11 = r.CheckBreak()
z.DecFallback(yyv17, false)
}
if yyb11 {
}
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb12 = r.CheckBreak()
}
if yyb12 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -1582,16 +1604,16 @@ func (x *APIService) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Spec = APIServiceSpec{}
} else {
yyv17 := &x.Spec
yyv17.CodecDecodeSelf(d)
yyv19 := &x.Spec
yyv19.CodecDecodeSelf(d)
}
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -1599,21 +1621,21 @@ func (x *APIService) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Status = APIServiceStatus{}
} else {
yyv18 := &x.Status
yyv18.CodecDecodeSelf(d)
yyv20 := &x.Status
yyv20.CodecDecodeSelf(d)
}
for {
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
break
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj11-1, "")
z.DecStructFieldNotFound(yyj12-1, "")
}
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}

View File

@ -16,10 +16,7 @@ limitations under the License.
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kapi "k8s.io/kubernetes/pkg/api/v1"
)
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// APIServiceList is a list of APIService objects.
type APIServiceList struct {

View File

@ -49,10 +49,7 @@ func RegisterConversions(scheme *runtime.Scheme) error {
}
func autoConvert_v1alpha1_APIService_To_apiregistration_APIService(in *APIService, out *apiregistration.APIService, s conversion.Scope) error {
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1alpha1_APIServiceSpec_To_apiregistration_APIServiceSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -67,10 +64,7 @@ func Convert_v1alpha1_APIService_To_apiregistration_APIService(in *APIService, o
}
func autoConvert_apiregistration_APIService_To_v1alpha1_APIService(in *apiregistration.APIService, out *APIService, s conversion.Scope) error {
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_apiregistration_APIServiceSpec_To_v1alpha1_APIServiceSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}

View File

@ -21,10 +21,11 @@ limitations under the License.
package v1alpha1
import (
reflect "reflect"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
v1 "k8s.io/kubernetes/pkg/api/v1"
reflect "reflect"
)
func init() {

View File

@ -21,10 +21,11 @@ limitations under the License.
package apiregistration
import (
reflect "reflect"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
api "k8s.io/kubernetes/pkg/api"
reflect "reflect"
)
func init() {

View File

@ -111,7 +111,7 @@ func TestAPIs(t *testing.T) {
name: "simple add",
apiservices: []*apiregistration.APIService{
{
ObjectMeta: api.ObjectMeta{Name: "v1.foo"},
ObjectMeta: metav1.ObjectMeta{Name: "v1.foo"},
Spec: apiregistration.APIServiceSpec{
Service: apiregistration.ServiceReference{
Namespace: "ns",
@ -123,7 +123,7 @@ func TestAPIs(t *testing.T) {
},
},
{
ObjectMeta: api.ObjectMeta{Name: "v1.bar"},
ObjectMeta: metav1.ObjectMeta{Name: "v1.bar"},
Spec: apiregistration.APIServiceSpec{
Service: apiregistration.ServiceReference{
Namespace: "ns",
@ -172,7 +172,7 @@ func TestAPIs(t *testing.T) {
name: "sorting",
apiservices: []*apiregistration.APIService{
{
ObjectMeta: api.ObjectMeta{Name: "v1.foo"},
ObjectMeta: metav1.ObjectMeta{Name: "v1.foo"},
Spec: apiregistration.APIServiceSpec{
Service: apiregistration.ServiceReference{
Namespace: "ns",
@ -184,7 +184,7 @@ func TestAPIs(t *testing.T) {
},
},
{
ObjectMeta: api.ObjectMeta{Name: "v2.bar"},
ObjectMeta: metav1.ObjectMeta{Name: "v2.bar"},
Spec: apiregistration.APIServiceSpec{
Service: apiregistration.ServiceReference{
Namespace: "ns",
@ -196,7 +196,7 @@ func TestAPIs(t *testing.T) {
},
},
{
ObjectMeta: api.ObjectMeta{Name: "v2.foo"},
ObjectMeta: metav1.ObjectMeta{Name: "v2.foo"},
Spec: apiregistration.APIServiceSpec{
Service: apiregistration.ServiceReference{
Namespace: "ns",
@ -208,7 +208,7 @@ func TestAPIs(t *testing.T) {
},
},
{
ObjectMeta: api.ObjectMeta{Name: "v1.bar"},
ObjectMeta: metav1.ObjectMeta{Name: "v1.bar"},
Spec: apiregistration.APIServiceSpec{
Service: apiregistration.ServiceReference{
Namespace: "ns",
@ -352,7 +352,7 @@ func TestAPIGroup(t *testing.T) {
group: "foo",
apiservices: []*apiregistration.APIService{
{
ObjectMeta: api.ObjectMeta{Name: "v1.foo"},
ObjectMeta: metav1.ObjectMeta{Name: "v1.foo"},
Spec: apiregistration.APIServiceSpec{
Service: apiregistration.ServiceReference{
Namespace: "ns",
@ -364,7 +364,7 @@ func TestAPIGroup(t *testing.T) {
},
},
{
ObjectMeta: api.ObjectMeta{Name: "v2.bar"},
ObjectMeta: metav1.ObjectMeta{Name: "v2.bar"},
Spec: apiregistration.APIServiceSpec{
Service: apiregistration.ServiceReference{
Namespace: "ns",
@ -376,7 +376,7 @@ func TestAPIGroup(t *testing.T) {
},
},
{
ObjectMeta: api.ObjectMeta{Name: "v2.foo"},
ObjectMeta: metav1.ObjectMeta{Name: "v2.foo"},
Spec: apiregistration.APIServiceSpec{
Service: apiregistration.ServiceReference{
Namespace: "ns",
@ -388,7 +388,7 @@ func TestAPIGroup(t *testing.T) {
},
},
{
ObjectMeta: api.ObjectMeta{Name: "v1.bar"},
ObjectMeta: metav1.ObjectMeta{Name: "v1.bar"},
Spec: apiregistration.APIServiceSpec{
Service: apiregistration.ServiceReference{
Namespace: "ns",

View File

@ -25,10 +25,10 @@ import (
"strings"
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apiserver/pkg/authentication/user"
genericapirequest "k8s.io/apiserver/pkg/request"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/cmd/kube-aggregator/pkg/apis/apiregistration"
)
@ -103,7 +103,7 @@ func TestProxyHandler(t *testing.T) {
},
"no user": {
apiService: &apiregistration.APIService{
ObjectMeta: api.ObjectMeta{Name: "v1.foo"},
ObjectMeta: metav1.ObjectMeta{Name: "v1.foo"},
Spec: apiregistration.APIServiceSpec{
Group: "foo",
Version: "v1",
@ -119,7 +119,7 @@ func TestProxyHandler(t *testing.T) {
},
path: "/request/path",
apiService: &apiregistration.APIService{
ObjectMeta: api.ObjectMeta{Name: "v1.foo"},
ObjectMeta: metav1.ObjectMeta{Name: "v1.foo"},
Spec: apiregistration.APIServiceSpec{
Group: "foo",
Version: "v1",
@ -144,7 +144,7 @@ func TestProxyHandler(t *testing.T) {
},
path: "/request/path",
apiService: &apiregistration.APIService{
ObjectMeta: api.ObjectMeta{Name: "v1.foo"},
ObjectMeta: metav1.ObjectMeta{Name: "v1.foo"},
Spec: apiregistration.APIServiceSpec{
Group: "foo",
Version: "v1",

View File

@ -16,9 +16,9 @@ go_library(
tags = ["automanaged"],
deps = [
"//cmd/kube-aggregator/pkg/apis/apiregistration:go_default_library",
"//pkg/api:go_default_library",
"//pkg/client/cache:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/api/errors",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/labels",
],
)

View File

@ -20,9 +20,9 @@ package internalversion
import (
"k8s.io/apimachinery/pkg/api/errors"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
apiregistration "k8s.io/kubernetes/cmd/kube-aggregator/pkg/apis/apiregistration"
api "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/client/cache"
)
@ -55,7 +55,7 @@ func (s *aPIServiceLister) List(selector labels.Selector) (ret []*apiregistratio
// Get retrieves the APIService from the index for a given name.
func (s *aPIServiceLister) Get(name string) (*apiregistration.APIService, error) {
key := &apiregistration.APIService{ObjectMeta: api.ObjectMeta{Name: name}}
key := &apiregistration.APIService{ObjectMeta: v1.ObjectMeta{Name: name}}
obj, exists, err := s.indexer.Get(key)
if err != nil {
return nil, err

View File

@ -17,9 +17,9 @@ go_library(
deps = [
"//cmd/kube-aggregator/pkg/apis/apiregistration:go_default_library",
"//cmd/kube-aggregator/pkg/apis/apiregistration/v1alpha1:go_default_library",
"//pkg/api/v1:go_default_library",
"//pkg/client/cache:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/api/errors",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/labels",
],
)

View File

@ -20,10 +20,10 @@ package v1alpha1
import (
"k8s.io/apimachinery/pkg/api/errors"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
apiregistration "k8s.io/kubernetes/cmd/kube-aggregator/pkg/apis/apiregistration"
v1alpha1 "k8s.io/kubernetes/cmd/kube-aggregator/pkg/apis/apiregistration/v1alpha1"
v1 "k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/client/cache"
)

View File

@ -31,6 +31,7 @@ import (
"strconv"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/wait"
@ -178,7 +179,7 @@ func Run(s *options.CMServer) error {
// TODO: enable other lock types
rl := resourcelock.EndpointsLock{
EndpointsMeta: v1.ObjectMeta{
EndpointsMeta: metav1.ObjectMeta{
Namespace: "kube-system",
Name: "kube-controller-manager",
},

View File

@ -127,11 +127,11 @@ func standardLabels(n string) map[string]string {
func NewDaemonSet(daemonName string, podSpec v1.PodSpec) *extensions.DaemonSet {
l := standardLabels(daemonName)
return &extensions.DaemonSet{
ObjectMeta: v1.ObjectMeta{Name: daemonName},
ObjectMeta: metav1.ObjectMeta{Name: daemonName},
Spec: extensions.DaemonSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: l},
Template: v1.PodTemplateSpec{
ObjectMeta: v1.ObjectMeta{Labels: l},
ObjectMeta: metav1.ObjectMeta{Labels: l},
Spec: podSpec,
},
},
@ -141,7 +141,7 @@ func NewDaemonSet(daemonName string, podSpec v1.PodSpec) *extensions.DaemonSet {
func NewService(serviceName string, spec v1.ServiceSpec) *v1.Service {
l := standardLabels(serviceName)
return &v1.Service{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: serviceName,
Labels: l,
},
@ -152,12 +152,12 @@ func NewService(serviceName string, spec v1.ServiceSpec) *v1.Service {
func NewDeployment(deploymentName string, replicas int32, podSpec v1.PodSpec) *extensions.Deployment {
l := standardLabels(deploymentName)
return &extensions.Deployment{
ObjectMeta: v1.ObjectMeta{Name: deploymentName},
ObjectMeta: metav1.ObjectMeta{Name: deploymentName},
Spec: extensions.DeploymentSpec{
Replicas: &replicas,
Selector: &metav1.LabelSelector{MatchLabels: l},
Template: v1.PodTemplateSpec{
ObjectMeta: v1.ObjectMeta{Labels: l},
ObjectMeta: metav1.ObjectMeta{Labels: l},
Spec: podSpec,
},
},
@ -213,7 +213,7 @@ func UpdateMasterRoleLabelsAndTaints(client *clientset.Clientset, schedulable bo
return nil
}
func SetMasterTaintTolerations(meta *v1.ObjectMeta) {
func SetMasterTaintTolerations(meta *metav1.ObjectMeta) {
tolerationsAnnotation, _ := json.Marshal([]v1.Toleration{{Key: "dedicated", Value: "master", Effect: "NoSchedule"}})
if meta.Annotations == nil {
meta.Annotations = map[string]string{}
@ -222,7 +222,7 @@ func SetMasterTaintTolerations(meta *v1.ObjectMeta) {
}
// SetNodeAffinity is a basic helper to set meta.Annotations[v1.AffinityAnnotationKey] for one or more v1.NodeSelectorRequirement(s)
func SetNodeAffinity(meta *v1.ObjectMeta, expr ...v1.NodeSelectorRequirement) {
func SetNodeAffinity(meta *metav1.ObjectMeta, expr ...v1.NodeSelectorRequirement) {
nodeAffinity := &v1.NodeAffinity{
RequiredDuringSchedulingIgnoredDuringExecution: &v1.NodeSelector{
NodeSelectorTerms: []v1.NodeSelectorTerm{{MatchExpressions: expr}},

View File

@ -109,7 +109,7 @@ func newKubeDiscovery(cfg *kubeadmapi.MasterConfiguration, caCert *x509.Certific
kd := kubeDiscovery{
Deployment: NewDeployment(kubeDiscoveryName, 1, newKubeDiscoveryPodSpec(cfg)),
Secret: &v1.Secret{
ObjectMeta: v1.ObjectMeta{Name: kubeDiscoverySecretName},
ObjectMeta: metav1.ObjectMeta{Name: kubeDiscoverySecretName},
Type: v1.SecretTypeOpaque,
Data: encodeKubeDiscoverySecretData(cfg.Discovery.Token, cfg.API, caCert),
},

View File

@ -261,7 +261,7 @@ func componentPod(container api.Container, volumes ...api.Volume) api.Pod {
APIVersion: "v1",
Kind: "Pod",
},
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: container.Name,
Namespace: "kube-system",
Labels: map[string]string{"component": container.Name, "tier": "control-plane"},

View File

@ -151,7 +151,7 @@ func UpdateOrCreateToken(client *clientset.Clientset, d *kubeadmapi.TokenDiscove
// Secret does not already exist:
if apierrors.IsNotFound(err) {
secret = &v1.Secret{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: secretName,
},
Type: api.SecretTypeBootstrapToken,

View File

@ -16,10 +16,7 @@ limitations under the License.
package testgroup
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api"
)
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// +genclient=true

View File

@ -26,8 +26,7 @@ import (
"fmt"
codec1978 "github.com/ugorji/go/codec"
pkg1_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
pkg3_types "k8s.io/apimachinery/pkg/types"
pkg2_v1 "k8s.io/kubernetes/pkg/api/v1"
pkg2_types "k8s.io/apimachinery/pkg/types"
"reflect"
"runtime"
time "time"
@ -64,10 +63,9 @@ func init() {
}
if false { // reference the types, but skip this branch at build/run time
var v0 pkg1_v1.TypeMeta
var v1 pkg3_types.UID
var v2 pkg2_v1.ObjectMeta
var v3 time.Time
_, _, _, _ = v0, v1, v2, v3
var v1 pkg2_types.UID
var v2 time.Time
_, _, _ = v0, v1, v2
}
}
@ -159,7 +157,13 @@ func (x *TestType) CodecEncodeSelf(e *codec1978.Encoder) {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq2[2] {
yy10 := &x.ObjectMeta
yy10.CodecEncodeSelf(e)
yym11 := z.EncBinary()
_ = yym11
if false {
} else if z.HasExtensions() && z.EncExt(yy10) {
} else {
z.EncFallback(yy10)
}
} else {
r.EncodeNil()
}
@ -169,7 +173,13 @@ func (x *TestType) CodecEncodeSelf(e *codec1978.Encoder) {
r.EncodeString(codecSelferC_UTF81234, string("metadata"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
yy12 := &x.ObjectMeta
yy12.CodecEncodeSelf(e)
yym13 := z.EncBinary()
_ = yym13
if false {
} else if z.HasExtensions() && z.EncExt(yy12) {
} else {
z.EncFallback(yy12)
}
}
}
if yyr2 || yy2arr2 {
@ -276,17 +286,23 @@ func (x *TestType) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
}
case "metadata":
if r.TryDecodeAsNil() {
x.ObjectMeta = pkg2_v1.ObjectMeta{}
x.ObjectMeta = pkg1_v1.ObjectMeta{}
} else {
yyv8 := &x.ObjectMeta
yyv8.CodecDecodeSelf(d)
yym9 := z.DecBinary()
_ = yym9
if false {
} else if z.HasExtensions() && z.DecExt(yyv8) {
} else {
z.DecFallback(yyv8, false)
}
}
case "status":
if r.TryDecodeAsNil() {
x.Status = TestTypeStatus{}
} else {
yyv9 := &x.Status
yyv9.CodecDecodeSelf(d)
yyv10 := &x.Status
yyv10.CodecDecodeSelf(d)
}
default:
z.DecStructFieldNotFound(-1, yys3)
@ -299,16 +315,16 @@ func (x *TestType) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
var yyj10 int
var yyb10 bool
var yyhl10 bool = l >= 0
yyj10++
if yyhl10 {
yyb10 = yyj10 > l
var yyj11 int
var yyb11 bool
var yyhl11 bool = l >= 0
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
} else {
yyb10 = r.CheckBreak()
yyb11 = r.CheckBreak()
}
if yyb10 {
if yyb11 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -316,21 +332,21 @@ func (x *TestType) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Kind = ""
} else {
yyv11 := &x.Kind
yym12 := z.DecBinary()
_ = yym12
yyv12 := &x.Kind
yym13 := z.DecBinary()
_ = yym13
if false {
} else {
*((*string)(yyv11)) = r.DecodeString()
*((*string)(yyv12)) = r.DecodeString()
}
}
yyj10++
if yyhl10 {
yyb10 = yyj10 > l
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
} else {
yyb10 = r.CheckBreak()
yyb11 = r.CheckBreak()
}
if yyb10 {
if yyb11 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -338,38 +354,44 @@ func (x *TestType) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.APIVersion = ""
} else {
yyv13 := &x.APIVersion
yym14 := z.DecBinary()
_ = yym14
yyv14 := &x.APIVersion
yym15 := z.DecBinary()
_ = yym15
if false {
} else {
*((*string)(yyv13)) = r.DecodeString()
*((*string)(yyv14)) = r.DecodeString()
}
}
yyj10++
if yyhl10 {
yyb10 = yyj10 > l
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
} else {
yyb10 = r.CheckBreak()
yyb11 = r.CheckBreak()
}
if yyb10 {
if yyb11 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.ObjectMeta = pkg2_v1.ObjectMeta{}
x.ObjectMeta = pkg1_v1.ObjectMeta{}
} else {
yyv15 := &x.ObjectMeta
yyv15.CodecDecodeSelf(d)
}
yyj10++
if yyhl10 {
yyb10 = yyj10 > l
yyv16 := &x.ObjectMeta
yym17 := z.DecBinary()
_ = yym17
if false {
} else if z.HasExtensions() && z.DecExt(yyv16) {
} else {
yyb10 = r.CheckBreak()
z.DecFallback(yyv16, false)
}
if yyb10 {
}
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
} else {
yyb11 = r.CheckBreak()
}
if yyb11 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -377,21 +399,21 @@ func (x *TestType) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Status = TestTypeStatus{}
} else {
yyv16 := &x.Status
yyv16.CodecDecodeSelf(d)
yyv18 := &x.Status
yyv18.CodecDecodeSelf(d)
}
for {
yyj10++
if yyhl10 {
yyb10 = yyj10 > l
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
} else {
yyb10 = r.CheckBreak()
yyb11 = r.CheckBreak()
}
if yyb10 {
if yyb11 {
break
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj10-1, "")
z.DecStructFieldNotFound(yyj11-1, "")
}
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}

View File

@ -16,10 +16,7 @@ limitations under the License.
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
apiv1 "k8s.io/kubernetes/pkg/api/v1"
)
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// +genclient=true

View File

@ -657,7 +657,7 @@ func (g *genConversion) doSlice(inType, outType *types.Type, sw *generator.Snipp
} else if g.convertibleOnlyWithinPackage(inType.Elem, outType.Elem) {
sw.Do("if err := "+nameTmpl+"(&(*in)[i], &(*out)[i], s); err != nil {\n", argsFromType(inType.Elem, outType.Elem))
} else {
// TODO: This triggers on v1.ObjectMeta <-> api.ObjectMeta and
// TODO: This triggers on metav1.ObjectMeta <-> metav1.ObjectMeta and
// similar because neither package is the target package, and
// we really don't know which package will have the conversion
// function defined. This fires on basically every object

View File

@ -28,7 +28,7 @@ import (
)
func TestResourceVersioner(t *testing.T) {
cluster := federation.Cluster{ObjectMeta: api.ObjectMeta{ResourceVersion: "10"}}
cluster := federation.Cluster{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "10"}}
version, err := accessor.ResourceVersion(&cluster)
if err != nil {
t.Fatalf("unexpected error: %v", err)
@ -105,7 +105,7 @@ func TestRESTMapper(t *testing.T) {
t.Errorf("unexpected: %#v, expected: %#v", mapping, interfaces)
}
rc := &federation.Cluster{ObjectMeta: api.ObjectMeta{Name: "foo"}}
rc := &federation.Cluster{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}
name, err := mapping.MetadataAccessor.Name(rc)
if err != nil {
t.Errorf("unexpected error: %v", err)

View File

@ -468,7 +468,7 @@ func (this *Cluster) String() string {
return "nil"
}
s := strings.Join([]string{`&Cluster{`,
`ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_kubernetes_pkg_api_v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
`ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
`Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ClusterSpec", "ClusterSpec", 1), `&`, ``, 1) + `,`,
`Status:` + strings.Replace(strings.Replace(this.Status.String(), "ClusterStatus", "ClusterStatus", 1), `&`, ``, 1) + `,`,
`}`,
@ -1487,56 +1487,56 @@ var (
)
var fileDescriptorGenerated = []byte{
// 806 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x54, 0xcd, 0x6a, 0xeb, 0x46,
0x14, 0xb6, 0xfc, 0x7b, 0x3d, 0xa9, 0xdb, 0xcb, 0xd0, 0x82, 0xeb, 0x85, 0x7c, 0x31, 0xa5, 0xf8,
0x96, 0x56, 0xc2, 0xa6, 0x94, 0x0b, 0xa5, 0x85, 0x2b, 0x5f, 0x0a, 0x01, 0x87, 0x94, 0x49, 0x28,
0x25, 0x14, 0x8a, 0x2c, 0x1f, 0x2b, 0xaa, 0xad, 0x1f, 0x66, 0x46, 0x06, 0x67, 0xd5, 0x07, 0xe8,
0xa2, 0x0f, 0xd1, 0x37, 0x28, 0x7d, 0x87, 0xec, 0x9a, 0x45, 0x17, 0x59, 0x99, 0xc6, 0x7d, 0x8b,
0xac, 0xca, 0x8c, 0x46, 0xb2, 0x15, 0xc5, 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0xc7, 0x5e,
0x24, 0x07, 0x89, 0xc0, 0x0c, 0x28, 0x04, 0x0e, 0x58, 0xad, 0xcd, 0xba, 0xdb, 0x3c, 0x49, 0x81,
0xc8, 0x16, 0xb3, 0xf7, 0x97, 0x86, 0x5a, 0xb9, 0xed, 0xc7, 0x17, 0x08, 0x39, 0xe9, 0x66, 0xa5,
0x75, 0xf9, 0xe6, 0x49, 0x1d, 0xca, 0x16, 0x75, 0x7b, 0x31, 0x33, 0x17, 0x23, 0x3b, 0x6c, 0xb8,
0x8b, 0x6a, 0x17, 0x61, 0x00, 0xac, 0x5d, 0x7b, 0x51, 0xe9, 0x37, 0xad, 0xa6, 0xe8, 0xea, 0x99,
0x70, 0x90, 0xc4, 0x9f, 0x8c, 0xbe, 0xeb, 0x85, 0x81, 0x9a, 0xe8, 0x9d, 0xd1, 0x17, 0x5e, 0xa2,
0xfe, 0xf6, 0x7e, 0xd1, 0xd0, 0x87, 0x7b, 0x4b, 0x8e, 0x87, 0x08, 0x39, 0x99, 0xa5, 0x2e, 0xd7,
0x56, 0x5a, 0xf6, 0x87, 0xec, 0x44, 0xe1, 0x2f, 0x51, 0x2b, 0xd7, 0x27, 0x75, 0xb4, 0xb2, 0x4b,
0x91, 0x63, 0x23, 0xf9, 0x58, 0xeb, 0xe5, 0xe5, 0x8d, 0x5e, 0xba, 0xba, 0xd1, 0x4b, 0xd7, 0x37,
0x7a, 0xe9, 0xe7, 0x8d, 0xae, 0x5d, 0x6e, 0x74, 0xed, 0x6a, 0xa3, 0x6b, 0x7f, 0x6f, 0x74, 0xed,
0xd7, 0x7f, 0xf4, 0xd2, 0x59, 0x43, 0xd5, 0xec, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x15, 0xe8,
0xc4, 0x9a, 0x7c, 0x08, 0x00, 0x00,
// 802 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x54, 0x4d, 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d9, 0x58, 0x6b, 0xff, 0xe6, 0x5e, 0xcf, 0xdd, 0xde, 0xeb, 0xb9, 0xbb, 0x7b, 0x3d, 0xf7, 0xdb,
0x4c, 0xd7, 0x6e, 0x66, 0xba, 0x76, 0x3b, 0xd3, 0xb5, 0xff, 0x66, 0xba, 0xf6, 0xc7, 0xff, 0x7a,
0xee, 0xb2, 0xa2, 0x6a, 0xf6, 0x26, 0x00, 0x00, 0xff, 0xff, 0x4c, 0x52, 0x01, 0x24, 0x84, 0x08,
0x00, 0x00,
}

View File

@ -36,7 +36,7 @@ message Cluster {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the behavior of the Cluster.
// +optional

View File

@ -1441,7 +1441,13 @@ func (x *Cluster) CodecEncodeSelf(e *codec1978.Encoder) {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq2[2] {
yy10 := &x.ObjectMeta
yy10.CodecEncodeSelf(e)
yym11 := z.EncBinary()
_ = yym11
if false {
} else if z.HasExtensions() && z.EncExt(yy10) {
} else {
z.EncFallback(yy10)
}
} else {
r.EncodeNil()
}
@ -1451,7 +1457,13 @@ func (x *Cluster) CodecEncodeSelf(e *codec1978.Encoder) {
r.EncodeString(codecSelferC_UTF81234, string("metadata"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
yy12 := &x.ObjectMeta
yy12.CodecEncodeSelf(e)
yym13 := z.EncBinary()
_ = yym13
if false {
} else if z.HasExtensions() && z.EncExt(yy12) {
} else {
z.EncFallback(yy12)
}
}
}
if yyr2 || yy2arr2 {
@ -1575,24 +1587,30 @@ func (x *Cluster) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
}
case "metadata":
if r.TryDecodeAsNil() {
x.ObjectMeta = pkg1_v1.ObjectMeta{}
x.ObjectMeta = pkg2_v1.ObjectMeta{}
} else {
yyv8 := &x.ObjectMeta
yyv8.CodecDecodeSelf(d)
yym9 := z.DecBinary()
_ = yym9
if false {
} else if z.HasExtensions() && z.DecExt(yyv8) {
} else {
z.DecFallback(yyv8, false)
}
}
case "spec":
if r.TryDecodeAsNil() {
x.Spec = ClusterSpec{}
} else {
yyv9 := &x.Spec
yyv9.CodecDecodeSelf(d)
yyv10 := &x.Spec
yyv10.CodecDecodeSelf(d)
}
case "status":
if r.TryDecodeAsNil() {
x.Status = ClusterStatus{}
} else {
yyv10 := &x.Status
yyv10.CodecDecodeSelf(d)
yyv11 := &x.Status
yyv11.CodecDecodeSelf(d)
}
default:
z.DecStructFieldNotFound(-1, yys3)
@ -1605,16 +1623,16 @@ func (x *Cluster) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
var yyj11 int
var yyb11 bool
var yyhl11 bool = l >= 0
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
var yyj12 int
var yyb12 bool
var yyhl12 bool = l >= 0
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -1622,21 +1640,21 @@ func (x *Cluster) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Kind = ""
} else {
yyv12 := &x.Kind
yym13 := z.DecBinary()
_ = yym13
yyv13 := &x.Kind
yym14 := z.DecBinary()
_ = yym14
if false {
} else {
*((*string)(yyv12)) = r.DecodeString()
*((*string)(yyv13)) = r.DecodeString()
}
}
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -1644,38 +1662,44 @@ func (x *Cluster) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.APIVersion = ""
} else {
yyv14 := &x.APIVersion
yym15 := z.DecBinary()
_ = yym15
yyv15 := &x.APIVersion
yym16 := z.DecBinary()
_ = yym16
if false {
} else {
*((*string)(yyv14)) = r.DecodeString()
*((*string)(yyv15)) = r.DecodeString()
}
}
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.ObjectMeta = pkg1_v1.ObjectMeta{}
x.ObjectMeta = pkg2_v1.ObjectMeta{}
} else {
yyv16 := &x.ObjectMeta
yyv16.CodecDecodeSelf(d)
}
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
yyv17 := &x.ObjectMeta
yym18 := z.DecBinary()
_ = yym18
if false {
} else if z.HasExtensions() && z.DecExt(yyv17) {
} else {
yyb11 = r.CheckBreak()
z.DecFallback(yyv17, false)
}
if yyb11 {
}
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb12 = r.CheckBreak()
}
if yyb12 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -1683,16 +1707,16 @@ func (x *Cluster) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Spec = ClusterSpec{}
} else {
yyv17 := &x.Spec
yyv17.CodecDecodeSelf(d)
yyv19 := &x.Spec
yyv19.CodecDecodeSelf(d)
}
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -1700,21 +1724,21 @@ func (x *Cluster) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Status = ClusterStatus{}
} else {
yyv18 := &x.Status
yyv18.CodecDecodeSelf(d)
yyv20 := &x.Status
yyv20.CodecDecodeSelf(d)
}
for {
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
break
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj11-1, "")
z.DecStructFieldNotFound(yyj12-1, "")
}
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}

View File

@ -53,10 +53,7 @@ func RegisterConversions(scheme *runtime.Scheme) error {
}
func autoConvert_v1beta1_Cluster_To_federation_Cluster(in *Cluster, out *federation.Cluster, s conversion.Scope) error {
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1beta1_ClusterSpec_To_federation_ClusterSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -71,10 +68,7 @@ func Convert_v1beta1_Cluster_To_federation_Cluster(in *Cluster, out *federation.
}
func autoConvert_federation_Cluster_To_v1beta1_Cluster(in *federation.Cluster, out *Cluster, s conversion.Scope) error {
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_federation_ClusterSpec_To_v1beta1_ClusterSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}

View File

@ -21,9 +21,10 @@ limitations under the License.
package v1beta1
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
v1 "k8s.io/kubernetes/pkg/api/v1"
api_v1 "k8s.io/kubernetes/pkg/api/v1"
reflect "reflect"
)
@ -49,8 +50,10 @@ func DeepCopy_v1beta1_Cluster(in interface{}, out interface{}, c *conversion.Clo
in := in.(*Cluster)
out := out.(*Cluster)
*out = *in
if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*v1.ObjectMeta)
}
if err := DeepCopy_v1beta1_ClusterSpec(&in.Spec, &out.Spec, c); err != nil {
return err
@ -105,7 +108,7 @@ func DeepCopy_v1beta1_ClusterSpec(in interface{}, out interface{}, c *conversion
}
if in.SecretRef != nil {
in, out := &in.SecretRef, &out.SecretRef
*out = new(v1.LocalObjectReference)
*out = new(api_v1.LocalObjectReference)
**out = **in
}
return nil

View File

@ -27,6 +27,7 @@ go_test(
deps = [
"//federation/apis/federation:go_default_library",
"//pkg/api:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
],
)

View File

@ -19,6 +19,7 @@ package validation
import (
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/federation/apis/federation"
"k8s.io/kubernetes/pkg/api"
)
@ -26,7 +27,7 @@ import (
func TestValidateCluster(t *testing.T) {
successCases := []federation.Cluster{
{
ObjectMeta: api.ObjectMeta{Name: "cluster-s"},
ObjectMeta: metav1.ObjectMeta{Name: "cluster-s"},
Spec: federation.ClusterSpec{
ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{
{
@ -46,15 +47,15 @@ func TestValidateCluster(t *testing.T) {
errorCases := map[string]federation.Cluster{
"missing cluster addresses": {
ObjectMeta: api.ObjectMeta{Name: "cluster-f"},
ObjectMeta: metav1.ObjectMeta{Name: "cluster-f"},
},
"empty cluster addresses": {
ObjectMeta: api.ObjectMeta{Name: "cluster-f"},
ObjectMeta: metav1.ObjectMeta{Name: "cluster-f"},
Spec: federation.ClusterSpec{
ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{},
}},
"invalid_label": {
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "cluster-f",
Labels: map[string]string{
"NoUppercaseOrSpecialCharsLike=Equals": "bar",
@ -62,7 +63,7 @@ func TestValidateCluster(t *testing.T) {
},
},
"invalid cluster name (is a subdomain)": {
ObjectMeta: api.ObjectMeta{Name: "mycluster.mycompany"},
ObjectMeta: metav1.ObjectMeta{Name: "mycluster.mycompany"},
Spec: federation.ClusterSpec{
ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{
{
@ -89,7 +90,7 @@ func TestValidateClusterUpdate(t *testing.T) {
successCases := []clusterUpdateTest{
{
old: federation.Cluster{
ObjectMeta: api.ObjectMeta{Name: "cluster-s"},
ObjectMeta: metav1.ObjectMeta{Name: "cluster-s"},
Spec: federation.ClusterSpec{
ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{
{
@ -100,7 +101,7 @@ func TestValidateClusterUpdate(t *testing.T) {
},
},
update: federation.Cluster{
ObjectMeta: api.ObjectMeta{Name: "cluster-s"},
ObjectMeta: metav1.ObjectMeta{Name: "cluster-s"},
Spec: federation.ClusterSpec{
ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{
{
@ -124,7 +125,7 @@ func TestValidateClusterUpdate(t *testing.T) {
errorCases := map[string]clusterUpdateTest{
"cluster name changed": {
old: federation.Cluster{
ObjectMeta: api.ObjectMeta{Name: "cluster-s"},
ObjectMeta: metav1.ObjectMeta{Name: "cluster-s"},
Spec: federation.ClusterSpec{
ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{
{
@ -135,7 +136,7 @@ func TestValidateClusterUpdate(t *testing.T) {
},
},
update: federation.Cluster{
ObjectMeta: api.ObjectMeta{Name: "cluster-newname"},
ObjectMeta: metav1.ObjectMeta{Name: "cluster-newname"},
Spec: federation.ClusterSpec{
ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{
{
@ -163,7 +164,7 @@ func TestValidateClusterStatusUpdate(t *testing.T) {
successCases := []clusterUpdateTest{
{
old: federation.Cluster{
ObjectMeta: api.ObjectMeta{Name: "cluster-s"},
ObjectMeta: metav1.ObjectMeta{Name: "cluster-s"},
Spec: federation.ClusterSpec{
ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{
{
@ -179,7 +180,7 @@ func TestValidateClusterStatusUpdate(t *testing.T) {
},
},
update: federation.Cluster{
ObjectMeta: api.ObjectMeta{Name: "cluster-s"},
ObjectMeta: metav1.ObjectMeta{Name: "cluster-s"},
Spec: federation.ClusterSpec{
ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{
{

View File

@ -21,10 +21,11 @@ limitations under the License.
package federation
import (
reflect "reflect"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
api "k8s.io/kubernetes/pkg/api"
reflect "reflect"
)
func init() {

View File

@ -38,7 +38,7 @@ import (
func newCluster(clusterName string, serverUrl string) *federationv1beta1.Cluster {
cluster := federationv1beta1.Cluster{
TypeMeta: metav1.TypeMeta{APIVersion: testapi.Federation.GroupVersion().String()},
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
UID: uuid.NewUUID(),
Name: clusterName,
},

View File

@ -45,6 +45,7 @@ go_test(
"//pkg/client/clientset_generated/clientset:go_default_library",
"//pkg/client/clientset_generated/clientset/fake:go_default_library",
"//vendor:github.com/stretchr/testify/assert",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/types",
"//vendor:k8s.io/apimachinery/pkg/util/wait",

View File

@ -21,6 +21,7 @@ import (
"testing"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
@ -78,7 +79,7 @@ func TestConfigMapController(t *testing.T) {
configmapController.Run(stop)
configmap1 := &apiv1.ConfigMap{
ObjectMeta: apiv1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test-configmap",
Namespace: "ns",
SelfLink: "/api/v1/namespaces/ns/configmaps/test-configmap",

View File

@ -82,7 +82,7 @@ func TestDaemonSetController(t *testing.T) {
daemonsetController.Run(stop)
daemonset1 := extensionsv1.DaemonSet{
ObjectMeta: apiv1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test-daemonset",
Namespace: "ns",
SelfLink: "/api/v1/namespaces/ns/daemonsets/test-daemonset",

View File

@ -53,6 +53,7 @@ go_test(
"//pkg/client/clientset_generated/clientset/fake:go_default_library",
"//vendor:github.com/stretchr/testify/assert",
"//vendor:k8s.io/apimachinery/pkg/api/meta",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/types",
"//vendor:k8s.io/apimachinery/pkg/util/wait",

View File

@ -23,6 +23,7 @@ import (
"time"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
@ -174,7 +175,7 @@ func GetDeploymentFromChan(c chan runtime.Object) *extensionsv1.Deployment {
func newDeploymentWithReplicas(name string, replicas int32) *extensionsv1.Deployment {
return &extensionsv1.Deployment{
ObjectMeta: apiv1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: apiv1.NamespaceDefault,
SelfLink: "/api/v1/namespaces/default/deployments/name",

View File

@ -28,6 +28,7 @@ go_library(
"//pkg/util/flowcontrol:go_default_library",
"//vendor:github.com/golang/glog",
"//vendor:k8s.io/apimachinery/pkg/api/errors",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/types",
@ -54,6 +55,7 @@ go_test(
"//vendor:github.com/golang/glog",
"//vendor:github.com/stretchr/testify/assert",
"//vendor:k8s.io/apimachinery/pkg/api/errors",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/types",
"//vendor:k8s.io/apimachinery/pkg/util/wait",

View File

@ -22,6 +22,7 @@ import (
"time"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
pkgruntime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
@ -764,9 +765,9 @@ func (ic *IngressController) reconcileIngress(ingress types.NamespacedName) {
if err != nil {
glog.Errorf("Error deep copying Spec: %v", err)
}
objMetaCopy, ok := objMeta.(*v1.ObjectMeta)
objMetaCopy, ok := objMeta.(*metav1.ObjectMeta)
if !ok {
glog.Errorf("Internal error: Failed to cast to *v1.ObjectMeta: %v", objMeta)
glog.Errorf("Internal error: Failed to cast to *metav1.ObjectMeta: %v", objMeta)
}
desiredIngress.ObjectMeta = *objMetaCopy
objSpecCopy, ok := objSpec.(*extensionsv1beta1.IngressSpec)
@ -857,9 +858,9 @@ func (ic *IngressController) reconcileIngress(ingress types.NamespacedName) {
glog.Errorf("Error deep copying ObjectMeta: %v", err)
ic.deliverIngress(ingress, ic.ingressReviewDelay, true)
}
objMetaCopy, ok := objMeta.(*v1.ObjectMeta)
objMetaCopy, ok := objMeta.(*metav1.ObjectMeta)
if !ok {
glog.Errorf("Internal error: Failed to cast to v1.ObjectMeta: %v", objMeta)
glog.Errorf("Internal error: Failed to cast to metav1.ObjectMeta: %v", objMeta)
ic.deliverIngress(ingress, ic.ingressReviewDelay, true)
}
desiredIngress.ObjectMeta = *objMetaCopy

View File

@ -23,6 +23,7 @@ import (
"time"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
@ -108,7 +109,7 @@ func TestIngressController(t *testing.T) {
// Add another test without that annotation when
// https://github.com/kubernetes/kubernetes/issues/36540 is fixed.
fedIngress := extensionsv1beta1.Ingress{
ObjectMeta: apiv1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test-ingress",
Namespace: "mynamespace",
SelfLink: "/api/v1/namespaces/mynamespace/ingress/test-ingress",
@ -282,7 +283,7 @@ func GetClusterFromChan(c chan runtime.Object) *federationapi.Cluster {
func NewConfigMap(uid string) *apiv1.ConfigMap {
return &apiv1.ConfigMap{
ObjectMeta: apiv1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: uidConfigMapName,
Namespace: uidConfigMapNamespace,
SelfLink: "/api/v1/namespaces/" + uidConfigMapNamespace + "/configmap/" + uidConfigMapName,

View File

@ -42,7 +42,7 @@ func TestNamespaceController(t *testing.T) {
cluster1 := NewCluster("cluster1", apiv1.ConditionTrue)
cluster2 := NewCluster("cluster2", apiv1.ConditionTrue)
ns1 := apiv1.Namespace{
ObjectMeta: apiv1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test-namespace",
SelfLink: "/api/v1/namespaces/test-namespace",
},
@ -71,19 +71,19 @@ func TestNamespaceController(t *testing.T) {
RegisterFakeList("replicasets", &fakeClient.Fake, &extensionsv1.ReplicaSetList{Items: []extensionsv1.ReplicaSet{
{
ObjectMeta: apiv1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test-rs",
Namespace: ns1.Namespace,
}}}})
RegisterFakeList("secrets", &fakeClient.Fake, &apiv1.SecretList{Items: []apiv1.Secret{
{
ObjectMeta: apiv1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test-secret",
Namespace: ns1.Namespace,
}}}})
RegisterFakeList("services", &fakeClient.Fake, &apiv1.ServiceList{Items: []apiv1.Service{
{
ObjectMeta: apiv1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test-service",
Namespace: ns1.Namespace,
}}}})

View File

@ -182,7 +182,7 @@ func TestReplicaSetController(t *testing.T) {
func newReplicaSetWithReplicas(name string, replicas int32) *extensionsv1.ReplicaSet {
return &extensionsv1.ReplicaSet{
ObjectMeta: apiv1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: apiv1.NamespaceDefault,
SelfLink: "/api/v1/namespaces/default/replicasets/name",

View File

@ -49,6 +49,7 @@ go_test(
"//pkg/client/clientset_generated/clientset/fake:go_default_library",
"//vendor:github.com/golang/glog",
"//vendor:github.com/stretchr/testify/assert",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/types",
"//vendor:k8s.io/apimachinery/pkg/util/wait",

View File

@ -22,6 +22,7 @@ import (
"testing"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
@ -82,7 +83,7 @@ func TestSecretController(t *testing.T) {
secretController.Run(stop)
secret1 := apiv1.Secret{
ObjectMeta: apiv1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test-secret",
Namespace: "ns",
SelfLink: "/api/v1/namespaces/ns/secrets/test-secret",

View File

@ -61,6 +61,7 @@ go_test(
"//federation/apis/federation/v1beta1:go_default_library",
"//federation/pkg/dnsprovider/providers/google/clouddns:go_default_library",
"//pkg/api/v1:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/util/sets",
],
)

View File

@ -24,6 +24,7 @@ import (
"reflect"
"sort"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/kubernetes/federation/apis/federation/v1beta1"
"k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns" // Only for unit testing purposes.
@ -40,7 +41,7 @@ func TestServiceController_ensureDnsRecords(t *testing.T) {
{
name: "withip",
service: v1.Service{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "servicename",
Namespace: "servicenamespace",
},
@ -58,7 +59,7 @@ func TestServiceController_ensureDnsRecords(t *testing.T) {
{
name: "withname",
service: v1.Service{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "servicename",
Namespace: "servicenamespace",
},
@ -74,7 +75,7 @@ func TestServiceController_ensureDnsRecords(t *testing.T) {
{
name: "noendpoints",
service: v1.Service{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "servicename",
Namespace: "servicenamespace",
},

View File

@ -20,6 +20,7 @@ import (
"reflect"
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api/v1"
)
@ -74,7 +75,7 @@ func TestProcessServiceUpdate(t *testing.T) {
"diff-cluster",
&cachedService{
lastState: &v1.Service{
ObjectMeta: v1.ObjectMeta{Name: "bar1"},
ObjectMeta: metav1.ObjectMeta{Name: "bar1"},
},
serviceStatusMap: map[string]v1.LoadBalancerStatus{
"foo2": {Ingress: []v1.LoadBalancerIngress{{IP: "ip1", Hostname: ""}}},

View File

@ -70,6 +70,7 @@ go_test(
"//pkg/client/testing/core:go_default_library",
"//pkg/controller/deployment/util:go_default_library",
"//vendor:github.com/stretchr/testify/assert",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/watch",
],

View File

@ -19,7 +19,7 @@ package util
import (
"reflect"
api_v1 "k8s.io/kubernetes/pkg/api/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
extensions_v1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
deputils "k8s.io/kubernetes/pkg/controller/deployment/util"
)
@ -60,7 +60,7 @@ func DeploymentEquivalent(a, b *extensions_v1.Deployment) bool {
}
// Copies object meta for Deployment, skipping revision information.
func DeepCopyDeploymentObjectMeta(meta api_v1.ObjectMeta) api_v1.ObjectMeta {
func DeepCopyDeploymentObjectMeta(meta metav1.ObjectMeta) metav1.ObjectMeta {
meta = DeepCopyRelevantObjectMeta(meta)
delete(meta.Annotations, deputils.RevisionAnnotation)
return meta

View File

@ -19,6 +19,7 @@ package util
import (
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
apiv1 "k8s.io/kubernetes/pkg/api/v1"
extensionsv1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
deputils "k8s.io/kubernetes/pkg/controller/deployment/util"
@ -58,7 +59,7 @@ func TestDeploymentCopy(t *testing.T) {
func newDeployment() *extensionsv1.Deployment {
replicas := int32(5)
return &extensionsv1.Deployment{
ObjectMeta: apiv1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "wrr",
Namespace: apiv1.NamespaceDefault,
SelfLink: "/api/v1/namespaces/default/deployments/name123",

View File

@ -31,6 +31,7 @@ go_test(
"//pkg/api/v1:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:github.com/stretchr/testify/assert",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/runtime",
],
)

View File

@ -19,6 +19,7 @@ package eventsink
import (
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
fakefedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/fake"
. "k8s.io/kubernetes/federation/pkg/federation-controller/util/test"
@ -46,7 +47,7 @@ func TestEventSink(t *testing.T) {
})
event := apiv1.Event{
ObjectMeta: apiv1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "bzium",
Namespace: "ns",
},

View File

@ -20,6 +20,7 @@ import (
"testing"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch"
federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1"
@ -40,7 +41,7 @@ func TestFederatedInformer(t *testing.T) {
// Add a single cluster to federation and remove it when needed.
cluster := federationapi.Cluster{
ObjectMeta: apiv1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "mycluster",
},
Status: federationapi.ClusterStatus{
@ -65,7 +66,7 @@ func TestFederatedInformer(t *testing.T) {
fakeKubeClient := &fakekubeclientset.Clientset{}
// There is a single service ns1/s1 in cluster mycluster.
service := apiv1.Service{
ObjectMeta: apiv1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns1",
Name: "s1",
},

View File

@ -21,6 +21,7 @@ import (
"testing"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
pkgruntime "k8s.io/apimachinery/pkg/runtime"
federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1"
apiv1 "k8s.io/kubernetes/pkg/api/v1"
@ -136,7 +137,7 @@ func TestFederatedUpdaterTimeout(t *testing.T) {
func makeService(cluster, name string) *apiv1.Service {
return &apiv1.Service{
ObjectMeta: apiv1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns1",
Name: name,
},

View File

@ -20,8 +20,8 @@ import (
"fmt"
"reflect"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
pkgruntime "k8s.io/apimachinery/pkg/runtime"
apiv1 "k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/client/cache"
)
@ -68,8 +68,8 @@ func NewTriggerOnMetaAndSpecChanges(triggerFunc func(pkgruntime.Object)) *cache.
},
UpdateFunc: func(old, cur interface{}) {
curObj := cur.(pkgruntime.Object)
oldMeta := getFieldOrPanic(old, "ObjectMeta").(apiv1.ObjectMeta)
curMeta := getFieldOrPanic(cur, "ObjectMeta").(apiv1.ObjectMeta)
oldMeta := getFieldOrPanic(old, "ObjectMeta").(metav1.ObjectMeta)
curMeta := getFieldOrPanic(cur, "ObjectMeta").(metav1.ObjectMeta)
if !ObjectMetaEquivalent(oldMeta, curMeta) ||
!reflect.DeepEqual(getFieldOrPanic(old, "Spec"), getFieldOrPanic(cur, "Spec")) {
triggerFunc(curObj)

View File

@ -19,6 +19,7 @@ package util
import (
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
pkgruntime "k8s.io/apimachinery/pkg/runtime"
apiv1 "k8s.io/kubernetes/pkg/api/v1"
@ -28,13 +29,13 @@ import (
func TestHandlers(t *testing.T) {
// There is a single service ns1/s1 in cluster mycluster.
service := apiv1.Service{
ObjectMeta: apiv1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns1",
Name: "s1",
},
}
service2 := apiv1.Service{
ObjectMeta: apiv1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns1",
Name: "s1",
Annotations: map[string]string{
@ -82,7 +83,7 @@ func TestHandlers(t *testing.T) {
assert.True(t, triggered())
service3 := apiv1.Service{
ObjectMeta: apiv1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns1",
Name: "s1",
},

View File

@ -19,16 +19,16 @@ package util
import (
"reflect"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/kubernetes/pkg/api"
api_v1 "k8s.io/kubernetes/pkg/api/v1"
)
// Copies cluster-independent, user provided data from the given ObjectMeta struct. If in
// the future the ObjectMeta structure is expanded then any field that is not populated
// by the api server should be included here.
func copyObjectMeta(obj api_v1.ObjectMeta) api_v1.ObjectMeta {
return api_v1.ObjectMeta{
func copyObjectMeta(obj metav1.ObjectMeta) metav1.ObjectMeta {
return metav1.ObjectMeta{
Name: obj.Name,
Namespace: obj.Namespace,
Labels: obj.Labels,
@ -39,7 +39,7 @@ func copyObjectMeta(obj api_v1.ObjectMeta) api_v1.ObjectMeta {
// Deep copies cluster-independent, user provided data from the given ObjectMeta struct. If in
// the future the ObjectMeta structure is expanded then any field that is not populated
// by the api server should be included here.
func DeepCopyRelevantObjectMeta(obj api_v1.ObjectMeta) api_v1.ObjectMeta {
func DeepCopyRelevantObjectMeta(obj metav1.ObjectMeta) metav1.ObjectMeta {
copyMeta := copyObjectMeta(obj)
if obj.Labels != nil {
copyMeta.Labels = make(map[string]string)
@ -59,7 +59,7 @@ func DeepCopyRelevantObjectMeta(obj api_v1.ObjectMeta) api_v1.ObjectMeta {
// Checks if cluster-independent, user provided data in two given ObjectMeta are equal. If in
// the future the ObjectMeta structure is expanded then any field that is not populated
// by the api server should be included here.
func ObjectMetaEquivalent(a, b api_v1.ObjectMeta) bool {
func ObjectMetaEquivalent(a, b metav1.ObjectMeta) bool {
if a.Name != b.Name {
return false
}
@ -78,8 +78,8 @@ func ObjectMetaEquivalent(a, b api_v1.ObjectMeta) bool {
// Checks if cluster-independent, user provided data in ObjectMeta and Spec in two given top
// level api objects are equivalent.
func ObjectMetaAndSpecEquivalent(a, b runtime.Object) bool {
objectMetaA := reflect.ValueOf(a).Elem().FieldByName("ObjectMeta").Interface().(api_v1.ObjectMeta)
objectMetaB := reflect.ValueOf(b).Elem().FieldByName("ObjectMeta").Interface().(api_v1.ObjectMeta)
objectMetaA := reflect.ValueOf(a).Elem().FieldByName("ObjectMeta").Interface().(metav1.ObjectMeta)
objectMetaB := reflect.ValueOf(b).Elem().FieldByName("ObjectMeta").Interface().(metav1.ObjectMeta)
specA := reflect.ValueOf(a).Elem().FieldByName("Spec").Interface()
specB := reflect.ValueOf(b).Elem().FieldByName("Spec").Interface()
return ObjectMetaEquivalent(objectMetaA, objectMetaB) && reflect.DeepEqual(specA, specB)

View File

@ -19,51 +19,52 @@ package util
import (
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
api_v1 "k8s.io/kubernetes/pkg/api/v1"
"github.com/stretchr/testify/assert"
)
func TestObjectMeta(t *testing.T) {
o1 := api_v1.ObjectMeta{
o1 := metav1.ObjectMeta{
Namespace: "ns1",
Name: "s1",
UID: "1231231412",
ResourceVersion: "999",
}
o2 := copyObjectMeta(o1)
o3 := api_v1.ObjectMeta{
o3 := metav1.ObjectMeta{
Namespace: "ns1",
Name: "s1",
UID: "1231231412",
Annotations: map[string]string{"A": "B"},
}
o4 := api_v1.ObjectMeta{
o4 := metav1.ObjectMeta{
Namespace: "ns1",
Name: "s1",
UID: "1231255531412",
Annotations: map[string]string{"A": "B"},
}
o5 := api_v1.ObjectMeta{
o5 := metav1.ObjectMeta{
Namespace: "ns1",
Name: "s1",
ResourceVersion: "1231231412",
Annotations: map[string]string{"A": "B"},
}
o6 := api_v1.ObjectMeta{
o6 := metav1.ObjectMeta{
Namespace: "ns1",
Name: "s1",
ResourceVersion: "1231255531412",
Annotations: map[string]string{"A": "B"},
}
o7 := api_v1.ObjectMeta{
o7 := metav1.ObjectMeta{
Namespace: "ns1",
Name: "s1",
ResourceVersion: "1231255531412",
Annotations: map[string]string{},
Labels: map[string]string{},
}
o8 := api_v1.ObjectMeta{
o8 := metav1.ObjectMeta{
Namespace: "ns1",
Name: "s1",
ResourceVersion: "1231255531412",
@ -82,7 +83,7 @@ func TestObjectMeta(t *testing.T) {
func TestObjectMetaAndSpec(t *testing.T) {
s1 := api_v1.Service{
ObjectMeta: api_v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns1",
Name: "s1",
},
@ -92,7 +93,7 @@ func TestObjectMetaAndSpec(t *testing.T) {
}
s1b := s1
s2 := api_v1.Service{
ObjectMeta: api_v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns1",
Name: "s2",
},
@ -101,7 +102,7 @@ func TestObjectMetaAndSpec(t *testing.T) {
},
}
s3 := api_v1.Service{
ObjectMeta: api_v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Namespace: "ns1",
Name: "s1",
},

View File

@ -95,7 +95,7 @@ func TestAnalyze(t *testing.T) {
func newReplicaSet(selectorMap map[string]string) *v1beta1.ReplicaSet {
replicas := int32(3)
rs := &v1beta1.ReplicaSet{
ObjectMeta: api_v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "foobar",
Namespace: "default",
},
@ -109,7 +109,7 @@ func newReplicaSet(selectorMap map[string]string) *v1beta1.ReplicaSet {
func newPod(name string, rs *v1beta1.ReplicaSet, status api_v1.PodStatus) *api_v1.Pod {
return &api_v1.Pod{
ObjectMeta: api_v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: rs.Namespace,
Labels: rs.Spec.Selector.MatchLabels,

View File

@ -18,6 +18,7 @@ go_library(
"//pkg/api/v1:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:github.com/golang/glog",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/util/wait",
"//vendor:k8s.io/apimachinery/pkg/watch",

View File

@ -24,6 +24,7 @@ import (
"sync"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apimachinery/pkg/watch"
@ -264,7 +265,7 @@ func CheckObjectFromChan(c chan runtime.Object, checkFunction CheckingFunction)
}
// CompareObjectMeta returns an error when the given objects are not equivalent.
func CompareObjectMeta(a, b apiv1.ObjectMeta) error {
func CompareObjectMeta(a, b metav1.ObjectMeta) error {
if a.Namespace != b.Namespace {
return fmt.Errorf("Different namespace expected:%s observed:%s", a.Namespace, b.Namespace)
}
@ -288,7 +289,7 @@ func ToFederatedInformerForTestOnly(informer util.FederatedInformer) util.Federa
// NewCluster builds a new cluster object.
func NewCluster(name string, readyStatus apiv1.ConditionStatus) *federationapi.Cluster {
return &federationapi.Cluster{
ObjectMeta: apiv1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Annotations: map[string]string{},
},

View File

@ -250,7 +250,7 @@ func initFederation(cmdOut io.Writer, config util.AdminConfig, cmd *cobra.Comman
func createNamespace(clientset *client.Clientset, namespace string, dryRun bool) (*api.Namespace, error) {
ns := &api.Namespace{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: namespace,
},
}
@ -264,7 +264,7 @@ func createNamespace(clientset *client.Clientset, namespace string, dryRun bool)
func createService(clientset *client.Clientset, namespace, svcName string, dryRun bool) (*api.Service, error) {
svc := &api.Service{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: svcName,
Namespace: namespace,
Labels: componentLabel,
@ -353,7 +353,7 @@ func genCerts(svcNamespace, name, svcName, localDNSZoneName string, ips, hostnam
func createAPIServerCredentialsSecret(clientset *client.Clientset, namespace, credentialsName string, entKeyPairs *entityKeyPairs, dryRun bool) (*api.Secret, error) {
// Build the secret object with API server credentials.
secret := &api.Secret{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: credentialsName,
Namespace: namespace,
},
@ -391,7 +391,7 @@ func createPVC(clientset *client.Clientset, namespace, svcName, etcdPVCapacity s
}
pvc := &api.PersistentVolumeClaim{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf("%s-etcd-claim", svcName),
Namespace: namespace,
Labels: componentLabel,
@ -438,7 +438,7 @@ func createAPIServer(clientset *client.Clientset, namespace, name, image, creden
dataVolumeName := "etcddata"
dep := &extensions.Deployment{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
Labels: componentLabel,
@ -446,7 +446,7 @@ func createAPIServer(clientset *client.Clientset, namespace, name, image, creden
Spec: extensions.DeploymentSpec{
Replicas: 1,
Template: api.PodTemplateSpec{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Labels: apiserverPodLabels,
},
@ -522,7 +522,7 @@ func createAPIServer(clientset *client.Clientset, namespace, name, image, creden
func createControllerManager(clientset *client.Clientset, namespace, name, svcName, cmName, image, kubeconfigName, dnsZoneName, dnsProvider string, dryRun bool) (*extensions.Deployment, error) {
dep := &extensions.Deployment{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: cmName,
Namespace: namespace,
Labels: componentLabel,
@ -530,7 +530,7 @@ func createControllerManager(clientset *client.Clientset, namespace, name, svcNa
Spec: extensions.DeploymentSpec{
Replicas: 1,
Template: api.PodTemplateSpec{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: cmName,
Labels: controllerManagerPodLabels,
},

View File

@ -465,7 +465,7 @@ func fakeInitHostFactory(federationName, namespaceName, ip, dnsZoneName, image,
Kind: "Namespace",
APIVersion: testapi.Default.GroupVersion().String(),
},
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: namespaceName,
},
}
@ -475,7 +475,7 @@ func fakeInitHostFactory(federationName, namespaceName, ip, dnsZoneName, image,
Kind: "Service",
APIVersion: testapi.Default.GroupVersion().String(),
},
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Namespace: namespaceName,
Name: svcName,
Labels: componentLabel,
@ -510,7 +510,7 @@ func fakeInitHostFactory(federationName, namespaceName, ip, dnsZoneName, image,
Kind: "Secret",
APIVersion: testapi.Default.GroupVersion().String(),
},
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: credSecretName,
Namespace: namespaceName,
},
@ -522,7 +522,7 @@ func fakeInitHostFactory(federationName, namespaceName, ip, dnsZoneName, image,
Kind: "Secret",
APIVersion: testapi.Default.GroupVersion().String(),
},
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: cmKubeconfigSecretName,
Namespace: namespaceName,
},
@ -534,7 +534,7 @@ func fakeInitHostFactory(federationName, namespaceName, ip, dnsZoneName, image,
Kind: "PersistentVolumeClaim",
APIVersion: testapi.Default.GroupVersion().String(),
},
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: pvcName,
Namespace: namespaceName,
Labels: componentLabel,
@ -559,7 +559,7 @@ func fakeInitHostFactory(federationName, namespaceName, ip, dnsZoneName, image,
Kind: "Deployment",
APIVersion: testapi.Extensions.GroupVersion().String(),
},
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: svcName,
Namespace: namespaceName,
Labels: componentLabel,
@ -568,7 +568,7 @@ func fakeInitHostFactory(federationName, namespaceName, ip, dnsZoneName, image,
Replicas: &replicas,
Selector: nil,
Template: v1.PodTemplateSpec{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: svcName,
Labels: apiserverPodLabels,
},
@ -652,7 +652,7 @@ func fakeInitHostFactory(federationName, namespaceName, ip, dnsZoneName, image,
Kind: "Deployment",
APIVersion: testapi.Extensions.GroupVersion().String(),
},
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: cmName,
Namespace: namespaceName,
Labels: componentLabel,
@ -661,7 +661,7 @@ func fakeInitHostFactory(federationName, namespaceName, ip, dnsZoneName, image,
Replicas: &replicas,
Selector: nil,
Template: v1.PodTemplateSpec{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: cmName,
Labels: controllerManagerPodLabels,
},
@ -720,7 +720,7 @@ func fakeInitHostFactory(federationName, namespaceName, ip, dnsZoneName, image,
Kind: "Pod",
APIVersion: testapi.Extensions.GroupVersion().String(),
},
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: svcName,
Namespace: namespaceName,
},
@ -734,7 +734,7 @@ func fakeInitHostFactory(federationName, namespaceName, ip, dnsZoneName, image,
Kind: "Pod",
APIVersion: testapi.Extensions.GroupVersion().String(),
},
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: cmName,
Namespace: namespaceName,
},

View File

@ -237,7 +237,7 @@ func fakeJoinHostFactory(clusterName, clusterCtx, secretName, server, token stri
Kind: "Secret",
APIVersion: "v1",
},
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: secretName,
Namespace: util.DefaultFederationSystemNamespace,
},
@ -277,7 +277,7 @@ func fakeJoinHostFactory(clusterName, clusterCtx, secretName, server, token stri
func fakeCluster(clusterName, secretName, server string) federationapi.Cluster {
return federationapi.Cluster{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: clusterName,
},
Spec: federationapi.ClusterSpec{

View File

@ -20,6 +20,7 @@ go_library(
"//pkg/kubectl/cmd:go_default_library",
"//pkg/kubectl/cmd/util:go_default_library",
"//vendor:github.com/spf13/cobra",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
],
)

View File

@ -17,6 +17,7 @@ limitations under the License.
package util
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
fedclient "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset"
"k8s.io/kubernetes/pkg/api"
client "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
@ -135,7 +136,7 @@ func CreateKubeconfigSecret(clientset *client.Clientset, kubeconfig *clientcmdap
// Build the secret object with the minified and flattened
// kubeconfig content.
secret := &api.Secret{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
},

View File

@ -43,6 +43,7 @@ go_test(
"//pkg/api:go_default_library",
"//pkg/api/testing:go_default_library",
"//pkg/fields:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apiserver/pkg/request",
],

View File

@ -35,6 +35,7 @@ go_test(
"//pkg/registry/generic:go_default_library",
"//pkg/registry/registrytest:go_default_library",
"//pkg/storage/etcd/testing:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/runtime",
],

View File

@ -19,6 +19,7 @@ package etcd
import (
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/kubernetes/federation/apis/federation"
@ -43,7 +44,7 @@ func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
func validNewCluster() *federation.Cluster {
return &federation.Cluster{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
Labels: map[string]string{
"name": "foo",
@ -70,11 +71,11 @@ func TestCreate(t *testing.T) {
defer server.Terminate(t)
test := registrytest.New(t, storage.Store).ClusterScope()
cluster := validNewCluster()
cluster.ObjectMeta = api.ObjectMeta{GenerateName: "foo"}
cluster.ObjectMeta = metav1.ObjectMeta{GenerateName: "foo"}
test.TestCreate(
cluster,
&federation.Cluster{
ObjectMeta: api.ObjectMeta{Name: "-a123-a_"},
ObjectMeta: metav1.ObjectMeta{Name: "-a123-a_"},
},
)
}

View File

@ -21,6 +21,7 @@ import (
"reflect"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
genericapirequest "k8s.io/apiserver/pkg/request"
"k8s.io/kubernetes/federation/apis/federation"
@ -31,7 +32,7 @@ import (
func validNewCluster() *federation.Cluster {
return &federation.Cluster{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
ResourceVersion: "4",
Labels: map[string]string{
@ -57,7 +58,7 @@ func validNewCluster() *federation.Cluster {
func invalidNewCluster() *federation.Cluster {
// Create a cluster with empty ServerAddressByClientCIDRs (which is a required field).
return &federation.Cluster{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "foo2",
ResourceVersion: "5",
},

View File

@ -41,7 +41,7 @@ var benchmarkPod api.Pod = api.Pod{
Kind: "Pod",
APIVersion: "v1",
},
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "etcd-server-e2e-test-wojtekt-master",
Namespace: "default",
SelfLink: "/api/v1/namespaces/default/pods/etcd-server-e2e-test-wojtekt-master",

View File

@ -31,7 +31,7 @@ import (
var _ metav1.Object = &metav1.ObjectMeta{}
func getObjectMetaAndOwnerReferences() (objectMeta api.ObjectMeta, metaOwnerReferences []metav1.OwnerReference) {
func getObjectMetaAndOwnerReferences() (objectMeta metav1.ObjectMeta, metaOwnerReferences []metav1.OwnerReference) {
fuzz.New().NilChance(.5).NumElements(1, 5).Fuzz(&objectMeta)
references := objectMeta.OwnerReferences
metaOwnerReferences = make([]metav1.OwnerReference, 0)
@ -60,7 +60,7 @@ func testGetOwnerReferences(t *testing.T) {
func testSetOwnerReferences(t *testing.T) {
expected, newRefs := getObjectMetaAndOwnerReferences()
objectMeta := &api.ObjectMeta{}
objectMeta := &metav1.ObjectMeta{}
objectMeta.SetOwnerReferences(newRefs)
if !reflect.DeepEqual(expected.OwnerReferences, objectMeta.OwnerReferences) {
t.Errorf("expect: %#v\n got: %#v", expected.OwnerReferences, objectMeta.OwnerReferences)

View File

@ -52,7 +52,7 @@ func init() {
}
func TestUniversalDeserializer(t *testing.T) {
expected := &v1.Pod{ObjectMeta: v1.ObjectMeta{Name: "test"}}
expected := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "test"}}
d := api.Codecs.UniversalDeserializer()
for _, mediaType := range []string{"application/json", "application/yaml", "application/vnd.kubernetes.protobuf"} {
info, ok := runtime.SerializerInfoForMediaType(api.Codecs.SupportedMediaTypes(), mediaType)

View File

@ -356,7 +356,7 @@ func roundTrip(t *testing.T, codec runtime.Codec, item runtime.Object) {
func TestEncodePtr(t *testing.T) {
grace := int64(30)
pod := &api.Pod{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{"name": "foo"},
},
Spec: api.PodSpec{

View File

@ -77,7 +77,7 @@ func FuzzerFor(t *testing.T, version schema.GroupVersion, src rand.Source) *fuzz
j.APIVersion = ""
j.Kind = ""
},
func(j *api.ObjectMeta, c fuzz.Continue) {
func(j *metav1.ObjectMeta, c fuzz.Continue) {
j.Name = c.RandString()
j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10)
j.SelfLink = c.RandString()

View File

@ -21,11 +21,11 @@ import (
"reflect"
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/api/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/util/intstr"
)
@ -60,7 +60,7 @@ func TestSetDefaultReplicationController(t *testing.T) {
rc: &v1.ReplicationController{
Spec: v1.ReplicationControllerSpec{
Template: &v1.PodTemplateSpec{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
"foo": "bar",
},
@ -73,14 +73,14 @@ func TestSetDefaultReplicationController(t *testing.T) {
},
{
rc: &v1.ReplicationController{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
"bar": "foo",
},
},
Spec: v1.ReplicationControllerSpec{
Template: &v1.PodTemplateSpec{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
"foo": "bar",
},
@ -93,7 +93,7 @@ func TestSetDefaultReplicationController(t *testing.T) {
},
{
rc: &v1.ReplicationController{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
"bar": "foo",
},
@ -103,7 +103,7 @@ func TestSetDefaultReplicationController(t *testing.T) {
"some": "other",
},
Template: &v1.PodTemplateSpec{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
"foo": "bar",
},
@ -121,7 +121,7 @@ func TestSetDefaultReplicationController(t *testing.T) {
"some": "other",
},
Template: &v1.PodTemplateSpec{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
"foo": "bar",
},
@ -174,7 +174,7 @@ func TestSetDefaultReplicationControllerReplicas(t *testing.T) {
rc: v1.ReplicationController{
Spec: v1.ReplicationControllerSpec{
Template: &v1.PodTemplateSpec{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
"foo": "bar",
},
@ -189,7 +189,7 @@ func TestSetDefaultReplicationControllerReplicas(t *testing.T) {
Spec: v1.ReplicationControllerSpec{
Replicas: newInt(0),
Template: &v1.PodTemplateSpec{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
"foo": "bar",
},
@ -204,7 +204,7 @@ func TestSetDefaultReplicationControllerReplicas(t *testing.T) {
Spec: v1.ReplicationControllerSpec{
Replicas: newInt(3),
Template: &v1.PodTemplateSpec{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
"foo": "bar",
},
@ -255,7 +255,7 @@ func TestSetDefaultReplicationControllerImagePullPolicy(t *testing.T) {
rc: v1.ReplicationController{
Spec: v1.ReplicationControllerSpec{
Template: &v1.PodTemplateSpec{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Annotations: map[string]string{
"pod.beta.kubernetes.io/init-containers": string(containersWithoutPullPolicy),
},
@ -269,7 +269,7 @@ func TestSetDefaultReplicationControllerImagePullPolicy(t *testing.T) {
rc: v1.ReplicationController{
Spec: v1.ReplicationControllerSpec{
Template: &v1.PodTemplateSpec{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Annotations: map[string]string{
"pod.beta.kubernetes.io/init-containers": string(containersWithPullPolicy),
},
@ -725,7 +725,7 @@ func TestDefaultRequestIsNotSetForReplicationController(t *testing.T) {
Spec: v1.ReplicationControllerSpec{
Replicas: newInt(3),
Template: &v1.PodTemplateSpec{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
"foo": "bar",
},
@ -745,7 +745,7 @@ func TestDefaultRequestIsNotSetForReplicationController(t *testing.T) {
func TestSetDefaultLimitRangeItem(t *testing.T) {
limitRange := &v1.LimitRange{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test-defaults",
},
Spec: v1.LimitRangeSpec{

File diff suppressed because it is too large Load Diff

View File

@ -141,7 +141,7 @@ message Binding {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// The target object that you want to bind to the standard object.
optional ObjectReference target = 2;
@ -240,7 +240,7 @@ message ComponentStatus {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// List of component conditions observed
// +optional
@ -263,7 +263,7 @@ message ConfigMap {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Data contains the configuration data.
// Each key must be a valid DNS_SUBDOMAIN with an optional leading dot.
@ -767,7 +767,7 @@ message Endpoints {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// The set of all endpoints is the union of all subsets. Addresses are placed into
// subsets according to the IPs they share. A single address with multiple ports,
@ -848,7 +848,7 @@ message EnvVarSource {
message Event {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
optional ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// The object that this event is about.
optional ObjectReference involvedObject = 2;
@ -1195,7 +1195,7 @@ message LimitRange {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the limits enforced.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
@ -1347,7 +1347,7 @@ message Namespace {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the behavior of the Namespace.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
@ -1394,7 +1394,7 @@ message Node {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the behavior of a node.
// http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
@ -1652,6 +1652,8 @@ message ObjectFieldSelector {
// ObjectMeta is metadata that all persisted resources must have, which includes all objects
// users must create.
// DEPRECATED: Use k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta instead - this type will be removed soon.
// +k8s:openapi-gen=false
message ObjectMeta {
// Name must be unique within a namespace. Is required when creating resources, although
// some resources may allow a client to request the generation of an appropriate name
@ -1848,7 +1850,7 @@ message PersistentVolume {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines a specification of a persistent volume owned by the cluster.
// Provisioned by an administrator.
@ -1869,7 +1871,7 @@ message PersistentVolumeClaim {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the desired characteristics of a volume requested by a pod author.
// More info: http://kubernetes.io/docs/user-guide/persistent-volumes#persistentvolumeclaims
@ -2111,7 +2113,7 @@ message Pod {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the pod.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
@ -2607,7 +2609,7 @@ message PodStatusResult {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Most recently observed status of the pod.
// This data may not be up to date.
@ -2623,7 +2625,7 @@ message PodTemplate {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Template defines the pods that will be created from this pod template.
// http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
@ -2647,7 +2649,7 @@ message PodTemplateSpec {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the pod.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
@ -2806,7 +2808,7 @@ message RangeAllocation {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Range is string that identifies the range represented by 'data'.
optional string range = 2;
@ -2821,7 +2823,7 @@ message ReplicationController {
// be the same as the Pod(s) that the replication controller manages.
// Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the specification of the desired behavior of the replication controller.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
@ -2947,7 +2949,7 @@ message ResourceQuota {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the desired quota.
// http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
@ -3037,7 +3039,7 @@ message Secret {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN
// or leading dot followed by valid DNS_SUBDOMAIN.
@ -3169,7 +3171,7 @@ message Service {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the behavior of a service.
// http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status
@ -3192,7 +3194,7 @@ message ServiceAccount {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Secrets is the list of secrets allowed to be used by pods running using this ServiceAccount.
// More info: http://kubernetes.io/docs/user-guide/secrets

File diff suppressed because it is too large Load Diff

View File

@ -964,7 +964,7 @@ func (ObjectFieldSelector) SwaggerDoc() map[string]string {
}
var map_ObjectMeta = map[string]string{
"": "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.",
"": "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. DEPRECATED: Use k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta instead - this type will be removed soon.",
"name": "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names",
"generateName": "GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#idempotency",
"namespace": "Namespace defines the space within each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces",

View File

@ -489,9 +489,7 @@ func Convert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(in *api.Azure
}
func autoConvert_v1_Binding_To_api_Binding(in *Binding, out *api.Binding, s conversion.Scope) error {
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1_ObjectReference_To_api_ObjectReference(&in.Target, &out.Target, s); err != nil {
return err
}
@ -503,9 +501,7 @@ func Convert_v1_Binding_To_api_Binding(in *Binding, out *api.Binding, s conversi
}
func autoConvert_api_Binding_To_v1_Binding(in *api.Binding, out *Binding, s conversion.Scope) error {
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_api_ObjectReference_To_v1_ObjectReference(&in.Target, &out.Target, s); err != nil {
return err
}
@ -611,9 +607,7 @@ func Convert_api_ComponentCondition_To_v1_ComponentCondition(in *api.ComponentCo
}
func autoConvert_v1_ComponentStatus_To_api_ComponentStatus(in *ComponentStatus, out *api.ComponentStatus, s conversion.Scope) error {
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
out.Conditions = *(*[]api.ComponentCondition)(unsafe.Pointer(&in.Conditions))
return nil
}
@ -623,9 +617,7 @@ func Convert_v1_ComponentStatus_To_api_ComponentStatus(in *ComponentStatus, out
}
func autoConvert_api_ComponentStatus_To_v1_ComponentStatus(in *api.ComponentStatus, out *ComponentStatus, s conversion.Scope) error {
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
out.Conditions = *(*[]ComponentCondition)(unsafe.Pointer(&in.Conditions))
return nil
}
@ -655,9 +647,7 @@ func Convert_api_ComponentStatusList_To_v1_ComponentStatusList(in *api.Component
}
func autoConvert_v1_ConfigMap_To_api_ConfigMap(in *ConfigMap, out *api.ConfigMap, s conversion.Scope) error {
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
out.Data = *(*map[string]string)(unsafe.Pointer(&in.Data))
return nil
}
@ -667,9 +657,7 @@ func Convert_v1_ConfigMap_To_api_ConfigMap(in *ConfigMap, out *api.ConfigMap, s
}
func autoConvert_api_ConfigMap_To_v1_ConfigMap(in *api.ConfigMap, out *ConfigMap, s conversion.Scope) error {
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
out.Data = *(*map[string]string)(unsafe.Pointer(&in.Data))
return nil
}
@ -1175,9 +1163,7 @@ func Convert_api_EndpointSubset_To_v1_EndpointSubset(in *api.EndpointSubset, out
}
func autoConvert_v1_Endpoints_To_api_Endpoints(in *Endpoints, out *api.Endpoints, s conversion.Scope) error {
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
out.Subsets = *(*[]api.EndpointSubset)(unsafe.Pointer(&in.Subsets))
return nil
}
@ -1187,9 +1173,7 @@ func Convert_v1_Endpoints_To_api_Endpoints(in *Endpoints, out *api.Endpoints, s
}
func autoConvert_api_Endpoints_To_v1_Endpoints(in *api.Endpoints, out *Endpoints, s conversion.Scope) error {
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
out.Subsets = *(*[]EndpointSubset)(unsafe.Pointer(&in.Subsets))
return nil
}
@ -1285,9 +1269,7 @@ func Convert_api_EnvVarSource_To_v1_EnvVarSource(in *api.EnvVarSource, out *EnvV
}
func autoConvert_v1_Event_To_api_Event(in *Event, out *api.Event, s conversion.Scope) error {
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1_ObjectReference_To_api_ObjectReference(&in.InvolvedObject, &out.InvolvedObject, s); err != nil {
return err
}
@ -1308,9 +1290,7 @@ func Convert_v1_Event_To_api_Event(in *Event, out *api.Event, s conversion.Scope
}
func autoConvert_api_Event_To_v1_Event(in *api.Event, out *Event, s conversion.Scope) error {
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_api_ObjectReference_To_v1_ObjectReference(&in.InvolvedObject, &out.InvolvedObject, s); err != nil {
return err
}
@ -1683,9 +1663,7 @@ func Convert_api_Lifecycle_To_v1_Lifecycle(in *api.Lifecycle, out *Lifecycle, s
}
func autoConvert_v1_LimitRange_To_api_LimitRange(in *LimitRange, out *api.LimitRange, s conversion.Scope) error {
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1_LimitRangeSpec_To_api_LimitRangeSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -1697,9 +1675,7 @@ func Convert_v1_LimitRange_To_api_LimitRange(in *LimitRange, out *api.LimitRange
}
func autoConvert_api_LimitRange_To_v1_LimitRange(in *api.LimitRange, out *LimitRange, s conversion.Scope) error {
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_api_LimitRangeSpec_To_v1_LimitRangeSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -1929,9 +1905,7 @@ func Convert_api_NFSVolumeSource_To_v1_NFSVolumeSource(in *api.NFSVolumeSource,
}
func autoConvert_v1_Namespace_To_api_Namespace(in *Namespace, out *api.Namespace, s conversion.Scope) error {
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1_NamespaceSpec_To_api_NamespaceSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -1946,9 +1920,7 @@ func Convert_v1_Namespace_To_api_Namespace(in *Namespace, out *api.Namespace, s
}
func autoConvert_api_Namespace_To_v1_Namespace(in *api.Namespace, out *Namespace, s conversion.Scope) error {
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_api_NamespaceSpec_To_v1_NamespaceSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -2019,9 +1991,7 @@ func Convert_api_NamespaceStatus_To_v1_NamespaceStatus(in *api.NamespaceStatus,
}
func autoConvert_v1_Node_To_api_Node(in *Node, out *api.Node, s conversion.Scope) error {
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1_NodeSpec_To_api_NodeSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -2036,9 +2006,7 @@ func Convert_v1_Node_To_api_Node(in *Node, out *api.Node, s conversion.Scope) er
}
func autoConvert_api_Node_To_v1_Node(in *api.Node, out *Node, s conversion.Scope) error {
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_api_NodeSpec_To_v1_NodeSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -2457,9 +2425,7 @@ func Convert_api_ObjectReference_To_v1_ObjectReference(in *api.ObjectReference,
}
func autoConvert_v1_PersistentVolume_To_api_PersistentVolume(in *PersistentVolume, out *api.PersistentVolume, s conversion.Scope) error {
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1_PersistentVolumeSpec_To_api_PersistentVolumeSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -2474,9 +2440,7 @@ func Convert_v1_PersistentVolume_To_api_PersistentVolume(in *PersistentVolume, o
}
func autoConvert_api_PersistentVolume_To_v1_PersistentVolume(in *api.PersistentVolume, out *PersistentVolume, s conversion.Scope) error {
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_api_PersistentVolumeSpec_To_v1_PersistentVolumeSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -2491,9 +2455,7 @@ func Convert_api_PersistentVolume_To_v1_PersistentVolume(in *api.PersistentVolum
}
func autoConvert_v1_PersistentVolumeClaim_To_api_PersistentVolumeClaim(in *PersistentVolumeClaim, out *api.PersistentVolumeClaim, s conversion.Scope) error {
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1_PersistentVolumeClaimSpec_To_api_PersistentVolumeClaimSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -2508,9 +2470,7 @@ func Convert_v1_PersistentVolumeClaim_To_api_PersistentVolumeClaim(in *Persisten
}
func autoConvert_api_PersistentVolumeClaim_To_v1_PersistentVolumeClaim(in *api.PersistentVolumeClaim, out *PersistentVolumeClaim, s conversion.Scope) error {
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_api_PersistentVolumeClaimSpec_To_v1_PersistentVolumeClaimSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -2777,9 +2737,7 @@ func Convert_api_PhotonPersistentDiskVolumeSource_To_v1_PhotonPersistentDiskVolu
}
func autoConvert_v1_Pod_To_api_Pod(in *Pod, out *api.Pod, s conversion.Scope) error {
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1_PodSpec_To_api_PodSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -2790,9 +2748,7 @@ func autoConvert_v1_Pod_To_api_Pod(in *Pod, out *api.Pod, s conversion.Scope) er
}
func autoConvert_api_Pod_To_v1_Pod(in *api.Pod, out *Pod, s conversion.Scope) error {
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_api_PodSpec_To_v1_PodSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -3190,9 +3146,7 @@ func Convert_api_PodStatus_To_v1_PodStatus(in *api.PodStatus, out *PodStatus, s
}
func autoConvert_v1_PodStatusResult_To_api_PodStatusResult(in *PodStatusResult, out *api.PodStatusResult, s conversion.Scope) error {
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1_PodStatus_To_api_PodStatus(&in.Status, &out.Status, s); err != nil {
return err
}
@ -3200,9 +3154,7 @@ func autoConvert_v1_PodStatusResult_To_api_PodStatusResult(in *PodStatusResult,
}
func autoConvert_api_PodStatusResult_To_v1_PodStatusResult(in *api.PodStatusResult, out *PodStatusResult, s conversion.Scope) error {
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_api_PodStatus_To_v1_PodStatus(&in.Status, &out.Status, s); err != nil {
return err
}
@ -3210,9 +3162,7 @@ func autoConvert_api_PodStatusResult_To_v1_PodStatusResult(in *api.PodStatusResu
}
func autoConvert_v1_PodTemplate_To_api_PodTemplate(in *PodTemplate, out *api.PodTemplate, s conversion.Scope) error {
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err
}
@ -3224,9 +3174,7 @@ func Convert_v1_PodTemplate_To_api_PodTemplate(in *PodTemplate, out *api.PodTemp
}
func autoConvert_api_PodTemplate_To_v1_PodTemplate(in *api.PodTemplate, out *PodTemplate, s conversion.Scope) error {
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err
}
@ -3278,9 +3226,7 @@ func Convert_api_PodTemplateList_To_v1_PodTemplateList(in *api.PodTemplateList,
}
func autoConvert_v1_PodTemplateSpec_To_api_PodTemplateSpec(in *PodTemplateSpec, out *api.PodTemplateSpec, s conversion.Scope) error {
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1_PodSpec_To_api_PodSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -3288,9 +3234,7 @@ func autoConvert_v1_PodTemplateSpec_To_api_PodTemplateSpec(in *PodTemplateSpec,
}
func autoConvert_api_PodTemplateSpec_To_v1_PodTemplateSpec(in *api.PodTemplateSpec, out *PodTemplateSpec, s conversion.Scope) error {
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_api_PodSpec_To_v1_PodSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -3458,9 +3402,7 @@ func Convert_api_RBDVolumeSource_To_v1_RBDVolumeSource(in *api.RBDVolumeSource,
}
func autoConvert_v1_RangeAllocation_To_api_RangeAllocation(in *RangeAllocation, out *api.RangeAllocation, s conversion.Scope) error {
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
out.Range = in.Range
out.Data = *(*[]byte)(unsafe.Pointer(&in.Data))
return nil
@ -3471,9 +3413,7 @@ func Convert_v1_RangeAllocation_To_api_RangeAllocation(in *RangeAllocation, out
}
func autoConvert_api_RangeAllocation_To_v1_RangeAllocation(in *api.RangeAllocation, out *RangeAllocation, s conversion.Scope) error {
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
out.Range = in.Range
out.Data = *(*[]byte)(unsafe.Pointer(&in.Data))
return nil
@ -3484,9 +3424,7 @@ func Convert_api_RangeAllocation_To_v1_RangeAllocation(in *api.RangeAllocation,
}
func autoConvert_v1_ReplicationController_To_api_ReplicationController(in *ReplicationController, out *api.ReplicationController, s conversion.Scope) error {
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1_ReplicationControllerSpec_To_api_ReplicationControllerSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -3501,9 +3439,7 @@ func Convert_v1_ReplicationController_To_api_ReplicationController(in *Replicati
}
func autoConvert_api_ReplicationController_To_v1_ReplicationController(in *api.ReplicationController, out *ReplicationController, s conversion.Scope) error {
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_api_ReplicationControllerSpec_To_v1_ReplicationControllerSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -3670,9 +3606,7 @@ func Convert_api_ResourceFieldSelector_To_v1_ResourceFieldSelector(in *api.Resou
}
func autoConvert_v1_ResourceQuota_To_api_ResourceQuota(in *ResourceQuota, out *api.ResourceQuota, s conversion.Scope) error {
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1_ResourceQuotaSpec_To_api_ResourceQuotaSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -3687,9 +3621,7 @@ func Convert_v1_ResourceQuota_To_api_ResourceQuota(in *ResourceQuota, out *api.R
}
func autoConvert_api_ResourceQuota_To_v1_ResourceQuota(in *api.ResourceQuota, out *ResourceQuota, s conversion.Scope) error {
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_api_ResourceQuotaSpec_To_v1_ResourceQuotaSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -3808,9 +3740,7 @@ func Convert_api_SELinuxOptions_To_v1_SELinuxOptions(in *api.SELinuxOptions, out
}
func autoConvert_v1_Secret_To_api_Secret(in *Secret, out *api.Secret, s conversion.Scope) error {
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
out.Data = *(*map[string][]byte)(unsafe.Pointer(&in.Data))
// INFO: in.StringData opted out of conversion generation
out.Type = api.SecretType(in.Type)
@ -3818,9 +3748,7 @@ func autoConvert_v1_Secret_To_api_Secret(in *Secret, out *api.Secret, s conversi
}
func autoConvert_api_Secret_To_v1_Secret(in *api.Secret, out *Secret, s conversion.Scope) error {
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
out.Data = *(*map[string][]byte)(unsafe.Pointer(&in.Data))
out.Type = SecretType(in.Type)
return nil
@ -3967,9 +3895,7 @@ func Convert_api_SerializedReference_To_v1_SerializedReference(in *api.Serialize
}
func autoConvert_v1_Service_To_api_Service(in *Service, out *api.Service, s conversion.Scope) error {
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1_ServiceSpec_To_api_ServiceSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -3984,9 +3910,7 @@ func Convert_v1_Service_To_api_Service(in *Service, out *api.Service, s conversi
}
func autoConvert_api_Service_To_v1_Service(in *api.Service, out *Service, s conversion.Scope) error {
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_api_ServiceSpec_To_v1_ServiceSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -4001,9 +3925,7 @@ func Convert_api_Service_To_v1_Service(in *api.Service, out *Service, s conversi
}
func autoConvert_v1_ServiceAccount_To_api_ServiceAccount(in *ServiceAccount, out *api.ServiceAccount, s conversion.Scope) error {
if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
out.Secrets = *(*[]api.ObjectReference)(unsafe.Pointer(&in.Secrets))
out.ImagePullSecrets = *(*[]api.LocalObjectReference)(unsafe.Pointer(&in.ImagePullSecrets))
return nil
@ -4014,9 +3936,7 @@ func Convert_v1_ServiceAccount_To_api_ServiceAccount(in *ServiceAccount, out *ap
}
func autoConvert_api_ServiceAccount_To_v1_ServiceAccount(in *api.ServiceAccount, out *ServiceAccount, s conversion.Scope) error {
if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
out.Secrets = *(*[]ObjectReference)(unsafe.Pointer(&in.Secrets))
out.ImagePullSecrets = *(*[]LocalObjectReference)(unsafe.Pointer(&in.ImagePullSecrets))
return nil

View File

@ -301,8 +301,10 @@ func DeepCopy_v1_Binding(in interface{}, out interface{}, c *conversion.Cloner)
in := in.(*Binding)
out := out.(*Binding)
*out = *in
if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
return nil
}
@ -373,8 +375,10 @@ func DeepCopy_v1_ComponentStatus(in interface{}, out interface{}, c *conversion.
in := in.(*ComponentStatus)
out := out.(*ComponentStatus)
*out = *in
if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
@ -410,8 +414,10 @@ func DeepCopy_v1_ConfigMap(in interface{}, out interface{}, c *conversion.Cloner
in := in.(*ConfigMap)
out := out.(*ConfigMap)
*out = *in
if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
if in.Data != nil {
in, out := &in.Data, &out.Data
@ -821,8 +827,10 @@ func DeepCopy_v1_Endpoints(in interface{}, out interface{}, c *conversion.Cloner
in := in.(*Endpoints)
out := out.(*Endpoints)
*out = *in
if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
if in.Subsets != nil {
in, out := &in.Subsets, &out.Subsets
@ -921,8 +929,10 @@ func DeepCopy_v1_Event(in interface{}, out interface{}, c *conversion.Cloner) er
in := in.(*Event)
out := out.(*Event)
*out = *in
if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
out.FirstTimestamp = in.FirstTimestamp.DeepCopy()
out.LastTimestamp = in.LastTimestamp.DeepCopy()
@ -1160,8 +1170,10 @@ func DeepCopy_v1_LimitRange(in interface{}, out interface{}, c *conversion.Clone
in := in.(*LimitRange)
out := out.(*LimitRange)
*out = *in
if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
if err := DeepCopy_v1_LimitRangeSpec(&in.Spec, &out.Spec, c); err != nil {
return err
@ -1332,8 +1344,10 @@ func DeepCopy_v1_Namespace(in interface{}, out interface{}, c *conversion.Cloner
in := in.(*Namespace)
out := out.(*Namespace)
*out = *in
if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
if err := DeepCopy_v1_NamespaceSpec(&in.Spec, &out.Spec, c); err != nil {
return err
@ -1390,8 +1404,10 @@ func DeepCopy_v1_Node(in interface{}, out interface{}, c *conversion.Cloner) err
in := in.(*Node)
out := out.(*Node)
*out = *in
if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
if err := DeepCopy_v1_NodeStatus(&in.Status, &out.Status, c); err != nil {
return err
@ -1700,8 +1716,10 @@ func DeepCopy_v1_PersistentVolume(in interface{}, out interface{}, c *conversion
in := in.(*PersistentVolume)
out := out.(*PersistentVolume)
*out = *in
if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
if err := DeepCopy_v1_PersistentVolumeSpec(&in.Spec, &out.Spec, c); err != nil {
return err
@ -1715,8 +1733,10 @@ func DeepCopy_v1_PersistentVolumeClaim(in interface{}, out interface{}, c *conve
in := in.(*PersistentVolumeClaim)
out := out.(*PersistentVolumeClaim)
*out = *in
if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
if err := DeepCopy_v1_PersistentVolumeClaimSpec(&in.Spec, &out.Spec, c); err != nil {
return err
@ -1981,8 +2001,10 @@ func DeepCopy_v1_Pod(in interface{}, out interface{}, c *conversion.Cloner) erro
in := in.(*Pod)
out := out.(*Pod)
*out = *in
if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
if err := DeepCopy_v1_PodSpec(&in.Spec, &out.Spec, c); err != nil {
return err
@ -2331,8 +2353,10 @@ func DeepCopy_v1_PodStatusResult(in interface{}, out interface{}, c *conversion.
in := in.(*PodStatusResult)
out := out.(*PodStatusResult)
*out = *in
if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
if err := DeepCopy_v1_PodStatus(&in.Status, &out.Status, c); err != nil {
return err
@ -2346,8 +2370,10 @@ func DeepCopy_v1_PodTemplate(in interface{}, out interface{}, c *conversion.Clon
in := in.(*PodTemplate)
out := out.(*PodTemplate)
*out = *in
if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
if err := DeepCopy_v1_PodTemplateSpec(&in.Template, &out.Template, c); err != nil {
return err
@ -2379,8 +2405,10 @@ func DeepCopy_v1_PodTemplateSpec(in interface{}, out interface{}, c *conversion.
in := in.(*PodTemplateSpec)
out := out.(*PodTemplateSpec)
*out = *in
if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
if err := DeepCopy_v1_PodSpec(&in.Spec, &out.Spec, c); err != nil {
return err
@ -2473,8 +2501,10 @@ func DeepCopy_v1_RangeAllocation(in interface{}, out interface{}, c *conversion.
in := in.(*RangeAllocation)
out := out.(*RangeAllocation)
*out = *in
if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
if in.Data != nil {
in, out := &in.Data, &out.Data
@ -2490,8 +2520,10 @@ func DeepCopy_v1_ReplicationController(in interface{}, out interface{}, c *conve
in := in.(*ReplicationController)
out := out.(*ReplicationController)
*out = *in
if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
if err := DeepCopy_v1_ReplicationControllerSpec(&in.Spec, &out.Spec, c); err != nil {
return err
@ -2592,8 +2624,10 @@ func DeepCopy_v1_ResourceQuota(in interface{}, out interface{}, c *conversion.Cl
in := in.(*ResourceQuota)
out := out.(*ResourceQuota)
*out = *in
if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
if err := DeepCopy_v1_ResourceQuotaSpec(&in.Spec, &out.Spec, c); err != nil {
return err
@ -2706,8 +2740,10 @@ func DeepCopy_v1_Secret(in interface{}, out interface{}, c *conversion.Cloner) e
in := in.(*Secret)
out := out.(*Secret)
*out = *in
if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
if in.Data != nil {
in, out := &in.Data, &out.Data
@ -2836,8 +2872,10 @@ func DeepCopy_v1_Service(in interface{}, out interface{}, c *conversion.Cloner)
in := in.(*Service)
out := out.(*Service)
*out = *in
if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
if err := DeepCopy_v1_ServiceSpec(&in.Spec, &out.Spec, c); err != nil {
return err
@ -2854,8 +2892,10 @@ func DeepCopy_v1_ServiceAccount(in interface{}, out interface{}, c *conversion.C
in := in.(*ServiceAccount)
out := out.(*ServiceAccount)
*out = *in
if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*meta_v1.ObjectMeta)
}
if in.Secrets != nil {
in, out := &in.Secrets, &out.Secrets

View File

@ -19,8 +19,8 @@ package validation
import (
"testing"
"k8s.io/kubernetes/pkg/api"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api"
)
func TestValidateEvent(t *testing.T) {
@ -30,7 +30,7 @@ func TestValidateEvent(t *testing.T) {
}{
{
&api.Event{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test1",
Namespace: "foo",
},
@ -42,7 +42,7 @@ func TestValidateEvent(t *testing.T) {
false,
}, {
&api.Event{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test2",
Namespace: "aoeu-_-aoeu",
},
@ -54,7 +54,7 @@ func TestValidateEvent(t *testing.T) {
false,
}, {
&api.Event{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test3",
Namespace: api.NamespaceDefault,
},
@ -66,7 +66,7 @@ func TestValidateEvent(t *testing.T) {
true,
}, {
&api.Event{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test4",
Namespace: api.NamespaceDefault,
},
@ -78,7 +78,7 @@ func TestValidateEvent(t *testing.T) {
true,
}, {
&api.Event{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test5",
Namespace: api.NamespaceDefault,
},
@ -91,7 +91,7 @@ func TestValidateEvent(t *testing.T) {
true,
}, {
&api.Event{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test6",
Namespace: api.NamespaceDefault,
},
@ -104,7 +104,7 @@ func TestValidateEvent(t *testing.T) {
false,
}, {
&api.Event{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test7",
Namespace: api.NamespaceDefault,
},
@ -117,7 +117,7 @@ func TestValidateEvent(t *testing.T) {
true,
}, {
&api.Event{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test8",
Namespace: api.NamespaceDefault,
},
@ -130,7 +130,7 @@ func TestValidateEvent(t *testing.T) {
false,
}, {
&api.Event{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test9",
Namespace: "foo",
},
@ -143,7 +143,7 @@ func TestValidateEvent(t *testing.T) {
true,
}, {
&api.Event{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test10",
Namespace: api.NamespaceDefault,
},
@ -156,7 +156,7 @@ func TestValidateEvent(t *testing.T) {
false,
}, {
&api.Event{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test11",
Namespace: "foo",
},
@ -171,7 +171,7 @@ func TestValidateEvent(t *testing.T) {
},
{
&api.Event{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test12",
Namespace: "foo",
},
@ -185,7 +185,7 @@ func TestValidateEvent(t *testing.T) {
},
{
&api.Event{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test13",
Namespace: "",
},
@ -199,7 +199,7 @@ func TestValidateEvent(t *testing.T) {
},
{
&api.Event{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "test14",
Namespace: "foo",
},

View File

@ -34,7 +34,6 @@ go_test(
library = ":go_default_library",
tags = ["automanaged"],
deps = [
"//pkg/api:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/api/validation",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/util/validation/field",

View File

@ -142,7 +142,7 @@ func ValidateImmutableField(newVal, oldVal interface{}, fldPath *field.Path) fie
// ValidateObjectMeta validates an object's metadata on creation. It expects that name generation has already
// been performed.
// It doesn't return an error for rootscoped resources with namespace, because namespace should already be cleared before.
func ValidateObjectMeta(meta *api.ObjectMeta, requiresNamespace bool, nameFn apimachineyvalidation.ValidateNameFunc, fldPath *field.Path) field.ErrorList {
func ValidateObjectMeta(meta *metav1.ObjectMeta, requiresNamespace bool, nameFn apimachineyvalidation.ValidateNameFunc, fldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}
if len(meta.GenerateName) != 0 {
@ -189,7 +189,7 @@ func ValidateObjectMeta(meta *api.ObjectMeta, requiresNamespace bool, nameFn api
}
// ValidateObjectMetaUpdate validates an object's metadata when updated
func ValidateObjectMetaUpdate(newMeta, oldMeta *api.ObjectMeta, fldPath *field.Path) field.ErrorList {
func ValidateObjectMetaUpdate(newMeta, oldMeta *metav1.ObjectMeta, fldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}
if !RepairMalformedUpdates && newMeta.UID != oldMeta.UID {

View File

@ -62,8 +62,8 @@ var volumeModeErrorMsg string = "must be a number between 0 and 0777 (octal), bo
// BannedOwners is a black list of object that are not allowed to be owners.
var BannedOwners = genericvalidation.BannedOwners
// ValidateHasLabel requires that api.ObjectMeta has a Label with key and expectedValue
func ValidateHasLabel(meta api.ObjectMeta, fldPath *field.Path, key, expectedValue string) field.ErrorList {
// ValidateHasLabel requires that metav1.ObjectMeta has a Label with key and expectedValue
func ValidateHasLabel(meta metav1.ObjectMeta, fldPath *field.Path, key, expectedValue string) field.ErrorList {
allErrs := field.ErrorList{}
actualValue, found := meta.Labels[key]
if !found {
@ -289,12 +289,12 @@ func ValidateImmutableAnnotation(newVal string, oldVal string, annotation string
// been performed.
// It doesn't return an error for rootscoped resources with namespace, because namespace should already be cleared before.
// TODO: Remove calls to this method scattered in validations of specific resources, e.g., ValidatePodUpdate.
func ValidateObjectMeta(meta *api.ObjectMeta, requiresNamespace bool, nameFn ValidateNameFunc, fldPath *field.Path) field.ErrorList {
func ValidateObjectMeta(meta *metav1.ObjectMeta, requiresNamespace bool, nameFn ValidateNameFunc, fldPath *field.Path) field.ErrorList {
return genericvalidation.ValidateObjectMeta(meta, requiresNamespace, apimachineryvalidation.ValidateNameFunc(nameFn), fldPath)
}
// ValidateObjectMetaUpdate validates an object's metadata when updated
func ValidateObjectMetaUpdate(newMeta, oldMeta *api.ObjectMeta, fldPath *field.Path) field.ErrorList {
func ValidateObjectMetaUpdate(newMeta, oldMeta *metav1.ObjectMeta, fldPath *field.Path) field.ErrorList {
return genericvalidation.ValidateObjectMetaUpdate(newMeta, oldMeta, fldPath)
}

File diff suppressed because it is too large Load Diff

View File

@ -21,13 +21,14 @@ limitations under the License.
package api
import (
reflect "reflect"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
conversion "k8s.io/apimachinery/pkg/conversion"
labels "k8s.io/apimachinery/pkg/labels"
runtime "k8s.io/apimachinery/pkg/runtime"
types "k8s.io/apimachinery/pkg/types"
fields "k8s.io/kubernetes/pkg/fields"
reflect "reflect"
)
func init() {

View File

@ -49,34 +49,34 @@ func TestIsList(t *testing.T) {
func TestExtractList(t *testing.T) {
list1 := []runtime.Object{
&api.Pod{ObjectMeta: api.ObjectMeta{Name: "1"}},
&api.Service{ObjectMeta: api.ObjectMeta{Name: "2"}},
&api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "1"}},
&api.Service{ObjectMeta: metav1.ObjectMeta{Name: "2"}},
}
list2 := &v1.List{
Items: []runtime.RawExtension{
{Raw: []byte("foo")},
{Raw: []byte("bar")},
{Object: &v1.Pod{ObjectMeta: v1.ObjectMeta{Name: "other"}}},
{Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "other"}}},
},
}
list3 := &fakePtrValueList{
Items: []*api.Pod{
{ObjectMeta: api.ObjectMeta{Name: "1"}},
{ObjectMeta: api.ObjectMeta{Name: "2"}},
{ObjectMeta: metav1.ObjectMeta{Name: "1"}},
{ObjectMeta: metav1.ObjectMeta{Name: "2"}},
},
}
list4 := &api.PodList{
Items: []api.Pod{
{ObjectMeta: api.ObjectMeta{Name: "1"}},
{ObjectMeta: api.ObjectMeta{Name: "2"}},
{ObjectMeta: api.ObjectMeta{Name: "3"}},
{ObjectMeta: metav1.ObjectMeta{Name: "1"}},
{ObjectMeta: metav1.ObjectMeta{Name: "2"}},
{ObjectMeta: metav1.ObjectMeta{Name: "3"}},
},
}
list5 := &v1.PodList{
Items: []v1.Pod{
{ObjectMeta: v1.ObjectMeta{Name: "1"}},
{ObjectMeta: v1.ObjectMeta{Name: "2"}},
{ObjectMeta: v1.ObjectMeta{Name: "3"}},
{ObjectMeta: metav1.ObjectMeta{Name: "1"}},
{ObjectMeta: metav1.ObjectMeta{Name: "2"}},
{ObjectMeta: metav1.ObjectMeta{Name: "3"}},
},
}
@ -142,34 +142,34 @@ func TestExtractList(t *testing.T) {
func TestEachListItem(t *testing.T) {
list1 := []runtime.Object{
&api.Pod{ObjectMeta: api.ObjectMeta{Name: "1"}},
&api.Service{ObjectMeta: api.ObjectMeta{Name: "2"}},
&api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "1"}},
&api.Service{ObjectMeta: metav1.ObjectMeta{Name: "2"}},
}
list2 := &v1.List{
Items: []runtime.RawExtension{
{Raw: []byte("foo")},
{Raw: []byte("bar")},
{Object: &v1.Pod{ObjectMeta: v1.ObjectMeta{Name: "other"}}},
{Object: &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "other"}}},
},
}
list3 := &fakePtrValueList{
Items: []*api.Pod{
{ObjectMeta: api.ObjectMeta{Name: "1"}},
{ObjectMeta: api.ObjectMeta{Name: "2"}},
{ObjectMeta: metav1.ObjectMeta{Name: "1"}},
{ObjectMeta: metav1.ObjectMeta{Name: "2"}},
},
}
list4 := &api.PodList{
Items: []api.Pod{
{ObjectMeta: api.ObjectMeta{Name: "1"}},
{ObjectMeta: api.ObjectMeta{Name: "2"}},
{ObjectMeta: api.ObjectMeta{Name: "3"}},
{ObjectMeta: metav1.ObjectMeta{Name: "1"}},
{ObjectMeta: metav1.ObjectMeta{Name: "2"}},
{ObjectMeta: metav1.ObjectMeta{Name: "3"}},
},
}
list5 := &v1.PodList{
Items: []v1.Pod{
{ObjectMeta: v1.ObjectMeta{Name: "1"}},
{ObjectMeta: v1.ObjectMeta{Name: "2"}},
{ObjectMeta: v1.ObjectMeta{Name: "3"}},
{ObjectMeta: metav1.ObjectMeta{Name: "1"}},
{ObjectMeta: metav1.ObjectMeta{Name: "2"}},
{ObjectMeta: metav1.ObjectMeta{Name: "3"}},
},
}
@ -262,9 +262,9 @@ func (obj fakePtrValueList) GetObjectKind() schema.ObjectKind {
func TestSetList(t *testing.T) {
pl := &api.PodList{}
list := []runtime.Object{
&api.Pod{ObjectMeta: api.ObjectMeta{Name: "1"}},
&api.Pod{ObjectMeta: api.ObjectMeta{Name: "2"}},
&api.Pod{ObjectMeta: api.ObjectMeta{Name: "3"}},
&api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "1"}},
&api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "2"}},
&api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "3"}},
}
err := meta.SetList(pl, list)
if err != nil {
@ -283,9 +283,9 @@ func TestSetList(t *testing.T) {
func TestSetListToRuntimeObjectArray(t *testing.T) {
pl := &api.List{}
list := []runtime.Object{
&api.Pod{ObjectMeta: api.ObjectMeta{Name: "1"}},
&api.Pod{ObjectMeta: api.ObjectMeta{Name: "2"}},
&api.Pod{ObjectMeta: api.ObjectMeta{Name: "3"}},
&api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "1"}},
&api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "2"}},
&api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "3"}},
}
err := meta.SetList(pl, list)
if err != nil {

View File

@ -28,13 +28,12 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/v1"
)
func TestAPIObjectMeta(t *testing.T) {
j := &api.Pod{
TypeMeta: metav1.TypeMeta{APIVersion: "/a", Kind: "b"},
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Namespace: "bar",
Name: "foo",
GenerateName: "prefix",
@ -333,7 +332,7 @@ func TestTypeMetaSelfLinker(t *testing.T) {
type MyAPIObject2 struct {
metav1.TypeMeta
v1.ObjectMeta
metav1.ObjectMeta
}
func getObjectMetaAndOwnerRefereneces() (myAPIObject2 MyAPIObject2, metaOwnerReferences []metav1.OwnerReference) {
@ -396,7 +395,7 @@ func TestAccessOwnerReferences(t *testing.T) {
func BenchmarkAccessorSetFastPath(b *testing.B) {
obj := &api.Pod{
TypeMeta: metav1.TypeMeta{APIVersion: "/a", Kind: "b"},
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Namespace: "bar",
Name: "foo",
GenerateName: "prefix",

View File

@ -37,7 +37,7 @@ func TestDecodeUnstructured(t *testing.T) {
rawJson := fmt.Sprintf(`{"kind":"Pod","apiVersion":"%s","metadata":{"name":"test"}}`, groupVersionString)
pl := &api.List{
Items: []runtime.Object{
&api.Pod{ObjectMeta: api.ObjectMeta{Name: "1"}},
&api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "1"}},
&runtime.Unknown{
TypeMeta: runtime.TypeMeta{Kind: "Pod", APIVersion: groupVersionString},
Raw: []byte(rawJson),

View File

@ -19,6 +19,7 @@ package tests
import (
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi"
@ -27,7 +28,7 @@ import (
func TestDecodeList(t *testing.T) {
pl := &api.List{
Items: []runtime.Object{
&api.Pod{ObjectMeta: api.ObjectMeta{Name: "1"}},
&api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "1"}},
&runtime.Unknown{
TypeMeta: runtime.TypeMeta{Kind: "Pod", APIVersion: api.Registry.GroupOrDie(api.GroupName).GroupVersion.String()},
Raw: []byte(`{"kind":"Pod","apiVersion":"` + api.Registry.GroupOrDie(api.GroupName).GroupVersion.String() + `","metadata":{"name":"test"}}`),

View File

@ -24,6 +24,7 @@ import (
"strings"
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/serializer/protobuf"
@ -273,7 +274,7 @@ func TestProtobufDecode(t *testing.T) {
func TestDecodeObjects(t *testing.T) {
obj1 := &v1.Pod{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "cool",
},
Spec: v1.PodSpec{

View File

@ -343,7 +343,7 @@ func (this *StatefulSet) String() string {
return "nil"
}
s := strings.Join([]string{`&StatefulSet{`,
`ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_kubernetes_pkg_api_v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
`ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
`Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "StatefulSetSpec", "StatefulSetSpec", 1), `&`, ``, 1) + `,`,
`Status:` + strings.Replace(strings.Replace(this.Status.String(), "StatefulSetStatus", "StatefulSetStatus", 1), `&`, ``, 1) + `,`,
`}`,
@ -1034,45 +1034,45 @@ var (
var fileDescriptorGenerated = []byte{
// 645 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x53, 0x4d, 0x6f, 0xd3, 0x40,
0x10, 0x8d, 0x93, 0xa6, 0x84, 0x4d, 0xf9, 0x5a, 0x2a, 0x14, 0x55, 0xc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 0x0c, 0xd9, 0x58, 0x50, 0x26, 0x6f, 0x9d, 0x51, 0x09, 0x12, 0x29, 0x24, 0x42, 0x88, 0x7b,
0x53, 0x86, 0x7d, 0x5b, 0xd7, 0x5b, 0xde, 0x9b, 0x01, 0x76, 0x66, 0x96, 0xa3, 0xf7, 0x49, 0x5d,
0x42, 0x32, 0x10, 0x1e, 0xbc, 0xe4, 0x01, 0x34, 0xaa, 0x6b, 0x46, 0xeb, 0xb2, 0x7d, 0x53, 0x83,
0xea, 0x9d, 0xe9, 0x27, 0x27, 0x9f, 0xd7, 0xfc, 0x6a, 0x90, 0x1b, 0x85, 0x9b, 0xa5, 0x4f, 0x08,
0x8d, 0xdc, 0x2c, 0x0d, 0xba, 0x4f, 0x47, 0x7f, 0x74, 0x11, 0x85, 0x6a, 0x89, 0x15, 0xfb, 0xd6,
0xf0, 0x64, 0x95, 0xee, 0x16, 0xbe, 0x3a, 0x33, 0x14, 0x74, 0x3d, 0x77, 0x02, 0x65, 0x75, 0x02,
0x13, 0x2b, 0x8b, 0x67, 0x60, 0xdf, 0x3d, 0x3a, 0x35, 0x4b, 0xc7, 0xa7, 0x66, 0xe9, 0xd7, 0xa9,
0x59, 0xfa, 0x3c, 0x34, 0x8d, 0xa3, 0xa1, 0x69, 0x1c, 0x0f, 0x4d, 0xe3, 0xf7, 0xd0, 0x34, 0xbe,
0xfd, 0x31, 0x4b, 0xfb, 0x97, 0xf4, 0x45, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xe5, 0x5a, 0x18,
0x81, 0x34, 0x06, 0x00, 0x00,
}

View File

@ -39,7 +39,7 @@ option go_package = "v1beta1";
// map to the same storage identity.
message StatefulSet {
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the desired identities of pods in this set.
// +optional

View File

@ -26,9 +26,9 @@ import (
"fmt"
codec1978 "github.com/ugorji/go/codec"
pkg1_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
pkg3_types "k8s.io/apimachinery/pkg/types"
pkg2_types "k8s.io/apimachinery/pkg/types"
pkg4_resource "k8s.io/kubernetes/pkg/api/resource"
pkg2_v1 "k8s.io/kubernetes/pkg/api/v1"
pkg3_v1 "k8s.io/kubernetes/pkg/api/v1"
pkg5_intstr "k8s.io/kubernetes/pkg/util/intstr"
"reflect"
"runtime"
@ -66,9 +66,9 @@ func init() {
}
if false { // reference the types, but skip this branch at build/run time
var v0 pkg1_v1.TypeMeta
var v1 pkg3_types.UID
var v1 pkg2_types.UID
var v2 pkg4_resource.Quantity
var v3 pkg2_v1.ObjectMeta
var v3 pkg3_v1.PodTemplateSpec
var v4 pkg5_intstr.IntOrString
var v5 time.Time
_, _, _, _, _, _ = v0, v1, v2, v3, v4, v5
@ -164,7 +164,13 @@ func (x *StatefulSet) CodecEncodeSelf(e *codec1978.Encoder) {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq2[2] {
yy10 := &x.ObjectMeta
yy10.CodecEncodeSelf(e)
yym11 := z.EncBinary()
_ = yym11
if false {
} else if z.HasExtensions() && z.EncExt(yy10) {
} else {
z.EncFallback(yy10)
}
} else {
r.EncodeNil()
}
@ -174,7 +180,13 @@ func (x *StatefulSet) CodecEncodeSelf(e *codec1978.Encoder) {
r.EncodeString(codecSelferC_UTF81234, string("metadata"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
yy12 := &x.ObjectMeta
yy12.CodecEncodeSelf(e)
yym13 := z.EncBinary()
_ = yym13
if false {
} else if z.HasExtensions() && z.EncExt(yy12) {
} else {
z.EncFallback(yy12)
}
}
}
if yyr2 || yy2arr2 {
@ -298,24 +310,30 @@ func (x *StatefulSet) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
}
case "metadata":
if r.TryDecodeAsNil() {
x.ObjectMeta = pkg2_v1.ObjectMeta{}
x.ObjectMeta = pkg1_v1.ObjectMeta{}
} else {
yyv8 := &x.ObjectMeta
yyv8.CodecDecodeSelf(d)
yym9 := z.DecBinary()
_ = yym9
if false {
} else if z.HasExtensions() && z.DecExt(yyv8) {
} else {
z.DecFallback(yyv8, false)
}
}
case "spec":
if r.TryDecodeAsNil() {
x.Spec = StatefulSetSpec{}
} else {
yyv9 := &x.Spec
yyv9.CodecDecodeSelf(d)
yyv10 := &x.Spec
yyv10.CodecDecodeSelf(d)
}
case "status":
if r.TryDecodeAsNil() {
x.Status = StatefulSetStatus{}
} else {
yyv10 := &x.Status
yyv10.CodecDecodeSelf(d)
yyv11 := &x.Status
yyv11.CodecDecodeSelf(d)
}
default:
z.DecStructFieldNotFound(-1, yys3)
@ -328,16 +346,16 @@ func (x *StatefulSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
var yyj11 int
var yyb11 bool
var yyhl11 bool = l >= 0
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
var yyj12 int
var yyb12 bool
var yyhl12 bool = l >= 0
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -345,21 +363,21 @@ func (x *StatefulSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Kind = ""
} else {
yyv12 := &x.Kind
yym13 := z.DecBinary()
_ = yym13
yyv13 := &x.Kind
yym14 := z.DecBinary()
_ = yym14
if false {
} else {
*((*string)(yyv12)) = r.DecodeString()
*((*string)(yyv13)) = r.DecodeString()
}
}
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -367,38 +385,44 @@ func (x *StatefulSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.APIVersion = ""
} else {
yyv14 := &x.APIVersion
yym15 := z.DecBinary()
_ = yym15
yyv15 := &x.APIVersion
yym16 := z.DecBinary()
_ = yym16
if false {
} else {
*((*string)(yyv14)) = r.DecodeString()
*((*string)(yyv15)) = r.DecodeString()
}
}
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.ObjectMeta = pkg2_v1.ObjectMeta{}
x.ObjectMeta = pkg1_v1.ObjectMeta{}
} else {
yyv16 := &x.ObjectMeta
yyv16.CodecDecodeSelf(d)
}
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
yyv17 := &x.ObjectMeta
yym18 := z.DecBinary()
_ = yym18
if false {
} else if z.HasExtensions() && z.DecExt(yyv17) {
} else {
yyb11 = r.CheckBreak()
z.DecFallback(yyv17, false)
}
if yyb11 {
}
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb12 = r.CheckBreak()
}
if yyb12 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -406,16 +430,16 @@ func (x *StatefulSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Spec = StatefulSetSpec{}
} else {
yyv17 := &x.Spec
yyv17.CodecDecodeSelf(d)
yyv19 := &x.Spec
yyv19.CodecDecodeSelf(d)
}
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -423,21 +447,21 @@ func (x *StatefulSet) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Status = StatefulSetStatus{}
} else {
yyv18 := &x.Status
yyv18.CodecDecodeSelf(d)
yyv20 := &x.Status
yyv20.CodecDecodeSelf(d)
}
for {
yyj11++
if yyhl11 {
yyb11 = yyj11 > l
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
} else {
yyb11 = r.CheckBreak()
yyb12 = r.CheckBreak()
}
if yyb11 {
if yyb12 {
break
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj11-1, "")
z.DecStructFieldNotFound(yyj12-1, "")
}
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}
@ -566,7 +590,7 @@ func (x *StatefulSetSpec) CodecEncodeSelf(e *codec1978.Encoder) {
_ = yym17
if false {
} else {
h.encSlicev1_PersistentVolumeClaim(([]pkg2_v1.PersistentVolumeClaim)(x.VolumeClaimTemplates), e)
h.encSlicev1_PersistentVolumeClaim(([]pkg3_v1.PersistentVolumeClaim)(x.VolumeClaimTemplates), e)
}
}
} else {
@ -584,7 +608,7 @@ func (x *StatefulSetSpec) CodecEncodeSelf(e *codec1978.Encoder) {
_ = yym18
if false {
} else {
h.encSlicev1_PersistentVolumeClaim(([]pkg2_v1.PersistentVolumeClaim)(x.VolumeClaimTemplates), e)
h.encSlicev1_PersistentVolumeClaim(([]pkg3_v1.PersistentVolumeClaim)(x.VolumeClaimTemplates), e)
}
}
}
@ -704,7 +728,7 @@ func (x *StatefulSetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
}
case "template":
if r.TryDecodeAsNil() {
x.Template = pkg2_v1.PodTemplateSpec{}
x.Template = pkg3_v1.PodTemplateSpec{}
} else {
yyv8 := &x.Template
yyv8.CodecDecodeSelf(d)
@ -718,7 +742,7 @@ func (x *StatefulSetSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
_ = yym10
if false {
} else {
h.decSlicev1_PersistentVolumeClaim((*[]pkg2_v1.PersistentVolumeClaim)(yyv9), d)
h.decSlicev1_PersistentVolumeClaim((*[]pkg3_v1.PersistentVolumeClaim)(yyv9), d)
}
}
case "serviceName":
@ -812,7 +836,7 @@ func (x *StatefulSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder)
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.Template = pkg2_v1.PodTemplateSpec{}
x.Template = pkg3_v1.PodTemplateSpec{}
} else {
yyv18 := &x.Template
yyv18.CodecDecodeSelf(d)
@ -836,7 +860,7 @@ func (x *StatefulSetSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder)
_ = yym20
if false {
} else {
h.decSlicev1_PersistentVolumeClaim((*[]pkg2_v1.PersistentVolumeClaim)(yyv19), d)
h.decSlicev1_PersistentVolumeClaim((*[]pkg3_v1.PersistentVolumeClaim)(yyv19), d)
}
}
yyj13++
@ -1497,7 +1521,7 @@ func (x *StatefulSetList) codecDecodeSelfFromArray(l int, d *codec1978.Decoder)
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}
func (x codecSelfer1234) encSlicev1_PersistentVolumeClaim(v []pkg2_v1.PersistentVolumeClaim, e *codec1978.Encoder) {
func (x codecSelfer1234) encSlicev1_PersistentVolumeClaim(v []pkg3_v1.PersistentVolumeClaim, e *codec1978.Encoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperEncoder(e)
_, _, _ = h, z, r
@ -1510,7 +1534,7 @@ func (x codecSelfer1234) encSlicev1_PersistentVolumeClaim(v []pkg2_v1.Persistent
z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
}
func (x codecSelfer1234) decSlicev1_PersistentVolumeClaim(v *[]pkg2_v1.PersistentVolumeClaim, d *codec1978.Decoder) {
func (x codecSelfer1234) decSlicev1_PersistentVolumeClaim(v *[]pkg3_v1.PersistentVolumeClaim, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
@ -1521,7 +1545,7 @@ func (x codecSelfer1234) decSlicev1_PersistentVolumeClaim(v *[]pkg2_v1.Persisten
_ = yyc1
if yyl1 == 0 {
if yyv1 == nil {
yyv1 = []pkg2_v1.PersistentVolumeClaim{}
yyv1 = []pkg3_v1.PersistentVolumeClaim{}
yyc1 = true
} else if len(yyv1) != 0 {
yyv1 = yyv1[:0]
@ -1541,10 +1565,10 @@ func (x codecSelfer1234) decSlicev1_PersistentVolumeClaim(v *[]pkg2_v1.Persisten
if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1]
} else {
yyv1 = make([]pkg2_v1.PersistentVolumeClaim, yyrl1)
yyv1 = make([]pkg3_v1.PersistentVolumeClaim, yyrl1)
}
} else {
yyv1 = make([]pkg2_v1.PersistentVolumeClaim, yyrl1)
yyv1 = make([]pkg3_v1.PersistentVolumeClaim, yyrl1)
}
yyc1 = true
yyrr1 = len(yyv1)
@ -1559,7 +1583,7 @@ func (x codecSelfer1234) decSlicev1_PersistentVolumeClaim(v *[]pkg2_v1.Persisten
for ; yyj1 < yyrr1; yyj1++ {
yyh1.ElemContainerState(yyj1)
if r.TryDecodeAsNil() {
yyv1[yyj1] = pkg2_v1.PersistentVolumeClaim{}
yyv1[yyj1] = pkg3_v1.PersistentVolumeClaim{}
} else {
yyv2 := &yyv1[yyj1]
yyv2.CodecDecodeSelf(d)
@ -1568,10 +1592,10 @@ func (x codecSelfer1234) decSlicev1_PersistentVolumeClaim(v *[]pkg2_v1.Persisten
}
if yyrt1 {
for ; yyj1 < yyl1; yyj1++ {
yyv1 = append(yyv1, pkg2_v1.PersistentVolumeClaim{})
yyv1 = append(yyv1, pkg3_v1.PersistentVolumeClaim{})
yyh1.ElemContainerState(yyj1)
if r.TryDecodeAsNil() {
yyv1[yyj1] = pkg2_v1.PersistentVolumeClaim{}
yyv1[yyj1] = pkg3_v1.PersistentVolumeClaim{}
} else {
yyv3 := &yyv1[yyj1]
yyv3.CodecDecodeSelf(d)
@ -1585,13 +1609,13 @@ func (x codecSelfer1234) decSlicev1_PersistentVolumeClaim(v *[]pkg2_v1.Persisten
for ; !r.CheckBreak(); yyj1++ {
if yyj1 >= len(yyv1) {
yyv1 = append(yyv1, pkg2_v1.PersistentVolumeClaim{}) // var yyz1 pkg2_v1.PersistentVolumeClaim
yyv1 = append(yyv1, pkg3_v1.PersistentVolumeClaim{}) // var yyz1 pkg3_v1.PersistentVolumeClaim
yyc1 = true
}
yyh1.ElemContainerState(yyj1)
if yyj1 < len(yyv1) {
if r.TryDecodeAsNil() {
yyv1[yyj1] = pkg2_v1.PersistentVolumeClaim{}
yyv1[yyj1] = pkg3_v1.PersistentVolumeClaim{}
} else {
yyv4 := &yyv1[yyj1]
yyv4.CodecDecodeSelf(d)
@ -1606,7 +1630,7 @@ func (x codecSelfer1234) decSlicev1_PersistentVolumeClaim(v *[]pkg2_v1.Persisten
yyv1 = yyv1[:yyj1]
yyc1 = true
} else if yyj1 == 0 && yyv1 == nil {
yyv1 = []pkg2_v1.PersistentVolumeClaim{}
yyv1 = []pkg3_v1.PersistentVolumeClaim{}
yyc1 = true
}
}

View File

@ -50,10 +50,7 @@ func RegisterConversions(scheme *runtime.Scheme) error {
}
func autoConvert_v1beta1_StatefulSet_To_apps_StatefulSet(in *StatefulSet, out *apps.StatefulSet, s conversion.Scope) error {
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1beta1_StatefulSetSpec_To_apps_StatefulSetSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
@ -68,10 +65,7 @@ func Convert_v1beta1_StatefulSet_To_apps_StatefulSet(in *StatefulSet, out *apps.
}
func autoConvert_apps_StatefulSet_To_v1beta1_StatefulSet(in *apps.StatefulSet, out *StatefulSet, s conversion.Scope) error {
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
if err := Convert_apps_StatefulSetSpec_To_v1beta1_StatefulSetSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}

View File

@ -21,10 +21,10 @@ limitations under the License.
package v1beta1
import (
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
v1 "k8s.io/kubernetes/pkg/api/v1"
api_v1 "k8s.io/kubernetes/pkg/api/v1"
reflect "reflect"
)
@ -48,8 +48,10 @@ func DeepCopy_v1beta1_StatefulSet(in interface{}, out interface{}, c *conversion
in := in.(*StatefulSet)
out := out.(*StatefulSet)
*out = *in
if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*v1.ObjectMeta)
}
if err := DeepCopy_v1beta1_StatefulSetSpec(&in.Spec, &out.Spec, c); err != nil {
return err
@ -94,17 +96,17 @@ func DeepCopy_v1beta1_StatefulSetSpec(in interface{}, out interface{}, c *conver
if newVal, err := c.DeepCopy(*in); err != nil {
return err
} else {
*out = newVal.(*meta_v1.LabelSelector)
*out = newVal.(*v1.LabelSelector)
}
}
if err := v1.DeepCopy_v1_PodTemplateSpec(&in.Template, &out.Template, c); err != nil {
if err := api_v1.DeepCopy_v1_PodTemplateSpec(&in.Template, &out.Template, c); err != nil {
return err
}
if in.VolumeClaimTemplates != nil {
in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates
*out = make([]v1.PersistentVolumeClaim, len(*in))
*out = make([]api_v1.PersistentVolumeClaim, len(*in))
for i := range *in {
if err := v1.DeepCopy_v1_PersistentVolumeClaim(&(*in)[i], &(*out)[i], c); err != nil {
if err := api_v1.DeepCopy_v1_PersistentVolumeClaim(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}

View File

@ -29,7 +29,7 @@ func TestValidateStatefulSet(t *testing.T) {
validLabels := map[string]string{"a": "b"}
validPodTemplate := api.PodTemplate{
Template: api.PodTemplateSpec{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: validLabels,
},
Spec: api.PodSpec{
@ -46,21 +46,21 @@ func TestValidateStatefulSet(t *testing.T) {
RestartPolicy: api.RestartPolicyAlways,
DNSPolicy: api.DNSClusterFirst,
},
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: invalidLabels,
},
},
}
successCases := []apps.StatefulSet{
{
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
Template: validPodTemplate.Template,
},
},
{
ObjectMeta: api.ObjectMeta{Name: "abc-123", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc-123", Namespace: api.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
Template: validPodTemplate.Template,
@ -75,47 +75,47 @@ func TestValidateStatefulSet(t *testing.T) {
errorCases := map[string]apps.StatefulSet{
"zero-length ID": {
ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "", Namespace: api.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
Template: validPodTemplate.Template,
},
},
"missing-namespace": {
ObjectMeta: api.ObjectMeta{Name: "abc-123"},
ObjectMeta: metav1.ObjectMeta{Name: "abc-123"},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
Template: validPodTemplate.Template,
},
},
"empty selector": {
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Template: validPodTemplate.Template,
},
},
"selector_doesnt_match": {
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}},
Template: validPodTemplate.Template,
},
},
"invalid manifest": {
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
},
},
"negative_replicas": {
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Replicas: -1,
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
},
},
"invalid_label": {
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "abc-123",
Namespace: api.NamespaceDefault,
Labels: map[string]string{
@ -128,7 +128,7 @@ func TestValidateStatefulSet(t *testing.T) {
},
},
"invalid_label 2": {
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "abc-123",
Namespace: api.NamespaceDefault,
Labels: map[string]string{
@ -140,7 +140,7 @@ func TestValidateStatefulSet(t *testing.T) {
},
},
"invalid_annotation": {
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "abc-123",
Namespace: api.NamespaceDefault,
Annotations: map[string]string{
@ -153,7 +153,7 @@ func TestValidateStatefulSet(t *testing.T) {
},
},
"invalid restart policy 1": {
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "abc-123",
Namespace: api.NamespaceDefault,
},
@ -165,14 +165,14 @@ func TestValidateStatefulSet(t *testing.T) {
DNSPolicy: api.DNSClusterFirst,
Containers: []api.Container{{Name: "ctr", Image: "image", ImagePullPolicy: "IfNotPresent"}},
},
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: validLabels,
},
},
},
},
"invalid restart policy 2": {
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: "abc-123",
Namespace: api.NamespaceDefault,
},
@ -184,7 +184,7 @@ func TestValidateStatefulSet(t *testing.T) {
DNSPolicy: api.DNSClusterFirst,
Containers: []api.Container{{Name: "ctr", Image: "image", ImagePullPolicy: "IfNotPresent"}},
},
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: validLabels,
},
},
@ -219,7 +219,7 @@ func TestValidateStatefulSetUpdate(t *testing.T) {
validLabels := map[string]string{"a": "b"}
validPodTemplate := api.PodTemplate{
Template: api.PodTemplateSpec{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: validLabels,
},
Spec: api.PodSpec{
@ -231,7 +231,7 @@ func TestValidateStatefulSetUpdate(t *testing.T) {
}
readWriteVolumePodTemplate := api.PodTemplate{
Template: api.PodTemplateSpec{
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: validLabels,
},
Spec: api.PodSpec{
@ -249,7 +249,7 @@ func TestValidateStatefulSetUpdate(t *testing.T) {
RestartPolicy: api.RestartPolicyAlways,
DNSPolicy: api.DNSClusterFirst,
},
ObjectMeta: api.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Labels: invalidLabels,
},
},
@ -261,14 +261,14 @@ func TestValidateStatefulSetUpdate(t *testing.T) {
successCases := []psUpdateTest{
{
old: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
Template: validPodTemplate.Template,
},
},
update: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Replicas: 3,
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
@ -287,14 +287,14 @@ func TestValidateStatefulSetUpdate(t *testing.T) {
errorCases := map[string]psUpdateTest{
"more than one read/write": {
old: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "", Namespace: api.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
Template: validPodTemplate.Template,
},
},
update: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Replicas: 2,
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
@ -304,14 +304,14 @@ func TestValidateStatefulSetUpdate(t *testing.T) {
},
"updates to a field other than spec.Replicas": {
old: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
Template: validPodTemplate.Template,
},
},
update: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Replicas: 1,
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
@ -321,14 +321,14 @@ func TestValidateStatefulSetUpdate(t *testing.T) {
},
"invalid selector": {
old: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "", Namespace: api.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
Template: validPodTemplate.Template,
},
},
update: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Replicas: 2,
Selector: &metav1.LabelSelector{MatchLabels: invalidLabels},
@ -338,14 +338,14 @@ func TestValidateStatefulSetUpdate(t *testing.T) {
},
"invalid pod": {
old: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "", Namespace: api.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
Template: validPodTemplate.Template,
},
},
update: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Replicas: 2,
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
@ -355,14 +355,14 @@ func TestValidateStatefulSetUpdate(t *testing.T) {
},
"negative replicas": {
old: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: validLabels},
Template: validPodTemplate.Template,
},
},
update: apps.StatefulSet{
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
ObjectMeta: metav1.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
Spec: apps.StatefulSetSpec{
Replicas: -1,
Selector: &metav1.LabelSelector{MatchLabels: validLabels},

Some files were not shown because too many files have changed in this diff Show More