mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 02:09:56 +00:00
Merge pull request #28186 from nikhiljindal/betaAPI
Automatic merge from submit-queue federation: Upgrading the groupversion to v1beta1 This PR contains 2 commits: * Removing fields from Cluster API object that we are not using. This includes: Capacity, Allocatable and ClusterMeta. * Move code and rename groupversion `federation/v1alpha1` to `federation/v1beta1` cc @kubernetes/sig-cluster-federation
This commit is contained in:
commit
044de6ef90
@ -57,7 +57,7 @@ func main() {
|
|||||||
"k8s.io/kubernetes/pkg/apis/rbac",
|
"k8s.io/kubernetes/pkg/apis/rbac",
|
||||||
"k8s.io/kubernetes/pkg/apis/rbac/v1alpha1",
|
"k8s.io/kubernetes/pkg/apis/rbac/v1alpha1",
|
||||||
"k8s.io/kubernetes/federation/apis/federation",
|
"k8s.io/kubernetes/federation/apis/federation",
|
||||||
"k8s.io/kubernetes/federation/apis/federation/v1alpha1",
|
"k8s.io/kubernetes/federation/apis/federation/v1beta1",
|
||||||
"k8s.io/kubernetes/pkg/conversion",
|
"k8s.io/kubernetes/pkg/conversion",
|
||||||
"k8s.io/kubernetes/pkg/runtime",
|
"k8s.io/kubernetes/pkg/runtime",
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ func main() {
|
|||||||
"k8s.io/kubernetes/pkg/apis/rbac",
|
"k8s.io/kubernetes/pkg/apis/rbac",
|
||||||
"k8s.io/kubernetes/pkg/apis/rbac/v1alpha1",
|
"k8s.io/kubernetes/pkg/apis/rbac/v1alpha1",
|
||||||
"k8s.io/kubernetes/federation/apis/federation",
|
"k8s.io/kubernetes/federation/apis/federation",
|
||||||
"k8s.io/kubernetes/federation/apis/federation/v1alpha1",
|
"k8s.io/kubernetes/federation/apis/federation/v1beta1",
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := arguments.Execute(
|
if err := arguments.Execute(
|
||||||
|
@ -73,7 +73,7 @@ func New() *Generator {
|
|||||||
`k8s.io/kubernetes/pkg/apis/batch/v2alpha1`,
|
`k8s.io/kubernetes/pkg/apis/batch/v2alpha1`,
|
||||||
`k8s.io/kubernetes/pkg/apis/apps/v1alpha1`,
|
`k8s.io/kubernetes/pkg/apis/apps/v1alpha1`,
|
||||||
`k8s.io/kubernetes/pkg/apis/rbac/v1alpha1`,
|
`k8s.io/kubernetes/pkg/apis/rbac/v1alpha1`,
|
||||||
`k8s.io/kubernetes/federation/apis/federation/v1alpha1`,
|
`k8s.io/kubernetes/federation/apis/federation/v1beta1`,
|
||||||
`k8s.io/kubernetes/pkg/apis/certificates/v1alpha1`,
|
`k8s.io/kubernetes/pkg/apis/certificates/v1alpha1`,
|
||||||
}, ","),
|
}, ","),
|
||||||
DropEmbeddedFields: "k8s.io/kubernetes/pkg/api/unversioned.TypeMeta",
|
DropEmbeddedFields: "k8s.io/kubernetes/pkg/api/unversioned.TypeMeta",
|
||||||
|
@ -22,7 +22,6 @@ package federation
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
api "k8s.io/kubernetes/pkg/api"
|
api "k8s.io/kubernetes/pkg/api"
|
||||||
resource "k8s.io/kubernetes/pkg/api/resource"
|
|
||||||
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
||||||
conversion "k8s.io/kubernetes/pkg/conversion"
|
conversion "k8s.io/kubernetes/pkg/conversion"
|
||||||
)
|
)
|
||||||
@ -32,7 +31,6 @@ func init() {
|
|||||||
DeepCopy_federation_Cluster,
|
DeepCopy_federation_Cluster,
|
||||||
DeepCopy_federation_ClusterCondition,
|
DeepCopy_federation_ClusterCondition,
|
||||||
DeepCopy_federation_ClusterList,
|
DeepCopy_federation_ClusterList,
|
||||||
DeepCopy_federation_ClusterMeta,
|
|
||||||
DeepCopy_federation_ClusterSpec,
|
DeepCopy_federation_ClusterSpec,
|
||||||
DeepCopy_federation_ClusterStatus,
|
DeepCopy_federation_ClusterStatus,
|
||||||
DeepCopy_federation_ServerAddressByClientCIDR,
|
DeepCopy_federation_ServerAddressByClientCIDR,
|
||||||
@ -93,11 +91,6 @@ func DeepCopy_federation_ClusterList(in ClusterList, out *ClusterList, c *conver
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func DeepCopy_federation_ClusterMeta(in ClusterMeta, out *ClusterMeta, c *conversion.Cloner) error {
|
|
||||||
out.Version = in.Version
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func DeepCopy_federation_ClusterSpec(in ClusterSpec, out *ClusterSpec, c *conversion.Cloner) error {
|
func DeepCopy_federation_ClusterSpec(in ClusterSpec, out *ClusterSpec, c *conversion.Cloner) error {
|
||||||
if in.ServerAddressByClientCIDRs != nil {
|
if in.ServerAddressByClientCIDRs != nil {
|
||||||
in, out := in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
|
in, out := in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
|
||||||
@ -134,35 +127,6 @@ func DeepCopy_federation_ClusterStatus(in ClusterStatus, out *ClusterStatus, c *
|
|||||||
} else {
|
} else {
|
||||||
out.Conditions = nil
|
out.Conditions = nil
|
||||||
}
|
}
|
||||||
if in.Capacity != nil {
|
|
||||||
in, out := in.Capacity, &out.Capacity
|
|
||||||
*out = make(api.ResourceList)
|
|
||||||
for key, val := range in {
|
|
||||||
newVal := new(resource.Quantity)
|
|
||||||
if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
(*out)[key] = *newVal
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
out.Capacity = nil
|
|
||||||
}
|
|
||||||
if in.Allocatable != nil {
|
|
||||||
in, out := in.Allocatable, &out.Allocatable
|
|
||||||
*out = make(api.ResourceList)
|
|
||||||
for key, val := range in {
|
|
||||||
newVal := new(resource.Quantity)
|
|
||||||
if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
(*out)[key] = *newVal
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
out.Allocatable = nil
|
|
||||||
}
|
|
||||||
if err := DeepCopy_federation_ClusterMeta(in.ClusterMeta, &out.ClusterMeta, c); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if in.Zones != nil {
|
if in.Zones != nil {
|
||||||
in, out := in.Zones, &out.Zones
|
in, out := in.Zones, &out.Zones
|
||||||
*out = make([]string, len(in))
|
*out = make([]string, len(in))
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
|
|
||||||
"k8s.io/kubernetes/federation/apis/federation"
|
"k8s.io/kubernetes/federation/apis/federation"
|
||||||
"k8s.io/kubernetes/federation/apis/federation/v1alpha1"
|
"k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/meta"
|
"k8s.io/kubernetes/pkg/api/meta"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||||
@ -37,7 +37,7 @@ const importPrefix = "k8s.io/kubernetes/federation/apis/federation"
|
|||||||
var accessor = meta.NewAccessor()
|
var accessor = meta.NewAccessor()
|
||||||
|
|
||||||
// availableVersions lists all known external versions for this group from most preferred to least preferred
|
// availableVersions lists all known external versions for this group from most preferred to least preferred
|
||||||
var availableVersions = []unversioned.GroupVersion{v1alpha1.SchemeGroupVersion}
|
var availableVersions = []unversioned.GroupVersion{v1beta1.SchemeGroupVersion}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
registered.RegisterVersions(availableVersions)
|
registered.RegisterVersions(availableVersions)
|
||||||
@ -101,7 +101,7 @@ func newRESTMapper(externalVersions []unversioned.GroupVersion) meta.RESTMapper
|
|||||||
// string, or an error if the version is not known.
|
// string, or an error if the version is not known.
|
||||||
func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, error) {
|
func interfacesFor(version unversioned.GroupVersion) (*meta.VersionInterfaces, error) {
|
||||||
switch version {
|
switch version {
|
||||||
case v1alpha1.SchemeGroupVersion:
|
case v1beta1.SchemeGroupVersion:
|
||||||
return &meta.VersionInterfaces{
|
return &meta.VersionInterfaces{
|
||||||
ObjectConvertor: api.Scheme,
|
ObjectConvertor: api.Scheme,
|
||||||
MetadataAccessor: accessor,
|
MetadataAccessor: accessor,
|
||||||
@ -122,8 +122,8 @@ func addVersionsToScheme(externalVersions ...unversioned.GroupVersion) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
switch v {
|
switch v {
|
||||||
case v1alpha1.SchemeGroupVersion:
|
case v1beta1.SchemeGroupVersion:
|
||||||
v1alpha1.AddToScheme(api.Scheme)
|
v1beta1.AddToScheme(api.Scheme)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"k8s.io/kubernetes/federation/apis/federation"
|
"k8s.io/kubernetes/federation/apis/federation"
|
||||||
"k8s.io/kubernetes/federation/apis/federation/v1alpha1"
|
"k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||||
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||||
@ -77,7 +77,7 @@ func TestInterfacesFor(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestRESTMapper(t *testing.T) {
|
func TestRESTMapper(t *testing.T) {
|
||||||
gv := v1alpha1.SchemeGroupVersion
|
gv := v1beta1.SchemeGroupVersion
|
||||||
clusterGVK := gv.WithKind("Cluster")
|
clusterGVK := gv.WithKind("Cluster")
|
||||||
|
|
||||||
if gvk, err := registered.GroupOrDie(federation.GroupName).RESTMapper.KindFor(gv.WithResource("clusters")); err != nil || gvk != clusterGVK {
|
if gvk, err := registered.GroupOrDie(federation.GroupName).RESTMapper.KindFor(gv.WithResource("clusters")); err != nil || gvk != clusterGVK {
|
||||||
|
@ -26,9 +26,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
codec1978 "github.com/ugorji/go/codec"
|
codec1978 "github.com/ugorji/go/codec"
|
||||||
pkg1_api "k8s.io/kubernetes/pkg/api"
|
pkg1_api "k8s.io/kubernetes/pkg/api"
|
||||||
pkg3_resource "k8s.io/kubernetes/pkg/api/resource"
|
|
||||||
pkg2_unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
pkg2_unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
||||||
pkg4_types "k8s.io/kubernetes/pkg/types"
|
pkg3_types "k8s.io/kubernetes/pkg/types"
|
||||||
"reflect"
|
"reflect"
|
||||||
"runtime"
|
"runtime"
|
||||||
time "time"
|
time "time"
|
||||||
@ -65,11 +64,10 @@ func init() {
|
|||||||
}
|
}
|
||||||
if false { // reference the types, but skip this branch at build/run time
|
if false { // reference the types, but skip this branch at build/run time
|
||||||
var v0 pkg1_api.LocalObjectReference
|
var v0 pkg1_api.LocalObjectReference
|
||||||
var v1 pkg3_resource.Quantity
|
var v1 pkg2_unversioned.Time
|
||||||
var v2 pkg2_unversioned.Time
|
var v2 pkg3_types.UID
|
||||||
var v3 pkg4_types.UID
|
var v3 time.Time
|
||||||
var v4 time.Time
|
_, _, _, _ = v0, v1, v2, v3
|
||||||
_, _, _, _, _ = v0, v1, v2, v3, v4
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -985,175 +983,6 @@ func (x *ClusterCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder)
|
|||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ClusterMeta) CodecEncodeSelf(e *codec1978.Encoder) {
|
|
||||||
var h codecSelfer1234
|
|
||||||
z, r := codec1978.GenHelperEncoder(e)
|
|
||||||
_, _, _ = h, z, r
|
|
||||||
if x == nil {
|
|
||||||
r.EncodeNil()
|
|
||||||
} else {
|
|
||||||
yym1 := z.EncBinary()
|
|
||||||
_ = yym1
|
|
||||||
if false {
|
|
||||||
} else if z.HasExtensions() && z.EncExt(x) {
|
|
||||||
} else {
|
|
||||||
yysep2 := !z.EncBinary()
|
|
||||||
yy2arr2 := z.EncBasicHandle().StructToArray
|
|
||||||
var yyq2 [1]bool
|
|
||||||
_, _, _ = yysep2, yyq2, yy2arr2
|
|
||||||
const yyr2 bool = false
|
|
||||||
yyq2[0] = x.Version != ""
|
|
||||||
var yynn2 int
|
|
||||||
if yyr2 || yy2arr2 {
|
|
||||||
r.EncodeArrayStart(1)
|
|
||||||
} else {
|
|
||||||
yynn2 = 0
|
|
||||||
for _, b := range yyq2 {
|
|
||||||
if b {
|
|
||||||
yynn2++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
r.EncodeMapStart(yynn2)
|
|
||||||
yynn2 = 0
|
|
||||||
}
|
|
||||||
if yyr2 || yy2arr2 {
|
|
||||||
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
|
||||||
if yyq2[0] {
|
|
||||||
yym4 := z.EncBinary()
|
|
||||||
_ = yym4
|
|
||||||
if false {
|
|
||||||
} else {
|
|
||||||
r.EncodeString(codecSelferC_UTF81234, string(x.Version))
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
r.EncodeString(codecSelferC_UTF81234, "")
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if yyq2[0] {
|
|
||||||
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
|
||||||
r.EncodeString(codecSelferC_UTF81234, string("version"))
|
|
||||||
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
|
||||||
yym5 := z.EncBinary()
|
|
||||||
_ = yym5
|
|
||||||
if false {
|
|
||||||
} else {
|
|
||||||
r.EncodeString(codecSelferC_UTF81234, string(x.Version))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if yyr2 || yy2arr2 {
|
|
||||||
z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
|
|
||||||
} else {
|
|
||||||
z.EncSendContainerState(codecSelfer_containerMapEnd1234)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ClusterMeta) CodecDecodeSelf(d *codec1978.Decoder) {
|
|
||||||
var h codecSelfer1234
|
|
||||||
z, r := codec1978.GenHelperDecoder(d)
|
|
||||||
_, _, _ = h, z, r
|
|
||||||
yym1 := z.DecBinary()
|
|
||||||
_ = yym1
|
|
||||||
if false {
|
|
||||||
} else if z.HasExtensions() && z.DecExt(x) {
|
|
||||||
} else {
|
|
||||||
yyct2 := r.ContainerType()
|
|
||||||
if yyct2 == codecSelferValueTypeMap1234 {
|
|
||||||
yyl2 := r.ReadMapStart()
|
|
||||||
if yyl2 == 0 {
|
|
||||||
z.DecSendContainerState(codecSelfer_containerMapEnd1234)
|
|
||||||
} else {
|
|
||||||
x.codecDecodeSelfFromMap(yyl2, d)
|
|
||||||
}
|
|
||||||
} else if yyct2 == codecSelferValueTypeArray1234 {
|
|
||||||
yyl2 := r.ReadArrayStart()
|
|
||||||
if yyl2 == 0 {
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
|
||||||
} else {
|
|
||||||
x.codecDecodeSelfFromArray(yyl2, d)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ClusterMeta) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
|
|
||||||
var h codecSelfer1234
|
|
||||||
z, r := codec1978.GenHelperDecoder(d)
|
|
||||||
_, _, _ = h, z, r
|
|
||||||
var yys3Slc = z.DecScratchBuffer() // default slice to decode into
|
|
||||||
_ = yys3Slc
|
|
||||||
var yyhl3 bool = l >= 0
|
|
||||||
for yyj3 := 0; ; yyj3++ {
|
|
||||||
if yyhl3 {
|
|
||||||
if yyj3 >= l {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if r.CheckBreak() {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
z.DecSendContainerState(codecSelfer_containerMapKey1234)
|
|
||||||
yys3Slc = r.DecodeBytes(yys3Slc, true, true)
|
|
||||||
yys3 := string(yys3Slc)
|
|
||||||
z.DecSendContainerState(codecSelfer_containerMapValue1234)
|
|
||||||
switch yys3 {
|
|
||||||
case "version":
|
|
||||||
if r.TryDecodeAsNil() {
|
|
||||||
x.Version = ""
|
|
||||||
} else {
|
|
||||||
x.Version = string(r.DecodeString())
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
z.DecStructFieldNotFound(-1, yys3)
|
|
||||||
} // end switch yys3
|
|
||||||
} // end for yyj3
|
|
||||||
z.DecSendContainerState(codecSelfer_containerMapEnd1234)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ClusterMeta) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|
||||||
var h codecSelfer1234
|
|
||||||
z, r := codec1978.GenHelperDecoder(d)
|
|
||||||
_, _, _ = h, z, r
|
|
||||||
var yyj5 int
|
|
||||||
var yyb5 bool
|
|
||||||
var yyhl5 bool = l >= 0
|
|
||||||
yyj5++
|
|
||||||
if yyhl5 {
|
|
||||||
yyb5 = yyj5 > l
|
|
||||||
} else {
|
|
||||||
yyb5 = r.CheckBreak()
|
|
||||||
}
|
|
||||||
if yyb5 {
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
|
||||||
if r.TryDecodeAsNil() {
|
|
||||||
x.Version = ""
|
|
||||||
} else {
|
|
||||||
x.Version = string(r.DecodeString())
|
|
||||||
}
|
|
||||||
for {
|
|
||||||
yyj5++
|
|
||||||
if yyhl5 {
|
|
||||||
yyb5 = yyj5 > l
|
|
||||||
} else {
|
|
||||||
yyb5 = r.CheckBreak()
|
|
||||||
}
|
|
||||||
if yyb5 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
|
||||||
z.DecStructFieldNotFound(yyj5-1, "")
|
|
||||||
}
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) {
|
func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) {
|
||||||
var h codecSelfer1234
|
var h codecSelfer1234
|
||||||
z, r := codec1978.GenHelperEncoder(e)
|
z, r := codec1978.GenHelperEncoder(e)
|
||||||
@ -1168,18 +997,15 @@ func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) {
|
|||||||
} else {
|
} else {
|
||||||
yysep2 := !z.EncBinary()
|
yysep2 := !z.EncBinary()
|
||||||
yy2arr2 := z.EncBasicHandle().StructToArray
|
yy2arr2 := z.EncBasicHandle().StructToArray
|
||||||
var yyq2 [6]bool
|
var yyq2 [3]bool
|
||||||
_, _, _ = yysep2, yyq2, yy2arr2
|
_, _, _ = yysep2, yyq2, yy2arr2
|
||||||
const yyr2 bool = false
|
const yyr2 bool = false
|
||||||
yyq2[0] = len(x.Conditions) != 0
|
yyq2[0] = len(x.Conditions) != 0
|
||||||
yyq2[1] = len(x.Capacity) != 0
|
yyq2[1] = len(x.Zones) != 0
|
||||||
yyq2[2] = len(x.Allocatable) != 0
|
yyq2[2] = x.Region != ""
|
||||||
yyq2[3] = len(x.Zones) != 0
|
|
||||||
yyq2[4] = x.Region != ""
|
|
||||||
yyq2[5] = x.Version != ""
|
|
||||||
var yynn2 int
|
var yynn2 int
|
||||||
if yyr2 || yy2arr2 {
|
if yyr2 || yy2arr2 {
|
||||||
r.EncodeArrayStart(6)
|
r.EncodeArrayStart(3)
|
||||||
} else {
|
} else {
|
||||||
yynn2 = 0
|
yynn2 = 0
|
||||||
for _, b := range yyq2 {
|
for _, b := range yyq2 {
|
||||||
@ -1226,79 +1052,29 @@ func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) {
|
|||||||
if yyr2 || yy2arr2 {
|
if yyr2 || yy2arr2 {
|
||||||
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
||||||
if yyq2[1] {
|
if yyq2[1] {
|
||||||
if x.Capacity == nil {
|
if x.Zones == nil {
|
||||||
r.EncodeNil()
|
r.EncodeNil()
|
||||||
} else {
|
} else {
|
||||||
yysf7 := &x.Capacity
|
yym7 := z.EncBinary()
|
||||||
yysf7.CodecEncodeSelf(e)
|
_ = yym7
|
||||||
|
if false {
|
||||||
|
} else {
|
||||||
|
z.F.EncSliceStringV(x.Zones, false, e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
r.EncodeNil()
|
r.EncodeNil()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if yyq2[1] {
|
if yyq2[1] {
|
||||||
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
|
||||||
r.EncodeString(codecSelferC_UTF81234, string("capacity"))
|
|
||||||
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
|
||||||
if x.Capacity == nil {
|
|
||||||
r.EncodeNil()
|
|
||||||
} else {
|
|
||||||
yysf8 := &x.Capacity
|
|
||||||
yysf8.CodecEncodeSelf(e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if yyr2 || yy2arr2 {
|
|
||||||
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
|
||||||
if yyq2[2] {
|
|
||||||
if x.Allocatable == nil {
|
|
||||||
r.EncodeNil()
|
|
||||||
} else {
|
|
||||||
yysf10 := &x.Allocatable
|
|
||||||
yysf10.CodecEncodeSelf(e)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
r.EncodeNil()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if yyq2[2] {
|
|
||||||
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
|
||||||
r.EncodeString(codecSelferC_UTF81234, string("allocatable"))
|
|
||||||
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
|
||||||
if x.Allocatable == nil {
|
|
||||||
r.EncodeNil()
|
|
||||||
} else {
|
|
||||||
yysf11 := &x.Allocatable
|
|
||||||
yysf11.CodecEncodeSelf(e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if yyr2 || yy2arr2 {
|
|
||||||
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
|
||||||
if yyq2[3] {
|
|
||||||
if x.Zones == nil {
|
|
||||||
r.EncodeNil()
|
|
||||||
} else {
|
|
||||||
yym13 := z.EncBinary()
|
|
||||||
_ = yym13
|
|
||||||
if false {
|
|
||||||
} else {
|
|
||||||
z.F.EncSliceStringV(x.Zones, false, e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
r.EncodeNil()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if yyq2[3] {
|
|
||||||
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
||||||
r.EncodeString(codecSelferC_UTF81234, string("zones"))
|
r.EncodeString(codecSelferC_UTF81234, string("zones"))
|
||||||
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
||||||
if x.Zones == nil {
|
if x.Zones == nil {
|
||||||
r.EncodeNil()
|
r.EncodeNil()
|
||||||
} else {
|
} else {
|
||||||
yym14 := z.EncBinary()
|
yym8 := z.EncBinary()
|
||||||
_ = yym14
|
_ = yym8
|
||||||
if false {
|
if false {
|
||||||
} else {
|
} else {
|
||||||
z.F.EncSliceStringV(x.Zones, false, e)
|
z.F.EncSliceStringV(x.Zones, false, e)
|
||||||
@ -1308,9 +1084,9 @@ func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) {
|
|||||||
}
|
}
|
||||||
if yyr2 || yy2arr2 {
|
if yyr2 || yy2arr2 {
|
||||||
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
||||||
if yyq2[4] {
|
if yyq2[2] {
|
||||||
yym16 := z.EncBinary()
|
yym10 := z.EncBinary()
|
||||||
_ = yym16
|
_ = yym10
|
||||||
if false {
|
if false {
|
||||||
} else {
|
} else {
|
||||||
r.EncodeString(codecSelferC_UTF81234, string(x.Region))
|
r.EncodeString(codecSelferC_UTF81234, string(x.Region))
|
||||||
@ -1319,43 +1095,18 @@ func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) {
|
|||||||
r.EncodeString(codecSelferC_UTF81234, "")
|
r.EncodeString(codecSelferC_UTF81234, "")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if yyq2[4] {
|
if yyq2[2] {
|
||||||
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
||||||
r.EncodeString(codecSelferC_UTF81234, string("region"))
|
r.EncodeString(codecSelferC_UTF81234, string("region"))
|
||||||
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
||||||
yym17 := z.EncBinary()
|
yym11 := z.EncBinary()
|
||||||
_ = yym17
|
_ = yym11
|
||||||
if false {
|
if false {
|
||||||
} else {
|
} else {
|
||||||
r.EncodeString(codecSelferC_UTF81234, string(x.Region))
|
r.EncodeString(codecSelferC_UTF81234, string(x.Region))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if yyr2 || yy2arr2 {
|
|
||||||
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
|
||||||
if yyq2[5] {
|
|
||||||
yym19 := z.EncBinary()
|
|
||||||
_ = yym19
|
|
||||||
if false {
|
|
||||||
} else {
|
|
||||||
r.EncodeString(codecSelferC_UTF81234, string(x.Version))
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
r.EncodeString(codecSelferC_UTF81234, "")
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if yyq2[5] {
|
|
||||||
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
|
||||||
r.EncodeString(codecSelferC_UTF81234, string("version"))
|
|
||||||
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
|
||||||
yym20 := z.EncBinary()
|
|
||||||
_ = yym20
|
|
||||||
if false {
|
|
||||||
} else {
|
|
||||||
r.EncodeString(codecSelferC_UTF81234, string(x.Version))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if yyr2 || yy2arr2 {
|
if yyr2 || yy2arr2 {
|
||||||
z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
} else {
|
} else {
|
||||||
@ -1429,30 +1180,16 @@ func (x *ClusterStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
|
|||||||
h.decSliceClusterCondition((*[]ClusterCondition)(yyv4), d)
|
h.decSliceClusterCondition((*[]ClusterCondition)(yyv4), d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "capacity":
|
|
||||||
if r.TryDecodeAsNil() {
|
|
||||||
x.Capacity = nil
|
|
||||||
} else {
|
|
||||||
yyv6 := &x.Capacity
|
|
||||||
yyv6.CodecDecodeSelf(d)
|
|
||||||
}
|
|
||||||
case "allocatable":
|
|
||||||
if r.TryDecodeAsNil() {
|
|
||||||
x.Allocatable = nil
|
|
||||||
} else {
|
|
||||||
yyv7 := &x.Allocatable
|
|
||||||
yyv7.CodecDecodeSelf(d)
|
|
||||||
}
|
|
||||||
case "zones":
|
case "zones":
|
||||||
if r.TryDecodeAsNil() {
|
if r.TryDecodeAsNil() {
|
||||||
x.Zones = nil
|
x.Zones = nil
|
||||||
} else {
|
} else {
|
||||||
yyv8 := &x.Zones
|
yyv6 := &x.Zones
|
||||||
yym9 := z.DecBinary()
|
yym7 := z.DecBinary()
|
||||||
_ = yym9
|
_ = yym7
|
||||||
if false {
|
if false {
|
||||||
} else {
|
} else {
|
||||||
z.F.DecSliceStringX(yyv8, false, d)
|
z.F.DecSliceStringX(yyv6, false, d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "region":
|
case "region":
|
||||||
@ -1461,12 +1198,6 @@ func (x *ClusterStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
|
|||||||
} else {
|
} else {
|
||||||
x.Region = string(r.DecodeString())
|
x.Region = string(r.DecodeString())
|
||||||
}
|
}
|
||||||
case "version":
|
|
||||||
if r.TryDecodeAsNil() {
|
|
||||||
x.Version = ""
|
|
||||||
} else {
|
|
||||||
x.Version = string(r.DecodeString())
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
z.DecStructFieldNotFound(-1, yys3)
|
z.DecStructFieldNotFound(-1, yys3)
|
||||||
} // end switch yys3
|
} // end switch yys3
|
||||||
@ -1478,16 +1209,16 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|||||||
var h codecSelfer1234
|
var h codecSelfer1234
|
||||||
z, r := codec1978.GenHelperDecoder(d)
|
z, r := codec1978.GenHelperDecoder(d)
|
||||||
_, _, _ = h, z, r
|
_, _, _ = h, z, r
|
||||||
var yyj12 int
|
var yyj9 int
|
||||||
var yyb12 bool
|
var yyb9 bool
|
||||||
var yyhl12 bool = l >= 0
|
var yyhl9 bool = l >= 0
|
||||||
yyj12++
|
yyj9++
|
||||||
if yyhl12 {
|
if yyhl9 {
|
||||||
yyb12 = yyj12 > l
|
yyb9 = yyj9 > l
|
||||||
} else {
|
} else {
|
||||||
yyb12 = r.CheckBreak()
|
yyb9 = r.CheckBreak()
|
||||||
}
|
}
|
||||||
if yyb12 {
|
if yyb9 {
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1495,55 +1226,21 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|||||||
if r.TryDecodeAsNil() {
|
if r.TryDecodeAsNil() {
|
||||||
x.Conditions = nil
|
x.Conditions = nil
|
||||||
} else {
|
} else {
|
||||||
yyv13 := &x.Conditions
|
yyv10 := &x.Conditions
|
||||||
yym14 := z.DecBinary()
|
yym11 := z.DecBinary()
|
||||||
_ = yym14
|
_ = yym11
|
||||||
if false {
|
if false {
|
||||||
} else {
|
} else {
|
||||||
h.decSliceClusterCondition((*[]ClusterCondition)(yyv13), d)
|
h.decSliceClusterCondition((*[]ClusterCondition)(yyv10), d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
yyj12++
|
yyj9++
|
||||||
if yyhl12 {
|
if yyhl9 {
|
||||||
yyb12 = yyj12 > l
|
yyb9 = yyj9 > l
|
||||||
} else {
|
} else {
|
||||||
yyb12 = r.CheckBreak()
|
yyb9 = r.CheckBreak()
|
||||||
}
|
}
|
||||||
if yyb12 {
|
if yyb9 {
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
|
||||||
if r.TryDecodeAsNil() {
|
|
||||||
x.Capacity = nil
|
|
||||||
} else {
|
|
||||||
yyv15 := &x.Capacity
|
|
||||||
yyv15.CodecDecodeSelf(d)
|
|
||||||
}
|
|
||||||
yyj12++
|
|
||||||
if yyhl12 {
|
|
||||||
yyb12 = yyj12 > l
|
|
||||||
} else {
|
|
||||||
yyb12 = r.CheckBreak()
|
|
||||||
}
|
|
||||||
if yyb12 {
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
|
||||||
if r.TryDecodeAsNil() {
|
|
||||||
x.Allocatable = nil
|
|
||||||
} else {
|
|
||||||
yyv16 := &x.Allocatable
|
|
||||||
yyv16.CodecDecodeSelf(d)
|
|
||||||
}
|
|
||||||
yyj12++
|
|
||||||
if yyhl12 {
|
|
||||||
yyb12 = yyj12 > l
|
|
||||||
} else {
|
|
||||||
yyb12 = r.CheckBreak()
|
|
||||||
}
|
|
||||||
if yyb12 {
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1551,21 +1248,21 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|||||||
if r.TryDecodeAsNil() {
|
if r.TryDecodeAsNil() {
|
||||||
x.Zones = nil
|
x.Zones = nil
|
||||||
} else {
|
} else {
|
||||||
yyv17 := &x.Zones
|
yyv12 := &x.Zones
|
||||||
yym18 := z.DecBinary()
|
yym13 := z.DecBinary()
|
||||||
_ = yym18
|
_ = yym13
|
||||||
if false {
|
if false {
|
||||||
} else {
|
} else {
|
||||||
z.F.DecSliceStringX(yyv17, false, d)
|
z.F.DecSliceStringX(yyv12, false, d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
yyj12++
|
yyj9++
|
||||||
if yyhl12 {
|
if yyhl9 {
|
||||||
yyb12 = yyj12 > l
|
yyb9 = yyj9 > l
|
||||||
} else {
|
} else {
|
||||||
yyb12 = r.CheckBreak()
|
yyb9 = r.CheckBreak()
|
||||||
}
|
}
|
||||||
if yyb12 {
|
if yyb9 {
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1575,34 +1272,18 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|||||||
} else {
|
} else {
|
||||||
x.Region = string(r.DecodeString())
|
x.Region = string(r.DecodeString())
|
||||||
}
|
}
|
||||||
yyj12++
|
|
||||||
if yyhl12 {
|
|
||||||
yyb12 = yyj12 > l
|
|
||||||
} else {
|
|
||||||
yyb12 = r.CheckBreak()
|
|
||||||
}
|
|
||||||
if yyb12 {
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
|
||||||
if r.TryDecodeAsNil() {
|
|
||||||
x.Version = ""
|
|
||||||
} else {
|
|
||||||
x.Version = string(r.DecodeString())
|
|
||||||
}
|
|
||||||
for {
|
for {
|
||||||
yyj12++
|
yyj9++
|
||||||
if yyhl12 {
|
if yyhl9 {
|
||||||
yyb12 = yyj12 > l
|
yyb9 = yyj9 > l
|
||||||
} else {
|
} else {
|
||||||
yyb12 = r.CheckBreak()
|
yyb9 = r.CheckBreak()
|
||||||
}
|
}
|
||||||
if yyb12 {
|
if yyb9 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
||||||
z.DecStructFieldNotFound(yyj12-1, "")
|
z.DecStructFieldNotFound(yyj9-1, "")
|
||||||
}
|
}
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
}
|
}
|
||||||
@ -2571,7 +2252,7 @@ func (x codecSelfer1234) decSliceCluster(v *[]Cluster, d *codec1978.Decoder) {
|
|||||||
|
|
||||||
yyrg1 := len(yyv1) > 0
|
yyrg1 := len(yyv1) > 0
|
||||||
yyv21 := yyv1
|
yyv21 := yyv1
|
||||||
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 368)
|
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 336)
|
||||||
if yyrt1 {
|
if yyrt1 {
|
||||||
if yyrl1 <= cap(yyv1) {
|
if yyrl1 <= cap(yyv1) {
|
||||||
yyv1 = yyv1[:yyrl1]
|
yyv1 = yyv1[:yyrl1]
|
||||||
|
@ -71,21 +71,10 @@ type ClusterCondition struct {
|
|||||||
Message string `json:"message,omitempty"`
|
Message string `json:"message,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cluster metadata
|
|
||||||
type ClusterMeta struct {
|
|
||||||
// Release version of the cluster.
|
|
||||||
Version string `json:"version,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally.
|
// ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally.
|
||||||
type ClusterStatus struct {
|
type ClusterStatus struct {
|
||||||
// Conditions is an array of current cluster conditions.
|
// Conditions is an array of current cluster conditions.
|
||||||
Conditions []ClusterCondition `json:"conditions,omitempty"`
|
Conditions []ClusterCondition `json:"conditions,omitempty"`
|
||||||
// Capacity represents the total resources of the cluster
|
|
||||||
Capacity api.ResourceList `json:"capacity,omitempty"`
|
|
||||||
// Allocatable represents the total resources of a cluster that are available for scheduling.
|
|
||||||
Allocatable api.ResourceList `json:"allocatable,omitempty"`
|
|
||||||
ClusterMeta `json:",inline"`
|
|
||||||
// Zones is the list of avaliability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'.
|
// Zones is the list of avaliability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'.
|
||||||
// These will always be in the same region.
|
// These will always be in the same region.
|
||||||
Zones []string `json:"zones,omitempty"`
|
Zones []string `json:"zones,omitempty"`
|
||||||
|
@ -1,355 +0,0 @@
|
|||||||
// +build !ignore_autogenerated
|
|
||||||
|
|
||||||
/*
|
|
||||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// This file was autogenerated by conversion-gen. Do not edit it manually!
|
|
||||||
|
|
||||||
package v1alpha1
|
|
||||||
|
|
||||||
import (
|
|
||||||
federation "k8s.io/kubernetes/federation/apis/federation"
|
|
||||||
api "k8s.io/kubernetes/pkg/api"
|
|
||||||
resource "k8s.io/kubernetes/pkg/api/resource"
|
|
||||||
v1 "k8s.io/kubernetes/pkg/api/v1"
|
|
||||||
conversion "k8s.io/kubernetes/pkg/conversion"
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
if err := api.Scheme.AddGeneratedConversionFuncs(
|
|
||||||
Convert_v1alpha1_Cluster_To_federation_Cluster,
|
|
||||||
Convert_federation_Cluster_To_v1alpha1_Cluster,
|
|
||||||
Convert_v1alpha1_ClusterCondition_To_federation_ClusterCondition,
|
|
||||||
Convert_federation_ClusterCondition_To_v1alpha1_ClusterCondition,
|
|
||||||
Convert_v1alpha1_ClusterList_To_federation_ClusterList,
|
|
||||||
Convert_federation_ClusterList_To_v1alpha1_ClusterList,
|
|
||||||
Convert_v1alpha1_ClusterMeta_To_federation_ClusterMeta,
|
|
||||||
Convert_federation_ClusterMeta_To_v1alpha1_ClusterMeta,
|
|
||||||
Convert_v1alpha1_ClusterSpec_To_federation_ClusterSpec,
|
|
||||||
Convert_federation_ClusterSpec_To_v1alpha1_ClusterSpec,
|
|
||||||
Convert_v1alpha1_ClusterStatus_To_federation_ClusterStatus,
|
|
||||||
Convert_federation_ClusterStatus_To_v1alpha1_ClusterStatus,
|
|
||||||
Convert_v1alpha1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR,
|
|
||||||
Convert_federation_ServerAddressByClientCIDR_To_v1alpha1_ServerAddressByClientCIDR,
|
|
||||||
); err != nil {
|
|
||||||
// if one of the conversion functions is malformed, detect it immediately.
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func autoConvert_v1alpha1_Cluster_To_federation_Cluster(in *Cluster, out *federation.Cluster, s conversion.Scope) error {
|
|
||||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
// TODO: Inefficient conversion - can we improve it?
|
|
||||||
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := Convert_v1alpha1_ClusterSpec_To_federation_ClusterSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := Convert_v1alpha1_ClusterStatus_To_federation_ClusterStatus(&in.Status, &out.Status, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Convert_v1alpha1_Cluster_To_federation_Cluster(in *Cluster, out *federation.Cluster, s conversion.Scope) error {
|
|
||||||
return autoConvert_v1alpha1_Cluster_To_federation_Cluster(in, out, s)
|
|
||||||
}
|
|
||||||
|
|
||||||
func autoConvert_federation_Cluster_To_v1alpha1_Cluster(in *federation.Cluster, out *Cluster, s conversion.Scope) error {
|
|
||||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
// TODO: Inefficient conversion - can we improve it?
|
|
||||||
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := Convert_federation_ClusterSpec_To_v1alpha1_ClusterSpec(&in.Spec, &out.Spec, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := Convert_federation_ClusterStatus_To_v1alpha1_ClusterStatus(&in.Status, &out.Status, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Convert_federation_Cluster_To_v1alpha1_Cluster(in *federation.Cluster, out *Cluster, s conversion.Scope) error {
|
|
||||||
return autoConvert_federation_Cluster_To_v1alpha1_Cluster(in, out, s)
|
|
||||||
}
|
|
||||||
|
|
||||||
func autoConvert_v1alpha1_ClusterCondition_To_federation_ClusterCondition(in *ClusterCondition, out *federation.ClusterCondition, s conversion.Scope) error {
|
|
||||||
out.Type = federation.ClusterConditionType(in.Type)
|
|
||||||
out.Status = api.ConditionStatus(in.Status)
|
|
||||||
if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
out.Reason = in.Reason
|
|
||||||
out.Message = in.Message
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Convert_v1alpha1_ClusterCondition_To_federation_ClusterCondition(in *ClusterCondition, out *federation.ClusterCondition, s conversion.Scope) error {
|
|
||||||
return autoConvert_v1alpha1_ClusterCondition_To_federation_ClusterCondition(in, out, s)
|
|
||||||
}
|
|
||||||
|
|
||||||
func autoConvert_federation_ClusterCondition_To_v1alpha1_ClusterCondition(in *federation.ClusterCondition, out *ClusterCondition, s conversion.Scope) error {
|
|
||||||
out.Type = ClusterConditionType(in.Type)
|
|
||||||
out.Status = v1.ConditionStatus(in.Status)
|
|
||||||
if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
out.Reason = in.Reason
|
|
||||||
out.Message = in.Message
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Convert_federation_ClusterCondition_To_v1alpha1_ClusterCondition(in *federation.ClusterCondition, out *ClusterCondition, s conversion.Scope) error {
|
|
||||||
return autoConvert_federation_ClusterCondition_To_v1alpha1_ClusterCondition(in, out, s)
|
|
||||||
}
|
|
||||||
|
|
||||||
func autoConvert_v1alpha1_ClusterList_To_federation_ClusterList(in *ClusterList, out *federation.ClusterList, s conversion.Scope) error {
|
|
||||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if in.Items != nil {
|
|
||||||
in, out := &in.Items, &out.Items
|
|
||||||
*out = make([]federation.Cluster, len(*in))
|
|
||||||
for i := range *in {
|
|
||||||
if err := Convert_v1alpha1_Cluster_To_federation_Cluster(&(*in)[i], &(*out)[i], s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
out.Items = nil
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Convert_v1alpha1_ClusterList_To_federation_ClusterList(in *ClusterList, out *federation.ClusterList, s conversion.Scope) error {
|
|
||||||
return autoConvert_v1alpha1_ClusterList_To_federation_ClusterList(in, out, s)
|
|
||||||
}
|
|
||||||
|
|
||||||
func autoConvert_federation_ClusterList_To_v1alpha1_ClusterList(in *federation.ClusterList, out *ClusterList, s conversion.Scope) error {
|
|
||||||
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if in.Items != nil {
|
|
||||||
in, out := &in.Items, &out.Items
|
|
||||||
*out = make([]Cluster, len(*in))
|
|
||||||
for i := range *in {
|
|
||||||
if err := Convert_federation_Cluster_To_v1alpha1_Cluster(&(*in)[i], &(*out)[i], s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
out.Items = nil
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Convert_federation_ClusterList_To_v1alpha1_ClusterList(in *federation.ClusterList, out *ClusterList, s conversion.Scope) error {
|
|
||||||
return autoConvert_federation_ClusterList_To_v1alpha1_ClusterList(in, out, s)
|
|
||||||
}
|
|
||||||
|
|
||||||
func autoConvert_v1alpha1_ClusterMeta_To_federation_ClusterMeta(in *ClusterMeta, out *federation.ClusterMeta, s conversion.Scope) error {
|
|
||||||
out.Version = in.Version
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Convert_v1alpha1_ClusterMeta_To_federation_ClusterMeta(in *ClusterMeta, out *federation.ClusterMeta, s conversion.Scope) error {
|
|
||||||
return autoConvert_v1alpha1_ClusterMeta_To_federation_ClusterMeta(in, out, s)
|
|
||||||
}
|
|
||||||
|
|
||||||
func autoConvert_federation_ClusterMeta_To_v1alpha1_ClusterMeta(in *federation.ClusterMeta, out *ClusterMeta, s conversion.Scope) error {
|
|
||||||
out.Version = in.Version
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Convert_federation_ClusterMeta_To_v1alpha1_ClusterMeta(in *federation.ClusterMeta, out *ClusterMeta, s conversion.Scope) error {
|
|
||||||
return autoConvert_federation_ClusterMeta_To_v1alpha1_ClusterMeta(in, out, s)
|
|
||||||
}
|
|
||||||
|
|
||||||
func autoConvert_v1alpha1_ClusterSpec_To_federation_ClusterSpec(in *ClusterSpec, out *federation.ClusterSpec, s conversion.Scope) error {
|
|
||||||
if in.ServerAddressByClientCIDRs != nil {
|
|
||||||
in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
|
|
||||||
*out = make([]federation.ServerAddressByClientCIDR, len(*in))
|
|
||||||
for i := range *in {
|
|
||||||
if err := Convert_v1alpha1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(&(*in)[i], &(*out)[i], s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
out.ServerAddressByClientCIDRs = nil
|
|
||||||
}
|
|
||||||
if in.SecretRef != nil {
|
|
||||||
in, out := &in.SecretRef, &out.SecretRef
|
|
||||||
*out = new(api.LocalObjectReference)
|
|
||||||
// TODO: Inefficient conversion - can we improve it?
|
|
||||||
if err := s.Convert(*in, *out, 0); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
out.SecretRef = nil
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Convert_v1alpha1_ClusterSpec_To_federation_ClusterSpec(in *ClusterSpec, out *federation.ClusterSpec, s conversion.Scope) error {
|
|
||||||
return autoConvert_v1alpha1_ClusterSpec_To_federation_ClusterSpec(in, out, s)
|
|
||||||
}
|
|
||||||
|
|
||||||
func autoConvert_federation_ClusterSpec_To_v1alpha1_ClusterSpec(in *federation.ClusterSpec, out *ClusterSpec, s conversion.Scope) error {
|
|
||||||
if in.ServerAddressByClientCIDRs != nil {
|
|
||||||
in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
|
|
||||||
*out = make([]ServerAddressByClientCIDR, len(*in))
|
|
||||||
for i := range *in {
|
|
||||||
if err := Convert_federation_ServerAddressByClientCIDR_To_v1alpha1_ServerAddressByClientCIDR(&(*in)[i], &(*out)[i], s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
out.ServerAddressByClientCIDRs = nil
|
|
||||||
}
|
|
||||||
if in.SecretRef != nil {
|
|
||||||
in, out := &in.SecretRef, &out.SecretRef
|
|
||||||
*out = new(v1.LocalObjectReference)
|
|
||||||
// TODO: Inefficient conversion - can we improve it?
|
|
||||||
if err := s.Convert(*in, *out, 0); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
out.SecretRef = nil
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Convert_federation_ClusterSpec_To_v1alpha1_ClusterSpec(in *federation.ClusterSpec, out *ClusterSpec, s conversion.Scope) error {
|
|
||||||
return autoConvert_federation_ClusterSpec_To_v1alpha1_ClusterSpec(in, out, s)
|
|
||||||
}
|
|
||||||
|
|
||||||
func autoConvert_v1alpha1_ClusterStatus_To_federation_ClusterStatus(in *ClusterStatus, out *federation.ClusterStatus, s conversion.Scope) error {
|
|
||||||
if in.Conditions != nil {
|
|
||||||
in, out := &in.Conditions, &out.Conditions
|
|
||||||
*out = make([]federation.ClusterCondition, len(*in))
|
|
||||||
for i := range *in {
|
|
||||||
if err := Convert_v1alpha1_ClusterCondition_To_federation_ClusterCondition(&(*in)[i], &(*out)[i], s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
out.Conditions = nil
|
|
||||||
}
|
|
||||||
if err := v1.Convert_v1_ResourceList_To_api_ResourceList(&in.Capacity, &out.Capacity, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := v1.Convert_v1_ResourceList_To_api_ResourceList(&in.Allocatable, &out.Allocatable, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := Convert_v1alpha1_ClusterMeta_To_federation_ClusterMeta(&in.ClusterMeta, &out.ClusterMeta, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
out.Zones = in.Zones
|
|
||||||
out.Region = in.Region
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Convert_v1alpha1_ClusterStatus_To_federation_ClusterStatus(in *ClusterStatus, out *federation.ClusterStatus, s conversion.Scope) error {
|
|
||||||
return autoConvert_v1alpha1_ClusterStatus_To_federation_ClusterStatus(in, out, s)
|
|
||||||
}
|
|
||||||
|
|
||||||
func autoConvert_federation_ClusterStatus_To_v1alpha1_ClusterStatus(in *federation.ClusterStatus, out *ClusterStatus, s conversion.Scope) error {
|
|
||||||
if in.Conditions != nil {
|
|
||||||
in, out := &in.Conditions, &out.Conditions
|
|
||||||
*out = make([]ClusterCondition, len(*in))
|
|
||||||
for i := range *in {
|
|
||||||
if err := Convert_federation_ClusterCondition_To_v1alpha1_ClusterCondition(&(*in)[i], &(*out)[i], s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
out.Conditions = nil
|
|
||||||
}
|
|
||||||
if in.Capacity != nil {
|
|
||||||
in, out := &in.Capacity, &out.Capacity
|
|
||||||
*out = make(v1.ResourceList, len(*in))
|
|
||||||
for key, val := range *in {
|
|
||||||
newVal := new(resource.Quantity)
|
|
||||||
if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
(*out)[v1.ResourceName(key)] = *newVal
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
out.Capacity = nil
|
|
||||||
}
|
|
||||||
if in.Allocatable != nil {
|
|
||||||
in, out := &in.Allocatable, &out.Allocatable
|
|
||||||
*out = make(v1.ResourceList, len(*in))
|
|
||||||
for key, val := range *in {
|
|
||||||
newVal := new(resource.Quantity)
|
|
||||||
if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
(*out)[v1.ResourceName(key)] = *newVal
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
out.Allocatable = nil
|
|
||||||
}
|
|
||||||
if err := Convert_federation_ClusterMeta_To_v1alpha1_ClusterMeta(&in.ClusterMeta, &out.ClusterMeta, s); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
out.Zones = in.Zones
|
|
||||||
out.Region = in.Region
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Convert_federation_ClusterStatus_To_v1alpha1_ClusterStatus(in *federation.ClusterStatus, out *ClusterStatus, s conversion.Scope) error {
|
|
||||||
return autoConvert_federation_ClusterStatus_To_v1alpha1_ClusterStatus(in, out, s)
|
|
||||||
}
|
|
||||||
|
|
||||||
func autoConvert_v1alpha1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in *ServerAddressByClientCIDR, out *federation.ServerAddressByClientCIDR, s conversion.Scope) error {
|
|
||||||
out.ClientCIDR = in.ClientCIDR
|
|
||||||
out.ServerAddress = in.ServerAddress
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Convert_v1alpha1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in *ServerAddressByClientCIDR, out *federation.ServerAddressByClientCIDR, s conversion.Scope) error {
|
|
||||||
return autoConvert_v1alpha1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in, out, s)
|
|
||||||
}
|
|
||||||
|
|
||||||
func autoConvert_federation_ServerAddressByClientCIDR_To_v1alpha1_ServerAddressByClientCIDR(in *federation.ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, s conversion.Scope) error {
|
|
||||||
out.ClientCIDR = in.ClientCIDR
|
|
||||||
out.ServerAddress = in.ServerAddress
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func Convert_federation_ServerAddressByClientCIDR_To_v1alpha1_ServerAddressByClientCIDR(in *federation.ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, s conversion.Scope) error {
|
|
||||||
return autoConvert_federation_ServerAddressByClientCIDR_To_v1alpha1_ServerAddressByClientCIDR(in, out, s)
|
|
||||||
}
|
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package v1alpha1
|
package v1beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
296
federation/apis/federation/v1beta1/conversion_generated.go
Normal file
296
federation/apis/federation/v1beta1/conversion_generated.go
Normal file
@ -0,0 +1,296 @@
|
|||||||
|
// +build !ignore_autogenerated
|
||||||
|
|
||||||
|
/*
|
||||||
|
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// This file was autogenerated by conversion-gen. Do not edit it manually!
|
||||||
|
|
||||||
|
package v1beta1
|
||||||
|
|
||||||
|
import (
|
||||||
|
federation "k8s.io/kubernetes/federation/apis/federation"
|
||||||
|
api "k8s.io/kubernetes/pkg/api"
|
||||||
|
v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||||
|
conversion "k8s.io/kubernetes/pkg/conversion"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
if err := api.Scheme.AddGeneratedConversionFuncs(
|
||||||
|
Convert_v1beta1_Cluster_To_federation_Cluster,
|
||||||
|
Convert_federation_Cluster_To_v1beta1_Cluster,
|
||||||
|
Convert_v1beta1_ClusterCondition_To_federation_ClusterCondition,
|
||||||
|
Convert_federation_ClusterCondition_To_v1beta1_ClusterCondition,
|
||||||
|
Convert_v1beta1_ClusterList_To_federation_ClusterList,
|
||||||
|
Convert_federation_ClusterList_To_v1beta1_ClusterList,
|
||||||
|
Convert_v1beta1_ClusterSpec_To_federation_ClusterSpec,
|
||||||
|
Convert_federation_ClusterSpec_To_v1beta1_ClusterSpec,
|
||||||
|
Convert_v1beta1_ClusterStatus_To_federation_ClusterStatus,
|
||||||
|
Convert_federation_ClusterStatus_To_v1beta1_ClusterStatus,
|
||||||
|
Convert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR,
|
||||||
|
Convert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR,
|
||||||
|
); err != nil {
|
||||||
|
// if one of the conversion functions is malformed, detect it immediately.
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_v1beta1_Cluster_To_federation_Cluster(in *Cluster, out *federation.Cluster, s conversion.Scope) error {
|
||||||
|
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
// TODO: Inefficient conversion - can we improve it?
|
||||||
|
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := Convert_v1beta1_ClusterSpec_To_federation_ClusterSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := Convert_v1beta1_ClusterStatus_To_federation_ClusterStatus(&in.Status, &out.Status, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func Convert_v1beta1_Cluster_To_federation_Cluster(in *Cluster, out *federation.Cluster, s conversion.Scope) error {
|
||||||
|
return autoConvert_v1beta1_Cluster_To_federation_Cluster(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_federation_Cluster_To_v1beta1_Cluster(in *federation.Cluster, out *Cluster, s conversion.Scope) error {
|
||||||
|
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
// TODO: Inefficient conversion - can we improve it?
|
||||||
|
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := Convert_federation_ClusterSpec_To_v1beta1_ClusterSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := Convert_federation_ClusterStatus_To_v1beta1_ClusterStatus(&in.Status, &out.Status, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func Convert_federation_Cluster_To_v1beta1_Cluster(in *federation.Cluster, out *Cluster, s conversion.Scope) error {
|
||||||
|
return autoConvert_federation_Cluster_To_v1beta1_Cluster(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_v1beta1_ClusterCondition_To_federation_ClusterCondition(in *ClusterCondition, out *federation.ClusterCondition, s conversion.Scope) error {
|
||||||
|
out.Type = federation.ClusterConditionType(in.Type)
|
||||||
|
out.Status = api.ConditionStatus(in.Status)
|
||||||
|
if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
out.Reason = in.Reason
|
||||||
|
out.Message = in.Message
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func Convert_v1beta1_ClusterCondition_To_federation_ClusterCondition(in *ClusterCondition, out *federation.ClusterCondition, s conversion.Scope) error {
|
||||||
|
return autoConvert_v1beta1_ClusterCondition_To_federation_ClusterCondition(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_federation_ClusterCondition_To_v1beta1_ClusterCondition(in *federation.ClusterCondition, out *ClusterCondition, s conversion.Scope) error {
|
||||||
|
out.Type = ClusterConditionType(in.Type)
|
||||||
|
out.Status = v1.ConditionStatus(in.Status)
|
||||||
|
if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
out.Reason = in.Reason
|
||||||
|
out.Message = in.Message
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func Convert_federation_ClusterCondition_To_v1beta1_ClusterCondition(in *federation.ClusterCondition, out *ClusterCondition, s conversion.Scope) error {
|
||||||
|
return autoConvert_federation_ClusterCondition_To_v1beta1_ClusterCondition(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_v1beta1_ClusterList_To_federation_ClusterList(in *ClusterList, out *federation.ClusterList, s conversion.Scope) error {
|
||||||
|
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if in.Items != nil {
|
||||||
|
in, out := &in.Items, &out.Items
|
||||||
|
*out = make([]federation.Cluster, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
if err := Convert_v1beta1_Cluster_To_federation_Cluster(&(*in)[i], &(*out)[i], s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.Items = nil
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func Convert_v1beta1_ClusterList_To_federation_ClusterList(in *ClusterList, out *federation.ClusterList, s conversion.Scope) error {
|
||||||
|
return autoConvert_v1beta1_ClusterList_To_federation_ClusterList(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_federation_ClusterList_To_v1beta1_ClusterList(in *federation.ClusterList, out *ClusterList, s conversion.Scope) error {
|
||||||
|
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if in.Items != nil {
|
||||||
|
in, out := &in.Items, &out.Items
|
||||||
|
*out = make([]Cluster, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
if err := Convert_federation_Cluster_To_v1beta1_Cluster(&(*in)[i], &(*out)[i], s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.Items = nil
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func Convert_federation_ClusterList_To_v1beta1_ClusterList(in *federation.ClusterList, out *ClusterList, s conversion.Scope) error {
|
||||||
|
return autoConvert_federation_ClusterList_To_v1beta1_ClusterList(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_v1beta1_ClusterSpec_To_federation_ClusterSpec(in *ClusterSpec, out *federation.ClusterSpec, s conversion.Scope) error {
|
||||||
|
if in.ServerAddressByClientCIDRs != nil {
|
||||||
|
in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
|
||||||
|
*out = make([]federation.ServerAddressByClientCIDR, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
if err := Convert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(&(*in)[i], &(*out)[i], s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.ServerAddressByClientCIDRs = nil
|
||||||
|
}
|
||||||
|
if in.SecretRef != nil {
|
||||||
|
in, out := &in.SecretRef, &out.SecretRef
|
||||||
|
*out = new(api.LocalObjectReference)
|
||||||
|
// TODO: Inefficient conversion - can we improve it?
|
||||||
|
if err := s.Convert(*in, *out, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.SecretRef = nil
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func Convert_v1beta1_ClusterSpec_To_federation_ClusterSpec(in *ClusterSpec, out *federation.ClusterSpec, s conversion.Scope) error {
|
||||||
|
return autoConvert_v1beta1_ClusterSpec_To_federation_ClusterSpec(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_federation_ClusterSpec_To_v1beta1_ClusterSpec(in *federation.ClusterSpec, out *ClusterSpec, s conversion.Scope) error {
|
||||||
|
if in.ServerAddressByClientCIDRs != nil {
|
||||||
|
in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
|
||||||
|
*out = make([]ServerAddressByClientCIDR, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
if err := Convert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(&(*in)[i], &(*out)[i], s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.ServerAddressByClientCIDRs = nil
|
||||||
|
}
|
||||||
|
if in.SecretRef != nil {
|
||||||
|
in, out := &in.SecretRef, &out.SecretRef
|
||||||
|
*out = new(v1.LocalObjectReference)
|
||||||
|
// TODO: Inefficient conversion - can we improve it?
|
||||||
|
if err := s.Convert(*in, *out, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.SecretRef = nil
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func Convert_federation_ClusterSpec_To_v1beta1_ClusterSpec(in *federation.ClusterSpec, out *ClusterSpec, s conversion.Scope) error {
|
||||||
|
return autoConvert_federation_ClusterSpec_To_v1beta1_ClusterSpec(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_v1beta1_ClusterStatus_To_federation_ClusterStatus(in *ClusterStatus, out *federation.ClusterStatus, s conversion.Scope) error {
|
||||||
|
if in.Conditions != nil {
|
||||||
|
in, out := &in.Conditions, &out.Conditions
|
||||||
|
*out = make([]federation.ClusterCondition, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
if err := Convert_v1beta1_ClusterCondition_To_federation_ClusterCondition(&(*in)[i], &(*out)[i], s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.Conditions = nil
|
||||||
|
}
|
||||||
|
out.Zones = in.Zones
|
||||||
|
out.Region = in.Region
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func Convert_v1beta1_ClusterStatus_To_federation_ClusterStatus(in *ClusterStatus, out *federation.ClusterStatus, s conversion.Scope) error {
|
||||||
|
return autoConvert_v1beta1_ClusterStatus_To_federation_ClusterStatus(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_federation_ClusterStatus_To_v1beta1_ClusterStatus(in *federation.ClusterStatus, out *ClusterStatus, s conversion.Scope) error {
|
||||||
|
if in.Conditions != nil {
|
||||||
|
in, out := &in.Conditions, &out.Conditions
|
||||||
|
*out = make([]ClusterCondition, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
if err := Convert_federation_ClusterCondition_To_v1beta1_ClusterCondition(&(*in)[i], &(*out)[i], s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.Conditions = nil
|
||||||
|
}
|
||||||
|
out.Zones = in.Zones
|
||||||
|
out.Region = in.Region
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func Convert_federation_ClusterStatus_To_v1beta1_ClusterStatus(in *federation.ClusterStatus, out *ClusterStatus, s conversion.Scope) error {
|
||||||
|
return autoConvert_federation_ClusterStatus_To_v1beta1_ClusterStatus(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in *ServerAddressByClientCIDR, out *federation.ServerAddressByClientCIDR, s conversion.Scope) error {
|
||||||
|
out.ClientCIDR = in.ClientCIDR
|
||||||
|
out.ServerAddress = in.ServerAddress
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func Convert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in *ServerAddressByClientCIDR, out *federation.ServerAddressByClientCIDR, s conversion.Scope) error {
|
||||||
|
return autoConvert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(in *federation.ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, s conversion.Scope) error {
|
||||||
|
out.ClientCIDR = in.ClientCIDR
|
||||||
|
out.ServerAddress = in.ServerAddress
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func Convert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(in *federation.ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, s conversion.Scope) error {
|
||||||
|
return autoConvert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(in, out, s)
|
||||||
|
}
|
@ -18,11 +18,10 @@ limitations under the License.
|
|||||||
|
|
||||||
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
|
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
|
||||||
|
|
||||||
package v1alpha1
|
package v1beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
api "k8s.io/kubernetes/pkg/api"
|
api "k8s.io/kubernetes/pkg/api"
|
||||||
resource "k8s.io/kubernetes/pkg/api/resource"
|
|
||||||
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
||||||
v1 "k8s.io/kubernetes/pkg/api/v1"
|
v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||||
conversion "k8s.io/kubernetes/pkg/conversion"
|
conversion "k8s.io/kubernetes/pkg/conversion"
|
||||||
@ -30,36 +29,35 @@ import (
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
if err := api.Scheme.AddGeneratedDeepCopyFuncs(
|
if err := api.Scheme.AddGeneratedDeepCopyFuncs(
|
||||||
DeepCopy_v1alpha1_Cluster,
|
DeepCopy_v1beta1_Cluster,
|
||||||
DeepCopy_v1alpha1_ClusterCondition,
|
DeepCopy_v1beta1_ClusterCondition,
|
||||||
DeepCopy_v1alpha1_ClusterList,
|
DeepCopy_v1beta1_ClusterList,
|
||||||
DeepCopy_v1alpha1_ClusterMeta,
|
DeepCopy_v1beta1_ClusterSpec,
|
||||||
DeepCopy_v1alpha1_ClusterSpec,
|
DeepCopy_v1beta1_ClusterStatus,
|
||||||
DeepCopy_v1alpha1_ClusterStatus,
|
DeepCopy_v1beta1_ServerAddressByClientCIDR,
|
||||||
DeepCopy_v1alpha1_ServerAddressByClientCIDR,
|
|
||||||
); err != nil {
|
); err != nil {
|
||||||
// if one of the deep copy functions is malformed, detect it immediately.
|
// if one of the deep copy functions is malformed, detect it immediately.
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func DeepCopy_v1alpha1_Cluster(in Cluster, out *Cluster, c *conversion.Cloner) error {
|
func DeepCopy_v1beta1_Cluster(in Cluster, out *Cluster, c *conversion.Cloner) error {
|
||||||
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
if err := v1.DeepCopy_v1_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := DeepCopy_v1alpha1_ClusterSpec(in.Spec, &out.Spec, c); err != nil {
|
if err := DeepCopy_v1beta1_ClusterSpec(in.Spec, &out.Spec, c); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := DeepCopy_v1alpha1_ClusterStatus(in.Status, &out.Status, c); err != nil {
|
if err := DeepCopy_v1beta1_ClusterStatus(in.Status, &out.Status, c); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func DeepCopy_v1alpha1_ClusterCondition(in ClusterCondition, out *ClusterCondition, c *conversion.Cloner) error {
|
func DeepCopy_v1beta1_ClusterCondition(in ClusterCondition, out *ClusterCondition, c *conversion.Cloner) error {
|
||||||
out.Type = in.Type
|
out.Type = in.Type
|
||||||
out.Status = in.Status
|
out.Status = in.Status
|
||||||
if err := unversioned.DeepCopy_unversioned_Time(in.LastProbeTime, &out.LastProbeTime, c); err != nil {
|
if err := unversioned.DeepCopy_unversioned_Time(in.LastProbeTime, &out.LastProbeTime, c); err != nil {
|
||||||
@ -73,7 +71,7 @@ func DeepCopy_v1alpha1_ClusterCondition(in ClusterCondition, out *ClusterConditi
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func DeepCopy_v1alpha1_ClusterList(in ClusterList, out *ClusterList, c *conversion.Cloner) error {
|
func DeepCopy_v1beta1_ClusterList(in ClusterList, out *ClusterList, c *conversion.Cloner) error {
|
||||||
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -84,7 +82,7 @@ func DeepCopy_v1alpha1_ClusterList(in ClusterList, out *ClusterList, c *conversi
|
|||||||
in, out := in.Items, &out.Items
|
in, out := in.Items, &out.Items
|
||||||
*out = make([]Cluster, len(in))
|
*out = make([]Cluster, len(in))
|
||||||
for i := range in {
|
for i := range in {
|
||||||
if err := DeepCopy_v1alpha1_Cluster(in[i], &(*out)[i], c); err != nil {
|
if err := DeepCopy_v1beta1_Cluster(in[i], &(*out)[i], c); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -94,17 +92,12 @@ func DeepCopy_v1alpha1_ClusterList(in ClusterList, out *ClusterList, c *conversi
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func DeepCopy_v1alpha1_ClusterMeta(in ClusterMeta, out *ClusterMeta, c *conversion.Cloner) error {
|
func DeepCopy_v1beta1_ClusterSpec(in ClusterSpec, out *ClusterSpec, c *conversion.Cloner) error {
|
||||||
out.Version = in.Version
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func DeepCopy_v1alpha1_ClusterSpec(in ClusterSpec, out *ClusterSpec, c *conversion.Cloner) error {
|
|
||||||
if in.ServerAddressByClientCIDRs != nil {
|
if in.ServerAddressByClientCIDRs != nil {
|
||||||
in, out := in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
|
in, out := in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
|
||||||
*out = make([]ServerAddressByClientCIDR, len(in))
|
*out = make([]ServerAddressByClientCIDR, len(in))
|
||||||
for i := range in {
|
for i := range in {
|
||||||
if err := DeepCopy_v1alpha1_ServerAddressByClientCIDR(in[i], &(*out)[i], c); err != nil {
|
if err := DeepCopy_v1beta1_ServerAddressByClientCIDR(in[i], &(*out)[i], c); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,47 +116,18 @@ func DeepCopy_v1alpha1_ClusterSpec(in ClusterSpec, out *ClusterSpec, c *conversi
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func DeepCopy_v1alpha1_ClusterStatus(in ClusterStatus, out *ClusterStatus, c *conversion.Cloner) error {
|
func DeepCopy_v1beta1_ClusterStatus(in ClusterStatus, out *ClusterStatus, c *conversion.Cloner) error {
|
||||||
if in.Conditions != nil {
|
if in.Conditions != nil {
|
||||||
in, out := in.Conditions, &out.Conditions
|
in, out := in.Conditions, &out.Conditions
|
||||||
*out = make([]ClusterCondition, len(in))
|
*out = make([]ClusterCondition, len(in))
|
||||||
for i := range in {
|
for i := range in {
|
||||||
if err := DeepCopy_v1alpha1_ClusterCondition(in[i], &(*out)[i], c); err != nil {
|
if err := DeepCopy_v1beta1_ClusterCondition(in[i], &(*out)[i], c); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
out.Conditions = nil
|
out.Conditions = nil
|
||||||
}
|
}
|
||||||
if in.Capacity != nil {
|
|
||||||
in, out := in.Capacity, &out.Capacity
|
|
||||||
*out = make(v1.ResourceList)
|
|
||||||
for key, val := range in {
|
|
||||||
newVal := new(resource.Quantity)
|
|
||||||
if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
(*out)[key] = *newVal
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
out.Capacity = nil
|
|
||||||
}
|
|
||||||
if in.Allocatable != nil {
|
|
||||||
in, out := in.Allocatable, &out.Allocatable
|
|
||||||
*out = make(v1.ResourceList)
|
|
||||||
for key, val := range in {
|
|
||||||
newVal := new(resource.Quantity)
|
|
||||||
if err := resource.DeepCopy_resource_Quantity(val, newVal, c); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
(*out)[key] = *newVal
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
out.Allocatable = nil
|
|
||||||
}
|
|
||||||
if err := DeepCopy_v1alpha1_ClusterMeta(in.ClusterMeta, &out.ClusterMeta, c); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if in.Zones != nil {
|
if in.Zones != nil {
|
||||||
in, out := in.Zones, &out.Zones
|
in, out := in.Zones, &out.Zones
|
||||||
*out = make([]string, len(in))
|
*out = make([]string, len(in))
|
||||||
@ -175,7 +139,7 @@ func DeepCopy_v1alpha1_ClusterStatus(in ClusterStatus, out *ClusterStatus, c *co
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func DeepCopy_v1alpha1_ServerAddressByClientCIDR(in ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, c *conversion.Cloner) error {
|
func DeepCopy_v1beta1_ServerAddressByClientCIDR(in ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, c *conversion.Cloner) error {
|
||||||
out.ClientCIDR = in.ClientCIDR
|
out.ClientCIDR = in.ClientCIDR
|
||||||
out.ServerAddress = in.ServerAddress
|
out.ServerAddress = in.ServerAddress
|
||||||
return nil
|
return nil
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package v1alpha1
|
package v1beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
@ -15,4 +15,4 @@ limitations under the License.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// +genconversion=true
|
// +genconversion=true
|
||||||
package v1alpha1
|
package v1beta1
|
@ -15,32 +15,29 @@ limitations under the License.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Code generated by protoc-gen-gogo.
|
// Code generated by protoc-gen-gogo.
|
||||||
// source: k8s.io/kubernetes/federation/apis/federation/v1alpha1/generated.proto
|
// source: k8s.io/kubernetes/federation/apis/federation/v1beta1/generated.proto
|
||||||
// DO NOT EDIT!
|
// DO NOT EDIT!
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Package v1alpha1 is a generated protocol buffer package.
|
Package v1beta1 is a generated protocol buffer package.
|
||||||
|
|
||||||
It is generated from these files:
|
It is generated from these files:
|
||||||
k8s.io/kubernetes/federation/apis/federation/v1alpha1/generated.proto
|
k8s.io/kubernetes/federation/apis/federation/v1beta1/generated.proto
|
||||||
|
|
||||||
It has these top-level messages:
|
It has these top-level messages:
|
||||||
Cluster
|
Cluster
|
||||||
ClusterCondition
|
ClusterCondition
|
||||||
ClusterList
|
ClusterList
|
||||||
ClusterMeta
|
|
||||||
ClusterSpec
|
ClusterSpec
|
||||||
ClusterStatus
|
ClusterStatus
|
||||||
ServerAddressByClientCIDR
|
ServerAddressByClientCIDR
|
||||||
*/
|
*/
|
||||||
package v1alpha1
|
package v1beta1
|
||||||
|
|
||||||
import proto "github.com/gogo/protobuf/proto"
|
import proto "github.com/gogo/protobuf/proto"
|
||||||
import fmt "fmt"
|
import fmt "fmt"
|
||||||
import math "math"
|
import math "math"
|
||||||
|
|
||||||
import k8s_io_kubernetes_pkg_api_resource "k8s.io/kubernetes/pkg/api/resource"
|
|
||||||
|
|
||||||
import k8s_io_kubernetes_pkg_api_v1 "k8s.io/kubernetes/pkg/api/v1"
|
import k8s_io_kubernetes_pkg_api_v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||||
|
|
||||||
import io "io"
|
import io "io"
|
||||||
@ -62,10 +59,6 @@ func (m *ClusterList) Reset() { *m = ClusterList{} }
|
|||||||
func (m *ClusterList) String() string { return proto.CompactTextString(m) }
|
func (m *ClusterList) String() string { return proto.CompactTextString(m) }
|
||||||
func (*ClusterList) ProtoMessage() {}
|
func (*ClusterList) ProtoMessage() {}
|
||||||
|
|
||||||
func (m *ClusterMeta) Reset() { *m = ClusterMeta{} }
|
|
||||||
func (m *ClusterMeta) String() string { return proto.CompactTextString(m) }
|
|
||||||
func (*ClusterMeta) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (m *ClusterSpec) Reset() { *m = ClusterSpec{} }
|
func (m *ClusterSpec) Reset() { *m = ClusterSpec{} }
|
||||||
func (m *ClusterSpec) String() string { return proto.CompactTextString(m) }
|
func (m *ClusterSpec) String() string { return proto.CompactTextString(m) }
|
||||||
func (*ClusterSpec) ProtoMessage() {}
|
func (*ClusterSpec) ProtoMessage() {}
|
||||||
@ -79,13 +72,12 @@ func (m *ServerAddressByClientCIDR) String() string { return proto.CompactTextSt
|
|||||||
func (*ServerAddressByClientCIDR) ProtoMessage() {}
|
func (*ServerAddressByClientCIDR) ProtoMessage() {}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
proto.RegisterType((*Cluster)(nil), "k8s.io.kubernetes.federation.apis.federation.v1alpha1.Cluster")
|
proto.RegisterType((*Cluster)(nil), "k8s.io.kubernetes.federation.apis.federation.v1beta1.Cluster")
|
||||||
proto.RegisterType((*ClusterCondition)(nil), "k8s.io.kubernetes.federation.apis.federation.v1alpha1.ClusterCondition")
|
proto.RegisterType((*ClusterCondition)(nil), "k8s.io.kubernetes.federation.apis.federation.v1beta1.ClusterCondition")
|
||||||
proto.RegisterType((*ClusterList)(nil), "k8s.io.kubernetes.federation.apis.federation.v1alpha1.ClusterList")
|
proto.RegisterType((*ClusterList)(nil), "k8s.io.kubernetes.federation.apis.federation.v1beta1.ClusterList")
|
||||||
proto.RegisterType((*ClusterMeta)(nil), "k8s.io.kubernetes.federation.apis.federation.v1alpha1.ClusterMeta")
|
proto.RegisterType((*ClusterSpec)(nil), "k8s.io.kubernetes.federation.apis.federation.v1beta1.ClusterSpec")
|
||||||
proto.RegisterType((*ClusterSpec)(nil), "k8s.io.kubernetes.federation.apis.federation.v1alpha1.ClusterSpec")
|
proto.RegisterType((*ClusterStatus)(nil), "k8s.io.kubernetes.federation.apis.federation.v1beta1.ClusterStatus")
|
||||||
proto.RegisterType((*ClusterStatus)(nil), "k8s.io.kubernetes.federation.apis.federation.v1alpha1.ClusterStatus")
|
proto.RegisterType((*ServerAddressByClientCIDR)(nil), "k8s.io.kubernetes.federation.apis.federation.v1beta1.ServerAddressByClientCIDR")
|
||||||
proto.RegisterType((*ServerAddressByClientCIDR)(nil), "k8s.io.kubernetes.federation.apis.federation.v1alpha1.ServerAddressByClientCIDR")
|
|
||||||
}
|
}
|
||||||
func (m *Cluster) Marshal() (data []byte, err error) {
|
func (m *Cluster) Marshal() (data []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
@ -217,28 +209,6 @@ func (m *ClusterList) MarshalTo(data []byte) (int, error) {
|
|||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ClusterMeta) Marshal() (data []byte, err error) {
|
|
||||||
size := m.Size()
|
|
||||||
data = make([]byte, size)
|
|
||||||
n, err := m.MarshalTo(data)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return data[:n], nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *ClusterMeta) MarshalTo(data []byte) (int, error) {
|
|
||||||
var i int
|
|
||||||
_ = i
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
data[i] = 0xa
|
|
||||||
i++
|
|
||||||
i = encodeVarintGenerated(data, i, uint64(len(m.Version)))
|
|
||||||
i += copy(data[i:], m.Version)
|
|
||||||
return i, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *ClusterSpec) Marshal() (data []byte, err error) {
|
func (m *ClusterSpec) Marshal() (data []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
data = make([]byte, size)
|
data = make([]byte, size)
|
||||||
@ -306,58 +276,6 @@ func (m *ClusterStatus) MarshalTo(data []byte) (int, error) {
|
|||||||
i += n
|
i += n
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(m.Capacity) > 0 {
|
|
||||||
for k := range m.Capacity {
|
|
||||||
data[i] = 0x12
|
|
||||||
i++
|
|
||||||
v := m.Capacity[k]
|
|
||||||
msgSize := (&v).Size()
|
|
||||||
mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + msgSize + sovGenerated(uint64(msgSize))
|
|
||||||
i = encodeVarintGenerated(data, i, uint64(mapSize))
|
|
||||||
data[i] = 0xa
|
|
||||||
i++
|
|
||||||
i = encodeVarintGenerated(data, i, uint64(len(k)))
|
|
||||||
i += copy(data[i:], k)
|
|
||||||
data[i] = 0x12
|
|
||||||
i++
|
|
||||||
i = encodeVarintGenerated(data, i, uint64((&v).Size()))
|
|
||||||
n8, err := (&v).MarshalTo(data[i:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i += n8
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(m.Allocatable) > 0 {
|
|
||||||
for k := range m.Allocatable {
|
|
||||||
data[i] = 0x1a
|
|
||||||
i++
|
|
||||||
v := m.Allocatable[k]
|
|
||||||
msgSize := (&v).Size()
|
|
||||||
mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + msgSize + sovGenerated(uint64(msgSize))
|
|
||||||
i = encodeVarintGenerated(data, i, uint64(mapSize))
|
|
||||||
data[i] = 0xa
|
|
||||||
i++
|
|
||||||
i = encodeVarintGenerated(data, i, uint64(len(k)))
|
|
||||||
i += copy(data[i:], k)
|
|
||||||
data[i] = 0x12
|
|
||||||
i++
|
|
||||||
i = encodeVarintGenerated(data, i, uint64((&v).Size()))
|
|
||||||
n9, err := (&v).MarshalTo(data[i:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i += n9
|
|
||||||
}
|
|
||||||
}
|
|
||||||
data[i] = 0x22
|
|
||||||
i++
|
|
||||||
i = encodeVarintGenerated(data, i, uint64(m.ClusterMeta.Size()))
|
|
||||||
n10, err := m.ClusterMeta.MarshalTo(data[i:])
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
i += n10
|
|
||||||
if len(m.Zones) > 0 {
|
if len(m.Zones) > 0 {
|
||||||
for _, s := range m.Zones {
|
for _, s := range m.Zones {
|
||||||
data[i] = 0x2a
|
data[i] = 0x2a
|
||||||
@ -477,14 +395,6 @@ func (m *ClusterList) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ClusterMeta) Size() (n int) {
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
l = len(m.Version)
|
|
||||||
n += 1 + l + sovGenerated(uint64(l))
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *ClusterSpec) Size() (n int) {
|
func (m *ClusterSpec) Size() (n int) {
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
@ -510,26 +420,6 @@ func (m *ClusterStatus) Size() (n int) {
|
|||||||
n += 1 + l + sovGenerated(uint64(l))
|
n += 1 + l + sovGenerated(uint64(l))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(m.Capacity) > 0 {
|
|
||||||
for k, v := range m.Capacity {
|
|
||||||
_ = k
|
|
||||||
_ = v
|
|
||||||
l = v.Size()
|
|
||||||
mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l))
|
|
||||||
n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(m.Allocatable) > 0 {
|
|
||||||
for k, v := range m.Allocatable {
|
|
||||||
_ = k
|
|
||||||
_ = v
|
|
||||||
l = v.Size()
|
|
||||||
mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l))
|
|
||||||
n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
l = m.ClusterMeta.Size()
|
|
||||||
n += 1 + l + sovGenerated(uint64(l))
|
|
||||||
if len(m.Zones) > 0 {
|
if len(m.Zones) > 0 {
|
||||||
for _, s := range m.Zones {
|
for _, s := range m.Zones {
|
||||||
l = len(s)
|
l = len(s)
|
||||||
@ -1041,85 +931,6 @@ func (m *ClusterList) Unmarshal(data []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *ClusterMeta) Unmarshal(data []byte) error {
|
|
||||||
l := len(data)
|
|
||||||
iNdEx := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
preIndex := iNdEx
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowGenerated
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := data[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldNum := int32(wire >> 3)
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
if wireType == 4 {
|
|
||||||
return fmt.Errorf("proto: ClusterMeta: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return fmt.Errorf("proto: ClusterMeta: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
||||||
}
|
|
||||||
switch fieldNum {
|
|
||||||
case 1:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowGenerated
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := data[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthGenerated
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Version = string(data[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := skipGenerated(data[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if skippy < 0 {
|
|
||||||
return ErrInvalidLengthGenerated
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (m *ClusterSpec) Unmarshal(data []byte) error {
|
func (m *ClusterSpec) Unmarshal(data []byte) error {
|
||||||
l := len(data)
|
l := len(data)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
@ -1294,268 +1105,6 @@ func (m *ClusterStatus) Unmarshal(data []byte) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 2:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Capacity", wireType)
|
|
||||||
}
|
|
||||||
var msglen int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowGenerated
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := data[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
msglen |= (int(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if msglen < 0 {
|
|
||||||
return ErrInvalidLengthGenerated
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + msglen
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
var keykey uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowGenerated
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := data[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
keykey |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var stringLenmapkey uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowGenerated
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := data[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLenmapkey |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLenmapkey := int(stringLenmapkey)
|
|
||||||
if intStringLenmapkey < 0 {
|
|
||||||
return ErrInvalidLengthGenerated
|
|
||||||
}
|
|
||||||
postStringIndexmapkey := iNdEx + intStringLenmapkey
|
|
||||||
if postStringIndexmapkey > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
mapkey := k8s_io_kubernetes_pkg_api_v1.ResourceName(data[iNdEx:postStringIndexmapkey])
|
|
||||||
iNdEx = postStringIndexmapkey
|
|
||||||
var valuekey uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowGenerated
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := data[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
valuekey |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var mapmsglen int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowGenerated
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := data[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
mapmsglen |= (int(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if mapmsglen < 0 {
|
|
||||||
return ErrInvalidLengthGenerated
|
|
||||||
}
|
|
||||||
postmsgIndex := iNdEx + mapmsglen
|
|
||||||
if mapmsglen < 0 {
|
|
||||||
return ErrInvalidLengthGenerated
|
|
||||||
}
|
|
||||||
if postmsgIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
mapvalue := &k8s_io_kubernetes_pkg_api_resource.Quantity{}
|
|
||||||
if err := mapvalue.Unmarshal(data[iNdEx:postmsgIndex]); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
iNdEx = postmsgIndex
|
|
||||||
if m.Capacity == nil {
|
|
||||||
m.Capacity = make(k8s_io_kubernetes_pkg_api_v1.ResourceList)
|
|
||||||
}
|
|
||||||
m.Capacity[k8s_io_kubernetes_pkg_api_v1.ResourceName(mapkey)] = *mapvalue
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 3:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Allocatable", wireType)
|
|
||||||
}
|
|
||||||
var msglen int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowGenerated
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := data[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
msglen |= (int(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if msglen < 0 {
|
|
||||||
return ErrInvalidLengthGenerated
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + msglen
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
var keykey uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowGenerated
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := data[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
keykey |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var stringLenmapkey uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowGenerated
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := data[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLenmapkey |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLenmapkey := int(stringLenmapkey)
|
|
||||||
if intStringLenmapkey < 0 {
|
|
||||||
return ErrInvalidLengthGenerated
|
|
||||||
}
|
|
||||||
postStringIndexmapkey := iNdEx + intStringLenmapkey
|
|
||||||
if postStringIndexmapkey > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
mapkey := k8s_io_kubernetes_pkg_api_v1.ResourceName(data[iNdEx:postStringIndexmapkey])
|
|
||||||
iNdEx = postStringIndexmapkey
|
|
||||||
var valuekey uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowGenerated
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := data[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
valuekey |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var mapmsglen int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowGenerated
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := data[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
mapmsglen |= (int(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if mapmsglen < 0 {
|
|
||||||
return ErrInvalidLengthGenerated
|
|
||||||
}
|
|
||||||
postmsgIndex := iNdEx + mapmsglen
|
|
||||||
if mapmsglen < 0 {
|
|
||||||
return ErrInvalidLengthGenerated
|
|
||||||
}
|
|
||||||
if postmsgIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
mapvalue := &k8s_io_kubernetes_pkg_api_resource.Quantity{}
|
|
||||||
if err := mapvalue.Unmarshal(data[iNdEx:postmsgIndex]); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
iNdEx = postmsgIndex
|
|
||||||
if m.Allocatable == nil {
|
|
||||||
m.Allocatable = make(k8s_io_kubernetes_pkg_api_v1.ResourceList)
|
|
||||||
}
|
|
||||||
m.Allocatable[k8s_io_kubernetes_pkg_api_v1.ResourceName(mapkey)] = *mapvalue
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 4:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field ClusterMeta", wireType)
|
|
||||||
}
|
|
||||||
var msglen int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowGenerated
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := data[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
msglen |= (int(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if msglen < 0 {
|
|
||||||
return ErrInvalidLengthGenerated
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + msglen
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if err := m.ClusterMeta.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
iNdEx = postIndex
|
|
||||||
case 5:
|
case 5:
|
||||||
if wireType != 2 {
|
if wireType != 2 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Zones", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field Zones", wireType)
|
@ -19,7 +19,7 @@ limitations under the License.
|
|||||||
|
|
||||||
syntax = 'proto2';
|
syntax = 'proto2';
|
||||||
|
|
||||||
package k8s.io.kubernetes.federation.apis.federation.v1alpha1;
|
package k8s.io.kubernetes.federation.apis.federation.v1beta1;
|
||||||
|
|
||||||
import "k8s.io/kubernetes/pkg/api/resource/generated.proto";
|
import "k8s.io/kubernetes/pkg/api/resource/generated.proto";
|
||||||
import "k8s.io/kubernetes/pkg/api/unversioned/generated.proto";
|
import "k8s.io/kubernetes/pkg/api/unversioned/generated.proto";
|
||||||
@ -27,7 +27,7 @@ import "k8s.io/kubernetes/pkg/api/v1/generated.proto";
|
|||||||
import "k8s.io/kubernetes/pkg/util/intstr/generated.proto";
|
import "k8s.io/kubernetes/pkg/util/intstr/generated.proto";
|
||||||
|
|
||||||
// Package-wide variables from generator "generated".
|
// Package-wide variables from generator "generated".
|
||||||
option go_package = "v1alpha1";
|
option go_package = "v1beta1";
|
||||||
|
|
||||||
// Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation.
|
// Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation.
|
||||||
message Cluster {
|
message Cluster {
|
||||||
@ -73,12 +73,6 @@ message ClusterList {
|
|||||||
repeated Cluster items = 2;
|
repeated Cluster items = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cluster metadata
|
|
||||||
message ClusterMeta {
|
|
||||||
// Release version of the cluster.
|
|
||||||
optional string version = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ClusterSpec describes the attributes of a kubernetes cluster.
|
// ClusterSpec describes the attributes of a kubernetes cluster.
|
||||||
message ClusterSpec {
|
message ClusterSpec {
|
||||||
// A map of client CIDR to server address.
|
// A map of client CIDR to server address.
|
||||||
@ -100,14 +94,6 @@ message ClusterStatus {
|
|||||||
// Conditions is an array of current cluster conditions.
|
// Conditions is an array of current cluster conditions.
|
||||||
repeated ClusterCondition conditions = 1;
|
repeated ClusterCondition conditions = 1;
|
||||||
|
|
||||||
// Capacity represents the total resources of the cluster
|
|
||||||
map<string, k8s.io.kubernetes.pkg.api.resource.Quantity> capacity = 2;
|
|
||||||
|
|
||||||
// Allocatable represents the total resources of a cluster that are available for scheduling.
|
|
||||||
map<string, k8s.io.kubernetes.pkg.api.resource.Quantity> allocatable = 3;
|
|
||||||
|
|
||||||
optional ClusterMeta clusterMeta = 4;
|
|
||||||
|
|
||||||
// Zones is the list of avaliability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'.
|
// Zones is the list of avaliability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'.
|
||||||
// These will always be in the same region.
|
// These will always be in the same region.
|
||||||
repeated string zones = 5;
|
repeated string zones = 5;
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package v1alpha1
|
package v1beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||||
@ -27,7 +27,7 @@ import (
|
|||||||
const GroupName = "federation"
|
const GroupName = "federation"
|
||||||
|
|
||||||
// SchemeGroupVersion is group version used to register these objects
|
// SchemeGroupVersion is group version used to register these objects
|
||||||
var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1alpha1"}
|
var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1beta1"}
|
||||||
|
|
||||||
// Adds the list of known types to api.Scheme.
|
// Adds the list of known types to api.Scheme.
|
||||||
func AddToScheme(scheme *runtime.Scheme) {
|
func AddToScheme(scheme *runtime.Scheme) {
|
@ -19,16 +19,15 @@ limitations under the License.
|
|||||||
// THIS FILE IS AUTO-GENERATED BY codecgen.
|
// THIS FILE IS AUTO-GENERATED BY codecgen.
|
||||||
// ************************************************************
|
// ************************************************************
|
||||||
|
|
||||||
package v1alpha1
|
package v1beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
codec1978 "github.com/ugorji/go/codec"
|
codec1978 "github.com/ugorji/go/codec"
|
||||||
pkg3_resource "k8s.io/kubernetes/pkg/api/resource"
|
|
||||||
pkg2_unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
pkg2_unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
||||||
pkg1_v1 "k8s.io/kubernetes/pkg/api/v1"
|
pkg1_v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||||
pkg4_types "k8s.io/kubernetes/pkg/types"
|
pkg3_types "k8s.io/kubernetes/pkg/types"
|
||||||
"reflect"
|
"reflect"
|
||||||
"runtime"
|
"runtime"
|
||||||
time "time"
|
time "time"
|
||||||
@ -64,12 +63,11 @@ func init() {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
if false { // reference the types, but skip this branch at build/run time
|
if false { // reference the types, but skip this branch at build/run time
|
||||||
var v0 pkg3_resource.Quantity
|
var v0 pkg2_unversioned.Time
|
||||||
var v1 pkg2_unversioned.Time
|
var v1 pkg1_v1.LocalObjectReference
|
||||||
var v2 pkg1_v1.LocalObjectReference
|
var v2 pkg3_types.UID
|
||||||
var v3 pkg4_types.UID
|
var v3 time.Time
|
||||||
var v4 time.Time
|
_, _, _, _ = v0, v1, v2, v3
|
||||||
_, _, _, _, _ = v0, v1, v2, v3, v4
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -985,175 +983,6 @@ func (x *ClusterCondition) codecDecodeSelfFromArray(l int, d *codec1978.Decoder)
|
|||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ClusterMeta) CodecEncodeSelf(e *codec1978.Encoder) {
|
|
||||||
var h codecSelfer1234
|
|
||||||
z, r := codec1978.GenHelperEncoder(e)
|
|
||||||
_, _, _ = h, z, r
|
|
||||||
if x == nil {
|
|
||||||
r.EncodeNil()
|
|
||||||
} else {
|
|
||||||
yym1 := z.EncBinary()
|
|
||||||
_ = yym1
|
|
||||||
if false {
|
|
||||||
} else if z.HasExtensions() && z.EncExt(x) {
|
|
||||||
} else {
|
|
||||||
yysep2 := !z.EncBinary()
|
|
||||||
yy2arr2 := z.EncBasicHandle().StructToArray
|
|
||||||
var yyq2 [1]bool
|
|
||||||
_, _, _ = yysep2, yyq2, yy2arr2
|
|
||||||
const yyr2 bool = false
|
|
||||||
yyq2[0] = x.Version != ""
|
|
||||||
var yynn2 int
|
|
||||||
if yyr2 || yy2arr2 {
|
|
||||||
r.EncodeArrayStart(1)
|
|
||||||
} else {
|
|
||||||
yynn2 = 0
|
|
||||||
for _, b := range yyq2 {
|
|
||||||
if b {
|
|
||||||
yynn2++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
r.EncodeMapStart(yynn2)
|
|
||||||
yynn2 = 0
|
|
||||||
}
|
|
||||||
if yyr2 || yy2arr2 {
|
|
||||||
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
|
||||||
if yyq2[0] {
|
|
||||||
yym4 := z.EncBinary()
|
|
||||||
_ = yym4
|
|
||||||
if false {
|
|
||||||
} else {
|
|
||||||
r.EncodeString(codecSelferC_UTF81234, string(x.Version))
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
r.EncodeString(codecSelferC_UTF81234, "")
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if yyq2[0] {
|
|
||||||
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
|
||||||
r.EncodeString(codecSelferC_UTF81234, string("version"))
|
|
||||||
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
|
||||||
yym5 := z.EncBinary()
|
|
||||||
_ = yym5
|
|
||||||
if false {
|
|
||||||
} else {
|
|
||||||
r.EncodeString(codecSelferC_UTF81234, string(x.Version))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if yyr2 || yy2arr2 {
|
|
||||||
z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
|
|
||||||
} else {
|
|
||||||
z.EncSendContainerState(codecSelfer_containerMapEnd1234)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ClusterMeta) CodecDecodeSelf(d *codec1978.Decoder) {
|
|
||||||
var h codecSelfer1234
|
|
||||||
z, r := codec1978.GenHelperDecoder(d)
|
|
||||||
_, _, _ = h, z, r
|
|
||||||
yym1 := z.DecBinary()
|
|
||||||
_ = yym1
|
|
||||||
if false {
|
|
||||||
} else if z.HasExtensions() && z.DecExt(x) {
|
|
||||||
} else {
|
|
||||||
yyct2 := r.ContainerType()
|
|
||||||
if yyct2 == codecSelferValueTypeMap1234 {
|
|
||||||
yyl2 := r.ReadMapStart()
|
|
||||||
if yyl2 == 0 {
|
|
||||||
z.DecSendContainerState(codecSelfer_containerMapEnd1234)
|
|
||||||
} else {
|
|
||||||
x.codecDecodeSelfFromMap(yyl2, d)
|
|
||||||
}
|
|
||||||
} else if yyct2 == codecSelferValueTypeArray1234 {
|
|
||||||
yyl2 := r.ReadArrayStart()
|
|
||||||
if yyl2 == 0 {
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
|
||||||
} else {
|
|
||||||
x.codecDecodeSelfFromArray(yyl2, d)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ClusterMeta) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
|
|
||||||
var h codecSelfer1234
|
|
||||||
z, r := codec1978.GenHelperDecoder(d)
|
|
||||||
_, _, _ = h, z, r
|
|
||||||
var yys3Slc = z.DecScratchBuffer() // default slice to decode into
|
|
||||||
_ = yys3Slc
|
|
||||||
var yyhl3 bool = l >= 0
|
|
||||||
for yyj3 := 0; ; yyj3++ {
|
|
||||||
if yyhl3 {
|
|
||||||
if yyj3 >= l {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if r.CheckBreak() {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
z.DecSendContainerState(codecSelfer_containerMapKey1234)
|
|
||||||
yys3Slc = r.DecodeBytes(yys3Slc, true, true)
|
|
||||||
yys3 := string(yys3Slc)
|
|
||||||
z.DecSendContainerState(codecSelfer_containerMapValue1234)
|
|
||||||
switch yys3 {
|
|
||||||
case "version":
|
|
||||||
if r.TryDecodeAsNil() {
|
|
||||||
x.Version = ""
|
|
||||||
} else {
|
|
||||||
x.Version = string(r.DecodeString())
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
z.DecStructFieldNotFound(-1, yys3)
|
|
||||||
} // end switch yys3
|
|
||||||
} // end for yyj3
|
|
||||||
z.DecSendContainerState(codecSelfer_containerMapEnd1234)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ClusterMeta) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|
||||||
var h codecSelfer1234
|
|
||||||
z, r := codec1978.GenHelperDecoder(d)
|
|
||||||
_, _, _ = h, z, r
|
|
||||||
var yyj5 int
|
|
||||||
var yyb5 bool
|
|
||||||
var yyhl5 bool = l >= 0
|
|
||||||
yyj5++
|
|
||||||
if yyhl5 {
|
|
||||||
yyb5 = yyj5 > l
|
|
||||||
} else {
|
|
||||||
yyb5 = r.CheckBreak()
|
|
||||||
}
|
|
||||||
if yyb5 {
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
|
||||||
if r.TryDecodeAsNil() {
|
|
||||||
x.Version = ""
|
|
||||||
} else {
|
|
||||||
x.Version = string(r.DecodeString())
|
|
||||||
}
|
|
||||||
for {
|
|
||||||
yyj5++
|
|
||||||
if yyhl5 {
|
|
||||||
yyb5 = yyj5 > l
|
|
||||||
} else {
|
|
||||||
yyb5 = r.CheckBreak()
|
|
||||||
}
|
|
||||||
if yyb5 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
|
||||||
z.DecStructFieldNotFound(yyj5-1, "")
|
|
||||||
}
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) {
|
func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) {
|
||||||
var h codecSelfer1234
|
var h codecSelfer1234
|
||||||
z, r := codec1978.GenHelperEncoder(e)
|
z, r := codec1978.GenHelperEncoder(e)
|
||||||
@ -1168,18 +997,15 @@ func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) {
|
|||||||
} else {
|
} else {
|
||||||
yysep2 := !z.EncBinary()
|
yysep2 := !z.EncBinary()
|
||||||
yy2arr2 := z.EncBasicHandle().StructToArray
|
yy2arr2 := z.EncBasicHandle().StructToArray
|
||||||
var yyq2 [6]bool
|
var yyq2 [3]bool
|
||||||
_, _, _ = yysep2, yyq2, yy2arr2
|
_, _, _ = yysep2, yyq2, yy2arr2
|
||||||
const yyr2 bool = false
|
const yyr2 bool = false
|
||||||
yyq2[0] = len(x.Conditions) != 0
|
yyq2[0] = len(x.Conditions) != 0
|
||||||
yyq2[1] = len(x.Capacity) != 0
|
yyq2[1] = len(x.Zones) != 0
|
||||||
yyq2[2] = len(x.Allocatable) != 0
|
yyq2[2] = x.Region != ""
|
||||||
yyq2[3] = len(x.Zones) != 0
|
|
||||||
yyq2[4] = x.Region != ""
|
|
||||||
yyq2[5] = x.Version != ""
|
|
||||||
var yynn2 int
|
var yynn2 int
|
||||||
if yyr2 || yy2arr2 {
|
if yyr2 || yy2arr2 {
|
||||||
r.EncodeArrayStart(6)
|
r.EncodeArrayStart(3)
|
||||||
} else {
|
} else {
|
||||||
yynn2 = 0
|
yynn2 = 0
|
||||||
for _, b := range yyq2 {
|
for _, b := range yyq2 {
|
||||||
@ -1226,79 +1052,29 @@ func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) {
|
|||||||
if yyr2 || yy2arr2 {
|
if yyr2 || yy2arr2 {
|
||||||
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
||||||
if yyq2[1] {
|
if yyq2[1] {
|
||||||
if x.Capacity == nil {
|
if x.Zones == nil {
|
||||||
r.EncodeNil()
|
r.EncodeNil()
|
||||||
} else {
|
} else {
|
||||||
yysf7 := &x.Capacity
|
yym7 := z.EncBinary()
|
||||||
yysf7.CodecEncodeSelf(e)
|
_ = yym7
|
||||||
|
if false {
|
||||||
|
} else {
|
||||||
|
z.F.EncSliceStringV(x.Zones, false, e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
r.EncodeNil()
|
r.EncodeNil()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if yyq2[1] {
|
if yyq2[1] {
|
||||||
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
|
||||||
r.EncodeString(codecSelferC_UTF81234, string("capacity"))
|
|
||||||
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
|
||||||
if x.Capacity == nil {
|
|
||||||
r.EncodeNil()
|
|
||||||
} else {
|
|
||||||
yysf8 := &x.Capacity
|
|
||||||
yysf8.CodecEncodeSelf(e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if yyr2 || yy2arr2 {
|
|
||||||
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
|
||||||
if yyq2[2] {
|
|
||||||
if x.Allocatable == nil {
|
|
||||||
r.EncodeNil()
|
|
||||||
} else {
|
|
||||||
yysf10 := &x.Allocatable
|
|
||||||
yysf10.CodecEncodeSelf(e)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
r.EncodeNil()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if yyq2[2] {
|
|
||||||
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
|
||||||
r.EncodeString(codecSelferC_UTF81234, string("allocatable"))
|
|
||||||
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
|
||||||
if x.Allocatable == nil {
|
|
||||||
r.EncodeNil()
|
|
||||||
} else {
|
|
||||||
yysf11 := &x.Allocatable
|
|
||||||
yysf11.CodecEncodeSelf(e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if yyr2 || yy2arr2 {
|
|
||||||
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
|
||||||
if yyq2[3] {
|
|
||||||
if x.Zones == nil {
|
|
||||||
r.EncodeNil()
|
|
||||||
} else {
|
|
||||||
yym13 := z.EncBinary()
|
|
||||||
_ = yym13
|
|
||||||
if false {
|
|
||||||
} else {
|
|
||||||
z.F.EncSliceStringV(x.Zones, false, e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
r.EncodeNil()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if yyq2[3] {
|
|
||||||
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
||||||
r.EncodeString(codecSelferC_UTF81234, string("zones"))
|
r.EncodeString(codecSelferC_UTF81234, string("zones"))
|
||||||
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
||||||
if x.Zones == nil {
|
if x.Zones == nil {
|
||||||
r.EncodeNil()
|
r.EncodeNil()
|
||||||
} else {
|
} else {
|
||||||
yym14 := z.EncBinary()
|
yym8 := z.EncBinary()
|
||||||
_ = yym14
|
_ = yym8
|
||||||
if false {
|
if false {
|
||||||
} else {
|
} else {
|
||||||
z.F.EncSliceStringV(x.Zones, false, e)
|
z.F.EncSliceStringV(x.Zones, false, e)
|
||||||
@ -1308,9 +1084,9 @@ func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) {
|
|||||||
}
|
}
|
||||||
if yyr2 || yy2arr2 {
|
if yyr2 || yy2arr2 {
|
||||||
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
||||||
if yyq2[4] {
|
if yyq2[2] {
|
||||||
yym16 := z.EncBinary()
|
yym10 := z.EncBinary()
|
||||||
_ = yym16
|
_ = yym10
|
||||||
if false {
|
if false {
|
||||||
} else {
|
} else {
|
||||||
r.EncodeString(codecSelferC_UTF81234, string(x.Region))
|
r.EncodeString(codecSelferC_UTF81234, string(x.Region))
|
||||||
@ -1319,43 +1095,18 @@ func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) {
|
|||||||
r.EncodeString(codecSelferC_UTF81234, "")
|
r.EncodeString(codecSelferC_UTF81234, "")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if yyq2[4] {
|
if yyq2[2] {
|
||||||
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
||||||
r.EncodeString(codecSelferC_UTF81234, string("region"))
|
r.EncodeString(codecSelferC_UTF81234, string("region"))
|
||||||
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
||||||
yym17 := z.EncBinary()
|
yym11 := z.EncBinary()
|
||||||
_ = yym17
|
_ = yym11
|
||||||
if false {
|
if false {
|
||||||
} else {
|
} else {
|
||||||
r.EncodeString(codecSelferC_UTF81234, string(x.Region))
|
r.EncodeString(codecSelferC_UTF81234, string(x.Region))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if yyr2 || yy2arr2 {
|
|
||||||
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
|
||||||
if yyq2[5] {
|
|
||||||
yym19 := z.EncBinary()
|
|
||||||
_ = yym19
|
|
||||||
if false {
|
|
||||||
} else {
|
|
||||||
r.EncodeString(codecSelferC_UTF81234, string(x.Version))
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
r.EncodeString(codecSelferC_UTF81234, "")
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if yyq2[5] {
|
|
||||||
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
|
||||||
r.EncodeString(codecSelferC_UTF81234, string("version"))
|
|
||||||
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
|
||||||
yym20 := z.EncBinary()
|
|
||||||
_ = yym20
|
|
||||||
if false {
|
|
||||||
} else {
|
|
||||||
r.EncodeString(codecSelferC_UTF81234, string(x.Version))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if yyr2 || yy2arr2 {
|
if yyr2 || yy2arr2 {
|
||||||
z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
} else {
|
} else {
|
||||||
@ -1429,30 +1180,16 @@ func (x *ClusterStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
|
|||||||
h.decSliceClusterCondition((*[]ClusterCondition)(yyv4), d)
|
h.decSliceClusterCondition((*[]ClusterCondition)(yyv4), d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "capacity":
|
|
||||||
if r.TryDecodeAsNil() {
|
|
||||||
x.Capacity = nil
|
|
||||||
} else {
|
|
||||||
yyv6 := &x.Capacity
|
|
||||||
yyv6.CodecDecodeSelf(d)
|
|
||||||
}
|
|
||||||
case "allocatable":
|
|
||||||
if r.TryDecodeAsNil() {
|
|
||||||
x.Allocatable = nil
|
|
||||||
} else {
|
|
||||||
yyv7 := &x.Allocatable
|
|
||||||
yyv7.CodecDecodeSelf(d)
|
|
||||||
}
|
|
||||||
case "zones":
|
case "zones":
|
||||||
if r.TryDecodeAsNil() {
|
if r.TryDecodeAsNil() {
|
||||||
x.Zones = nil
|
x.Zones = nil
|
||||||
} else {
|
} else {
|
||||||
yyv8 := &x.Zones
|
yyv6 := &x.Zones
|
||||||
yym9 := z.DecBinary()
|
yym7 := z.DecBinary()
|
||||||
_ = yym9
|
_ = yym7
|
||||||
if false {
|
if false {
|
||||||
} else {
|
} else {
|
||||||
z.F.DecSliceStringX(yyv8, false, d)
|
z.F.DecSliceStringX(yyv6, false, d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "region":
|
case "region":
|
||||||
@ -1461,12 +1198,6 @@ func (x *ClusterStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
|
|||||||
} else {
|
} else {
|
||||||
x.Region = string(r.DecodeString())
|
x.Region = string(r.DecodeString())
|
||||||
}
|
}
|
||||||
case "version":
|
|
||||||
if r.TryDecodeAsNil() {
|
|
||||||
x.Version = ""
|
|
||||||
} else {
|
|
||||||
x.Version = string(r.DecodeString())
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
z.DecStructFieldNotFound(-1, yys3)
|
z.DecStructFieldNotFound(-1, yys3)
|
||||||
} // end switch yys3
|
} // end switch yys3
|
||||||
@ -1478,16 +1209,16 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|||||||
var h codecSelfer1234
|
var h codecSelfer1234
|
||||||
z, r := codec1978.GenHelperDecoder(d)
|
z, r := codec1978.GenHelperDecoder(d)
|
||||||
_, _, _ = h, z, r
|
_, _, _ = h, z, r
|
||||||
var yyj12 int
|
var yyj9 int
|
||||||
var yyb12 bool
|
var yyb9 bool
|
||||||
var yyhl12 bool = l >= 0
|
var yyhl9 bool = l >= 0
|
||||||
yyj12++
|
yyj9++
|
||||||
if yyhl12 {
|
if yyhl9 {
|
||||||
yyb12 = yyj12 > l
|
yyb9 = yyj9 > l
|
||||||
} else {
|
} else {
|
||||||
yyb12 = r.CheckBreak()
|
yyb9 = r.CheckBreak()
|
||||||
}
|
}
|
||||||
if yyb12 {
|
if yyb9 {
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1495,55 +1226,21 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|||||||
if r.TryDecodeAsNil() {
|
if r.TryDecodeAsNil() {
|
||||||
x.Conditions = nil
|
x.Conditions = nil
|
||||||
} else {
|
} else {
|
||||||
yyv13 := &x.Conditions
|
yyv10 := &x.Conditions
|
||||||
yym14 := z.DecBinary()
|
yym11 := z.DecBinary()
|
||||||
_ = yym14
|
_ = yym11
|
||||||
if false {
|
if false {
|
||||||
} else {
|
} else {
|
||||||
h.decSliceClusterCondition((*[]ClusterCondition)(yyv13), d)
|
h.decSliceClusterCondition((*[]ClusterCondition)(yyv10), d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
yyj12++
|
yyj9++
|
||||||
if yyhl12 {
|
if yyhl9 {
|
||||||
yyb12 = yyj12 > l
|
yyb9 = yyj9 > l
|
||||||
} else {
|
} else {
|
||||||
yyb12 = r.CheckBreak()
|
yyb9 = r.CheckBreak()
|
||||||
}
|
}
|
||||||
if yyb12 {
|
if yyb9 {
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
|
||||||
if r.TryDecodeAsNil() {
|
|
||||||
x.Capacity = nil
|
|
||||||
} else {
|
|
||||||
yyv15 := &x.Capacity
|
|
||||||
yyv15.CodecDecodeSelf(d)
|
|
||||||
}
|
|
||||||
yyj12++
|
|
||||||
if yyhl12 {
|
|
||||||
yyb12 = yyj12 > l
|
|
||||||
} else {
|
|
||||||
yyb12 = r.CheckBreak()
|
|
||||||
}
|
|
||||||
if yyb12 {
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
|
||||||
if r.TryDecodeAsNil() {
|
|
||||||
x.Allocatable = nil
|
|
||||||
} else {
|
|
||||||
yyv16 := &x.Allocatable
|
|
||||||
yyv16.CodecDecodeSelf(d)
|
|
||||||
}
|
|
||||||
yyj12++
|
|
||||||
if yyhl12 {
|
|
||||||
yyb12 = yyj12 > l
|
|
||||||
} else {
|
|
||||||
yyb12 = r.CheckBreak()
|
|
||||||
}
|
|
||||||
if yyb12 {
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1551,21 +1248,21 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|||||||
if r.TryDecodeAsNil() {
|
if r.TryDecodeAsNil() {
|
||||||
x.Zones = nil
|
x.Zones = nil
|
||||||
} else {
|
} else {
|
||||||
yyv17 := &x.Zones
|
yyv12 := &x.Zones
|
||||||
yym18 := z.DecBinary()
|
yym13 := z.DecBinary()
|
||||||
_ = yym18
|
_ = yym13
|
||||||
if false {
|
if false {
|
||||||
} else {
|
} else {
|
||||||
z.F.DecSliceStringX(yyv17, false, d)
|
z.F.DecSliceStringX(yyv12, false, d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
yyj12++
|
yyj9++
|
||||||
if yyhl12 {
|
if yyhl9 {
|
||||||
yyb12 = yyj12 > l
|
yyb9 = yyj9 > l
|
||||||
} else {
|
} else {
|
||||||
yyb12 = r.CheckBreak()
|
yyb9 = r.CheckBreak()
|
||||||
}
|
}
|
||||||
if yyb12 {
|
if yyb9 {
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1575,34 +1272,18 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|||||||
} else {
|
} else {
|
||||||
x.Region = string(r.DecodeString())
|
x.Region = string(r.DecodeString())
|
||||||
}
|
}
|
||||||
yyj12++
|
|
||||||
if yyhl12 {
|
|
||||||
yyb12 = yyj12 > l
|
|
||||||
} else {
|
|
||||||
yyb12 = r.CheckBreak()
|
|
||||||
}
|
|
||||||
if yyb12 {
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
|
||||||
if r.TryDecodeAsNil() {
|
|
||||||
x.Version = ""
|
|
||||||
} else {
|
|
||||||
x.Version = string(r.DecodeString())
|
|
||||||
}
|
|
||||||
for {
|
for {
|
||||||
yyj12++
|
yyj9++
|
||||||
if yyhl12 {
|
if yyhl9 {
|
||||||
yyb12 = yyj12 > l
|
yyb9 = yyj9 > l
|
||||||
} else {
|
} else {
|
||||||
yyb12 = r.CheckBreak()
|
yyb9 = r.CheckBreak()
|
||||||
}
|
}
|
||||||
if yyb12 {
|
if yyb9 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
||||||
z.DecStructFieldNotFound(yyj12-1, "")
|
z.DecStructFieldNotFound(yyj9-1, "")
|
||||||
}
|
}
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
}
|
}
|
||||||
@ -2571,7 +2252,7 @@ func (x codecSelfer1234) decSliceCluster(v *[]Cluster, d *codec1978.Decoder) {
|
|||||||
|
|
||||||
yyrg1 := len(yyv1) > 0
|
yyrg1 := len(yyv1) > 0
|
||||||
yyv21 := yyv1
|
yyv21 := yyv1
|
||||||
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 368)
|
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 336)
|
||||||
if yyrt1 {
|
if yyrt1 {
|
||||||
if yyrl1 <= cap(yyv1) {
|
if yyrl1 <= cap(yyv1) {
|
||||||
yyv1 = yyv1[:yyrl1]
|
yyv1 = yyv1[:yyrl1]
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package v1alpha1
|
package v1beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||||
@ -71,21 +71,10 @@ type ClusterCondition struct {
|
|||||||
Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"`
|
Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cluster metadata
|
|
||||||
type ClusterMeta struct {
|
|
||||||
// Release version of the cluster.
|
|
||||||
Version string `json:"version,omitempty" protobuf:"bytes,1,opt,name=version"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally.
|
// ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally.
|
||||||
type ClusterStatus struct {
|
type ClusterStatus struct {
|
||||||
// Conditions is an array of current cluster conditions.
|
// Conditions is an array of current cluster conditions.
|
||||||
Conditions []ClusterCondition `json:"conditions,omitempty" protobuf:"bytes,1,rep,name=conditions"`
|
Conditions []ClusterCondition `json:"conditions,omitempty" protobuf:"bytes,1,rep,name=conditions"`
|
||||||
// Capacity represents the total resources of the cluster
|
|
||||||
Capacity v1.ResourceList `json:"capacity,omitempty" protobuf:"bytes,2,rep,name=capacity,casttype=k8s.io/kubernetes/pkg/api/v1.ResourceList,castkey=k8s.io/kubernetes/pkg/api/v1.ResourceName"`
|
|
||||||
// Allocatable represents the total resources of a cluster that are available for scheduling.
|
|
||||||
Allocatable v1.ResourceList `json:"allocatable,omitempty" protobuf:"bytes,3,rep,name=allocatable,casttype=k8s.io/kubernetes/pkg/api/v1.ResourceList,castkey=k8s.io/kubernetes/pkg/api/v1.ResourceName"`
|
|
||||||
ClusterMeta `json:",inline" protobuf:"bytes,4,opt,name=clusterMeta"`
|
|
||||||
// Zones is the list of avaliability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'.
|
// Zones is the list of avaliability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'.
|
||||||
// These will always be in the same region.
|
// These will always be in the same region.
|
||||||
Zones []string `json:"zones,omitempty" protobuf:"bytes,5,rep,name=zones"`
|
Zones []string `json:"zones,omitempty" protobuf:"bytes,5,rep,name=zones"`
|
12
federation/client/cache/cluster_cache.go
vendored
12
federation/client/cache/cluster_cache.go
vendored
@ -18,7 +18,7 @@ package cache
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
"k8s.io/kubernetes/federation/apis/federation/v1alpha1"
|
"k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||||
kubeCache "k8s.io/kubernetes/pkg/client/cache"
|
kubeCache "k8s.io/kubernetes/pkg/client/cache"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -28,16 +28,16 @@ type StoreToClusterLister struct {
|
|||||||
kubeCache.Store
|
kubeCache.Store
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *StoreToClusterLister) List() (clusters v1alpha1.ClusterList, err error) {
|
func (s *StoreToClusterLister) List() (clusters v1beta1.ClusterList, err error) {
|
||||||
for _, m := range s.Store.List() {
|
for _, m := range s.Store.List() {
|
||||||
clusters.Items = append(clusters.Items, *(m.(*v1alpha1.Cluster)))
|
clusters.Items = append(clusters.Items, *(m.(*v1beta1.Cluster)))
|
||||||
}
|
}
|
||||||
return clusters, nil
|
return clusters, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClusterConditionPredicate is a function that indicates whether the given cluster's conditions meet
|
// ClusterConditionPredicate is a function that indicates whether the given cluster's conditions meet
|
||||||
// some set of criteria defined by the function.
|
// some set of criteria defined by the function.
|
||||||
type ClusterConditionPredicate func(cluster v1alpha1.Cluster) bool
|
type ClusterConditionPredicate func(cluster v1beta1.Cluster) bool
|
||||||
|
|
||||||
// storeToClusterConditionLister filters and returns nodes matching the given type and status from the store.
|
// storeToClusterConditionLister filters and returns nodes matching the given type and status from the store.
|
||||||
type storeToClusterConditionLister struct {
|
type storeToClusterConditionLister struct {
|
||||||
@ -51,9 +51,9 @@ func (s *StoreToClusterLister) ClusterCondition(predicate ClusterConditionPredic
|
|||||||
}
|
}
|
||||||
|
|
||||||
// List returns a list of clusters that match the conditions defined by the predicate functions in the storeToClusterConditionLister.
|
// List returns a list of clusters that match the conditions defined by the predicate functions in the storeToClusterConditionLister.
|
||||||
func (s storeToClusterConditionLister) List() (clusters v1alpha1.ClusterList, err error) {
|
func (s storeToClusterConditionLister) List() (clusters v1beta1.ClusterList, err error) {
|
||||||
for _, m := range s.store.List() {
|
for _, m := range s.store.List() {
|
||||||
cluster := *m.(*v1alpha1.Cluster)
|
cluster := *m.(*v1beta1.Cluster)
|
||||||
if s.predicate(cluster) {
|
if s.predicate(cluster) {
|
||||||
clusters.Items = append(clusters.Items, cluster)
|
clusters.Items = append(clusters.Items, cluster)
|
||||||
} else {
|
} else {
|
||||||
|
@ -19,7 +19,7 @@ package federation_release_1_3
|
|||||||
import (
|
import (
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
v1core "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3/typed/core/v1"
|
v1core "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3/typed/core/v1"
|
||||||
v1alpha1federation "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3/typed/federation/v1alpha1"
|
v1beta1federation "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3/typed/federation/v1beta1"
|
||||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||||
discovery "k8s.io/kubernetes/pkg/client/typed/discovery"
|
discovery "k8s.io/kubernetes/pkg/client/typed/discovery"
|
||||||
"k8s.io/kubernetes/pkg/util/flowcontrol"
|
"k8s.io/kubernetes/pkg/util/flowcontrol"
|
||||||
@ -27,7 +27,7 @@ import (
|
|||||||
|
|
||||||
type Interface interface {
|
type Interface interface {
|
||||||
Discovery() discovery.DiscoveryInterface
|
Discovery() discovery.DiscoveryInterface
|
||||||
Federation() v1alpha1federation.FederationInterface
|
Federation() v1beta1federation.FederationInterface
|
||||||
Core() v1core.CoreInterface
|
Core() v1core.CoreInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,12 +35,12 @@ type Interface interface {
|
|||||||
// version included in a Clientset.
|
// version included in a Clientset.
|
||||||
type Clientset struct {
|
type Clientset struct {
|
||||||
*discovery.DiscoveryClient
|
*discovery.DiscoveryClient
|
||||||
*v1alpha1federation.FederationClient
|
*v1beta1federation.FederationClient
|
||||||
*v1core.CoreClient
|
*v1core.CoreClient
|
||||||
}
|
}
|
||||||
|
|
||||||
// Federation retrieves the FederationClient
|
// Federation retrieves the FederationClient
|
||||||
func (c *Clientset) Federation() v1alpha1federation.FederationInterface {
|
func (c *Clientset) Federation() v1beta1federation.FederationInterface {
|
||||||
if c == nil {
|
if c == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -68,7 +68,7 @@ func NewForConfig(c *restclient.Config) (*Clientset, error) {
|
|||||||
}
|
}
|
||||||
var clientset Clientset
|
var clientset Clientset
|
||||||
var err error
|
var err error
|
||||||
clientset.FederationClient, err = v1alpha1federation.NewForConfig(&configShallowCopy)
|
clientset.FederationClient, err = v1beta1federation.NewForConfig(&configShallowCopy)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ func NewForConfig(c *restclient.Config) (*Clientset, error) {
|
|||||||
// panics if there is an error in the config.
|
// panics if there is an error in the config.
|
||||||
func NewForConfigOrDie(c *restclient.Config) *Clientset {
|
func NewForConfigOrDie(c *restclient.Config) *Clientset {
|
||||||
var clientset Clientset
|
var clientset Clientset
|
||||||
clientset.FederationClient = v1alpha1federation.NewForConfigOrDie(c)
|
clientset.FederationClient = v1beta1federation.NewForConfigOrDie(c)
|
||||||
clientset.CoreClient = v1core.NewForConfigOrDie(c)
|
clientset.CoreClient = v1core.NewForConfigOrDie(c)
|
||||||
|
|
||||||
clientset.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
|
clientset.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
|
||||||
@ -99,7 +99,7 @@ func NewForConfigOrDie(c *restclient.Config) *Clientset {
|
|||||||
// New creates a new Clientset for the given RESTClient.
|
// New creates a new Clientset for the given RESTClient.
|
||||||
func New(c *restclient.RESTClient) *Clientset {
|
func New(c *restclient.RESTClient) *Clientset {
|
||||||
var clientset Clientset
|
var clientset Clientset
|
||||||
clientset.FederationClient = v1alpha1federation.New(c)
|
clientset.FederationClient = v1beta1federation.New(c)
|
||||||
clientset.CoreClient = v1core.New(c)
|
clientset.CoreClient = v1core.New(c)
|
||||||
|
|
||||||
clientset.DiscoveryClient = discovery.NewDiscoveryClient(c)
|
clientset.DiscoveryClient = discovery.NewDiscoveryClient(c)
|
||||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This package is generated by client-gen with arguments: --clientset-name=federation_release_1_3 --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service] --input=[../../federation/apis/federation/v1alpha1,api/v1]
|
// This package is generated by client-gen with arguments: --clientset-name=federation_release_1_3 --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service] --input=[../../federation/apis/federation/v1beta1,api/v1]
|
||||||
|
|
||||||
// This package has the automatically generated clientset.
|
// This package has the automatically generated clientset.
|
||||||
package federation_release_1_3
|
package federation_release_1_3
|
||||||
|
@ -20,8 +20,8 @@ import (
|
|||||||
clientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3"
|
clientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3"
|
||||||
v1core "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3/typed/core/v1"
|
v1core "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3/typed/core/v1"
|
||||||
fakev1core "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3/typed/core/v1/fake"
|
fakev1core "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3/typed/core/v1/fake"
|
||||||
v1alpha1federation "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3/typed/federation/v1alpha1"
|
v1beta1federation "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3/typed/federation/v1beta1"
|
||||||
fakev1alpha1federation "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3/typed/federation/v1alpha1/fake"
|
fakev1beta1federation "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3/typed/federation/v1beta1/fake"
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||||
"k8s.io/kubernetes/pkg/client/testing/core"
|
"k8s.io/kubernetes/pkg/client/testing/core"
|
||||||
@ -62,8 +62,8 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface {
|
|||||||
var _ clientset.Interface = &Clientset{}
|
var _ clientset.Interface = &Clientset{}
|
||||||
|
|
||||||
// Federation retrieves the FederationClient
|
// Federation retrieves the FederationClient
|
||||||
func (c *Clientset) Federation() v1alpha1federation.FederationInterface {
|
func (c *Clientset) Federation() v1beta1federation.FederationInterface {
|
||||||
return &fakev1alpha1federation.FakeFederation{Fake: &c.Fake}
|
return &fakev1beta1federation.FakeFederation{Fake: &c.Fake}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Core retrieves the CoreClient
|
// Core retrieves the CoreClient
|
||||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This package is generated by client-gen with arguments: --clientset-name=federation_release_1_3 --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service] --input=[../../federation/apis/federation/v1alpha1,api/v1]
|
// This package is generated by client-gen with arguments: --clientset-name=federation_release_1_3 --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service] --input=[../../federation/apis/federation/v1beta1,api/v1]
|
||||||
|
|
||||||
// This package has the automatically generated fake clientset.
|
// This package has the automatically generated fake clientset.
|
||||||
package fake
|
package fake
|
||||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This package is generated by client-gen with arguments: --clientset-name=federation_release_1_3 --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service] --input=[../../federation/apis/federation/v1alpha1,api/v1]
|
// This package is generated by client-gen with arguments: --clientset-name=federation_release_1_3 --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service] --input=[../../federation/apis/federation/v1beta1,api/v1]
|
||||||
|
|
||||||
// This package has the automatically generated typed clients.
|
// This package has the automatically generated typed clients.
|
||||||
package v1
|
package v1
|
||||||
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This package is generated by client-gen with arguments: --clientset-name=federation_release_1_3 --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service] --input=[../../federation/apis/federation/v1alpha1,api/v1]
|
// This package is generated by client-gen with arguments: --clientset-name=federation_release_1_3 --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service] --input=[../../federation/apis/federation/v1beta1,api/v1]
|
||||||
|
|
||||||
// Package fake has the automatically generated clients.
|
// Package fake has the automatically generated clients.
|
||||||
package fake
|
package fake
|
||||||
|
@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package v1alpha1
|
package v1beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
v1alpha1 "k8s.io/kubernetes/federation/apis/federation/v1alpha1"
|
v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||||
api "k8s.io/kubernetes/pkg/api"
|
api "k8s.io/kubernetes/pkg/api"
|
||||||
watch "k8s.io/kubernetes/pkg/watch"
|
watch "k8s.io/kubernetes/pkg/watch"
|
||||||
)
|
)
|
||||||
@ -30,15 +30,15 @@ type ClustersGetter interface {
|
|||||||
|
|
||||||
// ClusterInterface has methods to work with Cluster resources.
|
// ClusterInterface has methods to work with Cluster resources.
|
||||||
type ClusterInterface interface {
|
type ClusterInterface interface {
|
||||||
Create(*v1alpha1.Cluster) (*v1alpha1.Cluster, error)
|
Create(*v1beta1.Cluster) (*v1beta1.Cluster, error)
|
||||||
Update(*v1alpha1.Cluster) (*v1alpha1.Cluster, error)
|
Update(*v1beta1.Cluster) (*v1beta1.Cluster, error)
|
||||||
UpdateStatus(*v1alpha1.Cluster) (*v1alpha1.Cluster, error)
|
UpdateStatus(*v1beta1.Cluster) (*v1beta1.Cluster, error)
|
||||||
Delete(name string, options *api.DeleteOptions) error
|
Delete(name string, options *api.DeleteOptions) error
|
||||||
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
|
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
|
||||||
Get(name string) (*v1alpha1.Cluster, error)
|
Get(name string) (*v1beta1.Cluster, error)
|
||||||
List(opts api.ListOptions) (*v1alpha1.ClusterList, error)
|
List(opts api.ListOptions) (*v1beta1.ClusterList, error)
|
||||||
Watch(opts api.ListOptions) (watch.Interface, error)
|
Watch(opts api.ListOptions) (watch.Interface, error)
|
||||||
Patch(name string, pt api.PatchType, data []byte) (result *v1alpha1.Cluster, err error)
|
Patch(name string, pt api.PatchType, data []byte) (result *v1beta1.Cluster, err error)
|
||||||
ClusterExpansion
|
ClusterExpansion
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,8 +55,8 @@ func newClusters(c *FederationClient) *clusters {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any.
|
// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any.
|
||||||
func (c *clusters) Create(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
|
func (c *clusters) Create(cluster *v1beta1.Cluster) (result *v1beta1.Cluster, err error) {
|
||||||
result = &v1alpha1.Cluster{}
|
result = &v1beta1.Cluster{}
|
||||||
err = c.client.Post().
|
err = c.client.Post().
|
||||||
Resource("clusters").
|
Resource("clusters").
|
||||||
Body(cluster).
|
Body(cluster).
|
||||||
@ -66,8 +66,8 @@ func (c *clusters) Create(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any.
|
// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any.
|
||||||
func (c *clusters) Update(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
|
func (c *clusters) Update(cluster *v1beta1.Cluster) (result *v1beta1.Cluster, err error) {
|
||||||
result = &v1alpha1.Cluster{}
|
result = &v1beta1.Cluster{}
|
||||||
err = c.client.Put().
|
err = c.client.Put().
|
||||||
Resource("clusters").
|
Resource("clusters").
|
||||||
Name(cluster.Name).
|
Name(cluster.Name).
|
||||||
@ -77,8 +77,8 @@ func (c *clusters) Update(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster,
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *clusters) UpdateStatus(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
|
func (c *clusters) UpdateStatus(cluster *v1beta1.Cluster) (result *v1beta1.Cluster, err error) {
|
||||||
result = &v1alpha1.Cluster{}
|
result = &v1beta1.Cluster{}
|
||||||
err = c.client.Put().
|
err = c.client.Put().
|
||||||
Resource("clusters").
|
Resource("clusters").
|
||||||
Name(cluster.Name).
|
Name(cluster.Name).
|
||||||
@ -110,8 +110,8 @@ func (c *clusters) DeleteCollection(options *api.DeleteOptions, listOptions api.
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any.
|
// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any.
|
||||||
func (c *clusters) Get(name string) (result *v1alpha1.Cluster, err error) {
|
func (c *clusters) Get(name string) (result *v1beta1.Cluster, err error) {
|
||||||
result = &v1alpha1.Cluster{}
|
result = &v1beta1.Cluster{}
|
||||||
err = c.client.Get().
|
err = c.client.Get().
|
||||||
Resource("clusters").
|
Resource("clusters").
|
||||||
Name(name).
|
Name(name).
|
||||||
@ -121,8 +121,8 @@ func (c *clusters) Get(name string) (result *v1alpha1.Cluster, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// List takes label and field selectors, and returns the list of Clusters that match those selectors.
|
// List takes label and field selectors, and returns the list of Clusters that match those selectors.
|
||||||
func (c *clusters) List(opts api.ListOptions) (result *v1alpha1.ClusterList, err error) {
|
func (c *clusters) List(opts api.ListOptions) (result *v1beta1.ClusterList, err error) {
|
||||||
result = &v1alpha1.ClusterList{}
|
result = &v1beta1.ClusterList{}
|
||||||
err = c.client.Get().
|
err = c.client.Get().
|
||||||
Resource("clusters").
|
Resource("clusters").
|
||||||
VersionedParams(&opts, api.ParameterCodec).
|
VersionedParams(&opts, api.ParameterCodec).
|
||||||
@ -141,8 +141,8 @@ func (c *clusters) Watch(opts api.ListOptions) (watch.Interface, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Patch applies the patch and returns the patched cluster.
|
// Patch applies the patch and returns the patched cluster.
|
||||||
func (c *clusters) Patch(name string, pt api.PatchType, data []byte) (result *v1alpha1.Cluster, err error) {
|
func (c *clusters) Patch(name string, pt api.PatchType, data []byte) (result *v1beta1.Cluster, err error) {
|
||||||
result = &v1alpha1.Cluster{}
|
result = &v1beta1.Cluster{}
|
||||||
err = c.client.Patch(pt).
|
err = c.client.Patch(pt).
|
||||||
Resource("clusters").
|
Resource("clusters").
|
||||||
Name(name).
|
Name(name).
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This package is generated by client-gen with arguments: --clientset-name=federation_release_1_3 --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service] --input=[../../federation/apis/federation/v1alpha1,api/v1]
|
// This package is generated by client-gen with arguments: --clientset-name=federation_release_1_3 --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service] --input=[../../federation/apis/federation/v1beta1,api/v1]
|
||||||
|
|
||||||
// This package has the automatically generated typed clients.
|
// This package has the automatically generated typed clients.
|
||||||
package v1alpha1
|
package v1beta1
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// This package is generated by client-gen with arguments: --clientset-name=federation_release_1_3 --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service] --input=[../../federation/apis/federation/v1alpha1,api/v1]
|
// This package is generated by client-gen with arguments: --clientset-name=federation_release_1_3 --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service] --input=[../../federation/apis/federation/v1beta1,api/v1]
|
||||||
|
|
||||||
// Package fake has the automatically generated clients.
|
// Package fake has the automatically generated clients.
|
||||||
package fake
|
package fake
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
package fake
|
package fake
|
||||||
|
|
||||||
import (
|
import (
|
||||||
v1alpha1 "k8s.io/kubernetes/federation/apis/federation/v1alpha1"
|
v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||||
api "k8s.io/kubernetes/pkg/api"
|
api "k8s.io/kubernetes/pkg/api"
|
||||||
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
||||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||||
@ -30,60 +30,60 @@ type FakeClusters struct {
|
|||||||
Fake *FakeFederation
|
Fake *FakeFederation
|
||||||
}
|
}
|
||||||
|
|
||||||
var clustersResource = unversioned.GroupVersionResource{Group: "federation", Version: "v1alpha1", Resource: "clusters"}
|
var clustersResource = unversioned.GroupVersionResource{Group: "federation", Version: "v1beta1", Resource: "clusters"}
|
||||||
|
|
||||||
func (c *FakeClusters) Create(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
|
func (c *FakeClusters) Create(cluster *v1beta1.Cluster) (result *v1beta1.Cluster, err error) {
|
||||||
obj, err := c.Fake.
|
obj, err := c.Fake.
|
||||||
Invokes(core.NewRootCreateAction(clustersResource, cluster), &v1alpha1.Cluster{})
|
Invokes(core.NewRootCreateAction(clustersResource, cluster), &v1beta1.Cluster{})
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return obj.(*v1alpha1.Cluster), err
|
return obj.(*v1beta1.Cluster), err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *FakeClusters) Update(cluster *v1alpha1.Cluster) (result *v1alpha1.Cluster, err error) {
|
func (c *FakeClusters) Update(cluster *v1beta1.Cluster) (result *v1beta1.Cluster, err error) {
|
||||||
obj, err := c.Fake.
|
obj, err := c.Fake.
|
||||||
Invokes(core.NewRootUpdateAction(clustersResource, cluster), &v1alpha1.Cluster{})
|
Invokes(core.NewRootUpdateAction(clustersResource, cluster), &v1beta1.Cluster{})
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return obj.(*v1alpha1.Cluster), err
|
return obj.(*v1beta1.Cluster), err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *FakeClusters) UpdateStatus(cluster *v1alpha1.Cluster) (*v1alpha1.Cluster, error) {
|
func (c *FakeClusters) UpdateStatus(cluster *v1beta1.Cluster) (*v1beta1.Cluster, error) {
|
||||||
obj, err := c.Fake.
|
obj, err := c.Fake.
|
||||||
Invokes(core.NewRootUpdateSubresourceAction(clustersResource, "status", cluster), &v1alpha1.Cluster{})
|
Invokes(core.NewRootUpdateSubresourceAction(clustersResource, "status", cluster), &v1beta1.Cluster{})
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return obj.(*v1alpha1.Cluster), err
|
return obj.(*v1beta1.Cluster), err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *FakeClusters) Delete(name string, options *api.DeleteOptions) error {
|
func (c *FakeClusters) Delete(name string, options *api.DeleteOptions) error {
|
||||||
_, err := c.Fake.
|
_, err := c.Fake.
|
||||||
Invokes(core.NewRootDeleteAction(clustersResource, name), &v1alpha1.Cluster{})
|
Invokes(core.NewRootDeleteAction(clustersResource, name), &v1beta1.Cluster{})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *FakeClusters) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
func (c *FakeClusters) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||||
action := core.NewRootDeleteCollectionAction(clustersResource, listOptions)
|
action := core.NewRootDeleteCollectionAction(clustersResource, listOptions)
|
||||||
|
|
||||||
_, err := c.Fake.Invokes(action, &v1alpha1.ClusterList{})
|
_, err := c.Fake.Invokes(action, &v1beta1.ClusterList{})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *FakeClusters) Get(name string) (result *v1alpha1.Cluster, err error) {
|
func (c *FakeClusters) Get(name string) (result *v1beta1.Cluster, err error) {
|
||||||
obj, err := c.Fake.
|
obj, err := c.Fake.
|
||||||
Invokes(core.NewRootGetAction(clustersResource, name), &v1alpha1.Cluster{})
|
Invokes(core.NewRootGetAction(clustersResource, name), &v1beta1.Cluster{})
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return obj.(*v1alpha1.Cluster), err
|
return obj.(*v1beta1.Cluster), err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *FakeClusters) List(opts api.ListOptions) (result *v1alpha1.ClusterList, err error) {
|
func (c *FakeClusters) List(opts api.ListOptions) (result *v1beta1.ClusterList, err error) {
|
||||||
obj, err := c.Fake.
|
obj, err := c.Fake.
|
||||||
Invokes(core.NewRootListAction(clustersResource, opts), &v1alpha1.ClusterList{})
|
Invokes(core.NewRootListAction(clustersResource, opts), &v1beta1.ClusterList{})
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -92,8 +92,8 @@ func (c *FakeClusters) List(opts api.ListOptions) (result *v1alpha1.ClusterList,
|
|||||||
if label == nil {
|
if label == nil {
|
||||||
label = labels.Everything()
|
label = labels.Everything()
|
||||||
}
|
}
|
||||||
list := &v1alpha1.ClusterList{}
|
list := &v1beta1.ClusterList{}
|
||||||
for _, item := range obj.(*v1alpha1.ClusterList).Items {
|
for _, item := range obj.(*v1beta1.ClusterList).Items {
|
||||||
if label.Matches(labels.Set(item.Labels)) {
|
if label.Matches(labels.Set(item.Labels)) {
|
||||||
list.Items = append(list.Items, item)
|
list.Items = append(list.Items, item)
|
||||||
}
|
}
|
||||||
@ -108,11 +108,11 @@ func (c *FakeClusters) Watch(opts api.ListOptions) (watch.Interface, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Patch applies the patch and returns the patched cluster.
|
// Patch applies the patch and returns the patched cluster.
|
||||||
func (c *FakeClusters) Patch(name string, pt api.PatchType, data []byte) (result *v1alpha1.Cluster, err error) {
|
func (c *FakeClusters) Patch(name string, pt api.PatchType, data []byte) (result *v1beta1.Cluster, err error) {
|
||||||
obj, err := c.Fake.
|
obj, err := c.Fake.
|
||||||
Invokes(core.NewRootPatchAction(clustersResource, name, data), &v1alpha1.Cluster{})
|
Invokes(core.NewRootPatchAction(clustersResource, name, data), &v1beta1.Cluster{})
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return obj.(*v1alpha1.Cluster), err
|
return obj.(*v1beta1.Cluster), err
|
||||||
}
|
}
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
package fake
|
package fake
|
||||||
|
|
||||||
import (
|
import (
|
||||||
v1alpha1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3/typed/federation/v1alpha1"
|
v1beta1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3/typed/federation/v1beta1"
|
||||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||||
)
|
)
|
||||||
@ -26,7 +26,7 @@ type FakeFederation struct {
|
|||||||
*core.Fake
|
*core.Fake
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *FakeFederation) Clusters() v1alpha1.ClusterInterface {
|
func (c *FakeFederation) Clusters() v1beta1.ClusterInterface {
|
||||||
return &FakeClusters{c}
|
return &FakeClusters{c}
|
||||||
}
|
}
|
||||||
|
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package v1alpha1
|
package v1beta1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
api "k8s.io/kubernetes/pkg/api"
|
api "k8s.io/kubernetes/pkg/api"
|
@ -14,6 +14,6 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package v1alpha1
|
package v1beta1
|
||||||
|
|
||||||
type ClusterExpansion interface{}
|
type ClusterExpansion interface{}
|
@ -40,7 +40,7 @@ func installFederationAPIs(s *genericoptions.ServerRunOptions, g *genericapiserv
|
|||||||
apiGroupInfo := genericapiserver.APIGroupInfo{
|
apiGroupInfo := genericapiserver.APIGroupInfo{
|
||||||
GroupMeta: *federationGroupMeta,
|
GroupMeta: *federationGroupMeta,
|
||||||
VersionedResourcesStorageMap: map[string]map[string]rest.Storage{
|
VersionedResourcesStorageMap: map[string]map[string]rest.Storage{
|
||||||
"v1alpha1": federationResources,
|
"v1beta1": federationResources,
|
||||||
},
|
},
|
||||||
OptionsExternalVersion: ®istered.GroupOrDie(api.GroupName).GroupVersion,
|
OptionsExternalVersion: ®istered.GroupOrDie(api.GroupName).GroupVersion,
|
||||||
Scheme: api.Scheme,
|
Scheme: api.Scheme,
|
||||||
|
@ -28,7 +28,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
fed_v1a1 "k8s.io/kubernetes/federation/apis/federation/v1alpha1"
|
fed_v1a1 "k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||||
"k8s.io/kubernetes/pkg/api/v1"
|
"k8s.io/kubernetes/pkg/api/v1"
|
||||||
"k8s.io/kubernetes/pkg/genericapiserver/options"
|
"k8s.io/kubernetes/pkg/genericapiserver/options"
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
federation_v1alpha1 "k8s.io/kubernetes/federation/apis/federation/v1alpha1"
|
federation_v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||||
"k8s.io/kubernetes/federation/pkg/federation-controller/util"
|
"k8s.io/kubernetes/federation/pkg/federation-controller/util"
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||||
@ -44,7 +44,7 @@ type ClusterClient struct {
|
|||||||
kubeClient *clientset.Clientset
|
kubeClient *clientset.Clientset
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewClusterClientSet(c *federation_v1alpha1.Cluster) (*ClusterClient, error) {
|
func NewClusterClientSet(c *federation_v1beta1.Cluster) (*ClusterClient, error) {
|
||||||
clusterConfig, err := util.BuildClusterConfig(c)
|
clusterConfig, err := util.BuildClusterConfig(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -64,35 +64,35 @@ func NewClusterClientSet(c *federation_v1alpha1.Cluster) (*ClusterClient, error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetClusterHealthStatus gets the kubernetes cluster health status by requesting "/healthz"
|
// GetClusterHealthStatus gets the kubernetes cluster health status by requesting "/healthz"
|
||||||
func (self *ClusterClient) GetClusterHealthStatus() *federation_v1alpha1.ClusterStatus {
|
func (self *ClusterClient) GetClusterHealthStatus() *federation_v1beta1.ClusterStatus {
|
||||||
clusterStatus := federation_v1alpha1.ClusterStatus{}
|
clusterStatus := federation_v1beta1.ClusterStatus{}
|
||||||
currentTime := unversioned.Now()
|
currentTime := unversioned.Now()
|
||||||
newClusterReadyCondition := federation_v1alpha1.ClusterCondition{
|
newClusterReadyCondition := federation_v1beta1.ClusterCondition{
|
||||||
Type: federation_v1alpha1.ClusterReady,
|
Type: federation_v1beta1.ClusterReady,
|
||||||
Status: v1.ConditionTrue,
|
Status: v1.ConditionTrue,
|
||||||
Reason: "ClusterReady",
|
Reason: "ClusterReady",
|
||||||
Message: "/healthz responded with ok",
|
Message: "/healthz responded with ok",
|
||||||
LastProbeTime: currentTime,
|
LastProbeTime: currentTime,
|
||||||
LastTransitionTime: currentTime,
|
LastTransitionTime: currentTime,
|
||||||
}
|
}
|
||||||
newClusterNotReadyCondition := federation_v1alpha1.ClusterCondition{
|
newClusterNotReadyCondition := federation_v1beta1.ClusterCondition{
|
||||||
Type: federation_v1alpha1.ClusterReady,
|
Type: federation_v1beta1.ClusterReady,
|
||||||
Status: v1.ConditionFalse,
|
Status: v1.ConditionFalse,
|
||||||
Reason: "ClusterNotReady",
|
Reason: "ClusterNotReady",
|
||||||
Message: "/healthz responded without ok",
|
Message: "/healthz responded without ok",
|
||||||
LastProbeTime: currentTime,
|
LastProbeTime: currentTime,
|
||||||
LastTransitionTime: currentTime,
|
LastTransitionTime: currentTime,
|
||||||
}
|
}
|
||||||
newNodeOfflineCondition := federation_v1alpha1.ClusterCondition{
|
newNodeOfflineCondition := federation_v1beta1.ClusterCondition{
|
||||||
Type: federation_v1alpha1.ClusterOffline,
|
Type: federation_v1beta1.ClusterOffline,
|
||||||
Status: v1.ConditionTrue,
|
Status: v1.ConditionTrue,
|
||||||
Reason: "ClusterNotReachable",
|
Reason: "ClusterNotReachable",
|
||||||
Message: "cluster is not reachable",
|
Message: "cluster is not reachable",
|
||||||
LastProbeTime: currentTime,
|
LastProbeTime: currentTime,
|
||||||
LastTransitionTime: currentTime,
|
LastTransitionTime: currentTime,
|
||||||
}
|
}
|
||||||
newNodeNotOfflineCondition := federation_v1alpha1.ClusterCondition{
|
newNodeNotOfflineCondition := federation_v1beta1.ClusterCondition{
|
||||||
Type: federation_v1alpha1.ClusterOffline,
|
Type: federation_v1beta1.ClusterOffline,
|
||||||
Status: v1.ConditionFalse,
|
Status: v1.ConditionFalse,
|
||||||
Reason: "ClusterReachable",
|
Reason: "ClusterReachable",
|
||||||
Message: "cluster is reachable",
|
Message: "cluster is reachable",
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
federation_v1alpha1 "k8s.io/kubernetes/federation/apis/federation/v1alpha1"
|
federation_v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||||
cluster_cache "k8s.io/kubernetes/federation/client/cache"
|
cluster_cache "k8s.io/kubernetes/federation/client/cache"
|
||||||
federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3"
|
federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3"
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
@ -44,7 +44,7 @@ type ClusterController struct {
|
|||||||
// clusterMonitorPeriod is the period for updating status of cluster
|
// clusterMonitorPeriod is the period for updating status of cluster
|
||||||
clusterMonitorPeriod time.Duration
|
clusterMonitorPeriod time.Duration
|
||||||
// clusterClusterStatusMap is a mapping of clusterName and cluster status of last sampling
|
// clusterClusterStatusMap is a mapping of clusterName and cluster status of last sampling
|
||||||
clusterClusterStatusMap map[string]federation_v1alpha1.ClusterStatus
|
clusterClusterStatusMap map[string]federation_v1beta1.ClusterStatus
|
||||||
|
|
||||||
// clusterKubeClientMap is a mapping of clusterName and restclient
|
// clusterKubeClientMap is a mapping of clusterName and restclient
|
||||||
clusterKubeClientMap map[string]ClusterClient
|
clusterKubeClientMap map[string]ClusterClient
|
||||||
@ -60,7 +60,7 @@ func NewclusterController(federationClient federationclientset.Interface, cluste
|
|||||||
knownClusterSet: make(sets.String),
|
knownClusterSet: make(sets.String),
|
||||||
federationClient: federationClient,
|
federationClient: federationClient,
|
||||||
clusterMonitorPeriod: clusterMonitorPeriod,
|
clusterMonitorPeriod: clusterMonitorPeriod,
|
||||||
clusterClusterStatusMap: make(map[string]federation_v1alpha1.ClusterStatus),
|
clusterClusterStatusMap: make(map[string]federation_v1beta1.ClusterStatus),
|
||||||
clusterKubeClientMap: make(map[string]ClusterClient),
|
clusterKubeClientMap: make(map[string]ClusterClient),
|
||||||
}
|
}
|
||||||
cc.clusterStore.Store, cc.clusterController = framework.NewInformer(
|
cc.clusterStore.Store, cc.clusterController = framework.NewInformer(
|
||||||
@ -72,7 +72,7 @@ func NewclusterController(federationClient federationclientset.Interface, cluste
|
|||||||
return cc.federationClient.Federation().Clusters().Watch(options)
|
return cc.federationClient.Federation().Clusters().Watch(options)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&federation_v1alpha1.Cluster{},
|
&federation_v1beta1.Cluster{},
|
||||||
controller.NoResyncPeriodFunc(),
|
controller.NoResyncPeriodFunc(),
|
||||||
framework.ResourceEventHandlerFuncs{
|
framework.ResourceEventHandlerFuncs{
|
||||||
DeleteFunc: cc.delFromClusterSet,
|
DeleteFunc: cc.delFromClusterSet,
|
||||||
@ -85,7 +85,7 @@ func NewclusterController(federationClient federationclientset.Interface, cluste
|
|||||||
// delFromClusterSet delete a cluster from clusterSet and
|
// delFromClusterSet delete a cluster from clusterSet and
|
||||||
// delete the corresponding restclient from the map clusterKubeClientMap
|
// delete the corresponding restclient from the map clusterKubeClientMap
|
||||||
func (cc *ClusterController) delFromClusterSet(obj interface{}) {
|
func (cc *ClusterController) delFromClusterSet(obj interface{}) {
|
||||||
cluster := obj.(*federation_v1alpha1.Cluster)
|
cluster := obj.(*federation_v1beta1.Cluster)
|
||||||
cc.knownClusterSet.Delete(cluster.Name)
|
cc.knownClusterSet.Delete(cluster.Name)
|
||||||
delete(cc.clusterKubeClientMap, cluster.Name)
|
delete(cc.clusterKubeClientMap, cluster.Name)
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ func (cc *ClusterController) delFromClusterSet(obj interface{}) {
|
|||||||
// addToClusterSet insert the new cluster to clusterSet and create a corresponding
|
// addToClusterSet insert the new cluster to clusterSet and create a corresponding
|
||||||
// restclient to map clusterKubeClientMap
|
// restclient to map clusterKubeClientMap
|
||||||
func (cc *ClusterController) addToClusterSet(obj interface{}) {
|
func (cc *ClusterController) addToClusterSet(obj interface{}) {
|
||||||
cluster := obj.(*federation_v1alpha1.Cluster)
|
cluster := obj.(*federation_v1beta1.Cluster)
|
||||||
cc.knownClusterSet.Insert(cluster.Name)
|
cc.knownClusterSet.Insert(cluster.Name)
|
||||||
// create the restclient of cluster
|
// create the restclient of cluster
|
||||||
restClient, err := NewClusterClientSet(cluster)
|
restClient, err := NewClusterClientSet(cluster)
|
||||||
@ -116,7 +116,7 @@ func (cc *ClusterController) Run() {
|
|||||||
}, cc.clusterMonitorPeriod, wait.NeverStop)
|
}, cc.clusterMonitorPeriod, wait.NeverStop)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cc *ClusterController) GetClusterStatus(cluster *federation_v1alpha1.Cluster) (*federation_v1alpha1.ClusterStatus, error) {
|
func (cc *ClusterController) GetClusterStatus(cluster *federation_v1beta1.Cluster) (*federation_v1beta1.ClusterStatus, error) {
|
||||||
// just get the status of cluster, by requesting the restapi "/healthz"
|
// just get the status of cluster, by requesting the restapi "/healthz"
|
||||||
clusterClient, found := cc.clusterKubeClientMap[cluster.Name]
|
clusterClient, found := cc.clusterKubeClientMap[cluster.Name]
|
||||||
if !found {
|
if !found {
|
||||||
|
@ -23,7 +23,7 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
federation_v1alpha1 "k8s.io/kubernetes/federation/apis/federation/v1alpha1"
|
federation_v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||||
federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3"
|
federationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3"
|
||||||
controller_util "k8s.io/kubernetes/federation/pkg/federation-controller/util"
|
controller_util "k8s.io/kubernetes/federation/pkg/federation-controller/util"
|
||||||
"k8s.io/kubernetes/pkg/api/testapi"
|
"k8s.io/kubernetes/pkg/api/testapi"
|
||||||
@ -35,15 +35,15 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/util"
|
"k8s.io/kubernetes/pkg/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func newCluster(clusterName string, serverUrl string) *federation_v1alpha1.Cluster {
|
func newCluster(clusterName string, serverUrl string) *federation_v1beta1.Cluster {
|
||||||
cluster := federation_v1alpha1.Cluster{
|
cluster := federation_v1beta1.Cluster{
|
||||||
TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Federation.GroupVersion().String()},
|
TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Federation.GroupVersion().String()},
|
||||||
ObjectMeta: v1.ObjectMeta{
|
ObjectMeta: v1.ObjectMeta{
|
||||||
UID: util.NewUUID(),
|
UID: util.NewUUID(),
|
||||||
Name: clusterName,
|
Name: clusterName,
|
||||||
},
|
},
|
||||||
Spec: federation_v1alpha1.ClusterSpec{
|
Spec: federation_v1beta1.ClusterSpec{
|
||||||
ServerAddressByClientCIDRs: []federation_v1alpha1.ServerAddressByClientCIDR{
|
ServerAddressByClientCIDRs: []federation_v1beta1.ServerAddressByClientCIDR{
|
||||||
{
|
{
|
||||||
ClientCIDR: "0.0.0.0/0",
|
ClientCIDR: "0.0.0.0/0",
|
||||||
ServerAddress: serverUrl,
|
ServerAddress: serverUrl,
|
||||||
@ -54,13 +54,13 @@ func newCluster(clusterName string, serverUrl string) *federation_v1alpha1.Clust
|
|||||||
return &cluster
|
return &cluster
|
||||||
}
|
}
|
||||||
|
|
||||||
func newClusterList(cluster *federation_v1alpha1.Cluster) *federation_v1alpha1.ClusterList {
|
func newClusterList(cluster *federation_v1beta1.Cluster) *federation_v1beta1.ClusterList {
|
||||||
clusterList := federation_v1alpha1.ClusterList{
|
clusterList := federation_v1beta1.ClusterList{
|
||||||
TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Federation.GroupVersion().String()},
|
TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Federation.GroupVersion().String()},
|
||||||
ListMeta: unversioned.ListMeta{
|
ListMeta: unversioned.ListMeta{
|
||||||
SelfLink: "foobar",
|
SelfLink: "foobar",
|
||||||
},
|
},
|
||||||
Items: []federation_v1alpha1.Cluster{},
|
Items: []federation_v1beta1.Cluster{},
|
||||||
}
|
}
|
||||||
clusterList.Items = append(clusterList.Items, *cluster)
|
clusterList.Items = append(clusterList.Items, *cluster)
|
||||||
return &clusterList
|
return &clusterList
|
||||||
@ -68,7 +68,7 @@ func newClusterList(cluster *federation_v1alpha1.Cluster) *federation_v1alpha1.C
|
|||||||
|
|
||||||
// init a fake http handler, simulate a federation apiserver, response the "DELETE" "PUT" "GET" "UPDATE"
|
// init a fake http handler, simulate a federation apiserver, response the "DELETE" "PUT" "GET" "UPDATE"
|
||||||
// when "canBeGotten" is false, means that user can not get the cluster cluster from apiserver
|
// when "canBeGotten" is false, means that user can not get the cluster cluster from apiserver
|
||||||
func createHttptestFakeHandlerForFederation(clusterList *federation_v1alpha1.ClusterList, canBeGotten bool) *http.HandlerFunc {
|
func createHttptestFakeHandlerForFederation(clusterList *federation_v1beta1.ClusterList, canBeGotten bool) *http.HandlerFunc {
|
||||||
fakeHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
fakeHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
clusterListString, _ := json.Marshal(*clusterList)
|
clusterListString, _ := json.Marshal(*clusterList)
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
@ -126,7 +126,7 @@ func TestUpdateClusterStatusOK(t *testing.T) {
|
|||||||
|
|
||||||
// Override KubeconfigGetterForCluster to avoid having to setup service accounts and mount files with secret tokens.
|
// Override KubeconfigGetterForCluster to avoid having to setup service accounts and mount files with secret tokens.
|
||||||
originalGetter := controller_util.KubeconfigGetterForCluster
|
originalGetter := controller_util.KubeconfigGetterForCluster
|
||||||
controller_util.KubeconfigGetterForCluster = func(c *federation_v1alpha1.Cluster) clientcmd.KubeconfigGetter {
|
controller_util.KubeconfigGetterForCluster = func(c *federation_v1beta1.Cluster) clientcmd.KubeconfigGetter {
|
||||||
return func() (*clientcmdapi.Config, error) {
|
return func() (*clientcmdapi.Config, error) {
|
||||||
return &clientcmdapi.Config{}, nil
|
return &clientcmdapi.Config{}, nil
|
||||||
}
|
}
|
||||||
@ -141,7 +141,7 @@ func TestUpdateClusterStatusOK(t *testing.T) {
|
|||||||
if !found {
|
if !found {
|
||||||
t.Errorf("Failed to Update Cluster Status")
|
t.Errorf("Failed to Update Cluster Status")
|
||||||
} else {
|
} else {
|
||||||
if (clusterStatus.Conditions[1].Status != v1.ConditionFalse) || (clusterStatus.Conditions[1].Type != federation_v1alpha1.ClusterOffline) {
|
if (clusterStatus.Conditions[1].Status != v1.ConditionFalse) || (clusterStatus.Conditions[1].Type != federation_v1beta1.ClusterOffline) {
|
||||||
t.Errorf("Failed to Update Cluster Status")
|
t.Errorf("Failed to Update Cluster Status")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ package service
|
|||||||
import (
|
import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
v1alpha1 "k8s.io/kubernetes/federation/apis/federation/v1alpha1"
|
v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
v1 "k8s.io/kubernetes/pkg/api/v1"
|
v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||||
cache "k8s.io/kubernetes/pkg/client/cache"
|
cache "k8s.io/kubernetes/pkg/client/cache"
|
||||||
@ -38,7 +38,7 @@ import (
|
|||||||
|
|
||||||
type clusterCache struct {
|
type clusterCache struct {
|
||||||
clientset *release_1_3.Clientset
|
clientset *release_1_3.Clientset
|
||||||
cluster *v1alpha1.Cluster
|
cluster *v1beta1.Cluster
|
||||||
// A store of services, populated by the serviceController
|
// A store of services, populated by the serviceController
|
||||||
serviceStore cache.StoreToServiceLister
|
serviceStore cache.StoreToServiceLister
|
||||||
// Watches changes to all services
|
// Watches changes to all services
|
||||||
@ -58,7 +58,7 @@ type clusterClientCache struct {
|
|||||||
clientMap map[string]*clusterCache
|
clientMap map[string]*clusterCache
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cc *clusterClientCache) startClusterLW(cluster *v1alpha1.Cluster, clusterName string) {
|
func (cc *clusterClientCache) startClusterLW(cluster *v1beta1.Cluster, clusterName string) {
|
||||||
cachedClusterClient, ok := cc.clientMap[clusterName]
|
cachedClusterClient, ok := cc.clientMap[clusterName]
|
||||||
// only create when no existing cachedClusterClient
|
// only create when no existing cachedClusterClient
|
||||||
if ok {
|
if ok {
|
||||||
@ -162,7 +162,7 @@ func (cc *clusterClientCache) startClusterLW(cluster *v1alpha1.Cluster, clusterN
|
|||||||
// delFromClusterSet delete a cluster from clusterSet and
|
// delFromClusterSet delete a cluster from clusterSet and
|
||||||
// delete the corresponding restclient from the map clusterKubeClientMap
|
// delete the corresponding restclient from the map clusterKubeClientMap
|
||||||
func (cc *clusterClientCache) delFromClusterSet(obj interface{}) {
|
func (cc *clusterClientCache) delFromClusterSet(obj interface{}) {
|
||||||
cluster, ok := obj.(*v1alpha1.Cluster)
|
cluster, ok := obj.(*v1beta1.Cluster)
|
||||||
cc.rwlock.Lock()
|
cc.rwlock.Lock()
|
||||||
defer cc.rwlock.Unlock()
|
defer cc.rwlock.Unlock()
|
||||||
if ok {
|
if ok {
|
||||||
@ -181,10 +181,10 @@ func (cc *clusterClientCache) delFromClusterSet(obj interface{}) {
|
|||||||
// addToClusterSet inserts the new cluster to clusterSet and creates a corresponding
|
// addToClusterSet inserts the new cluster to clusterSet and creates a corresponding
|
||||||
// restclient to map clusterKubeClientMap
|
// restclient to map clusterKubeClientMap
|
||||||
func (cc *clusterClientCache) addToClientMap(obj interface{}) {
|
func (cc *clusterClientCache) addToClientMap(obj interface{}) {
|
||||||
cluster := obj.(*v1alpha1.Cluster)
|
cluster := obj.(*v1beta1.Cluster)
|
||||||
cc.rwlock.Lock()
|
cc.rwlock.Lock()
|
||||||
defer cc.rwlock.Unlock()
|
defer cc.rwlock.Unlock()
|
||||||
cluster, ok := obj.(*v1alpha1.Cluster)
|
cluster, ok := obj.(*v1beta1.Cluster)
|
||||||
if !ok {
|
if !ok {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -196,7 +196,7 @@ func (cc *clusterClientCache) addToClientMap(obj interface{}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func newClusterClientset(c *v1alpha1.Cluster) (*release_1_3.Clientset, error) {
|
func newClusterClientset(c *v1beta1.Cluster) (*release_1_3.Clientset, error) {
|
||||||
clusterConfig, err := util.BuildClusterConfig(c)
|
clusterConfig, err := util.BuildClusterConfig(c)
|
||||||
if clusterConfig != nil {
|
if clusterConfig != nil {
|
||||||
clientset := release_1_3.NewForConfigOrDie(restclient.AddUserAgent(clusterConfig, UserAgentName))
|
clientset := release_1_3.NewForConfigOrDie(restclient.AddUserAgent(clusterConfig, UserAgentName))
|
||||||
|
@ -19,7 +19,7 @@ package service
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"k8s.io/kubernetes/federation/apis/federation/v1alpha1"
|
"k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||||
"k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns" // Only for unit testing purposes.
|
"k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns" // Only for unit testing purposes.
|
||||||
v1 "k8s.io/kubernetes/pkg/api/v1"
|
v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||||
"k8s.io/kubernetes/pkg/util/sets"
|
"k8s.io/kubernetes/pkg/util/sets"
|
||||||
@ -58,8 +58,8 @@ func TestProcessEndpointUpdate(t *testing.T) {
|
|||||||
cc := clusterClientCache{
|
cc := clusterClientCache{
|
||||||
clientMap: map[string]*clusterCache{
|
clientMap: map[string]*clusterCache{
|
||||||
clusterName: {
|
clusterName: {
|
||||||
cluster: &v1alpha1.Cluster{
|
cluster: &v1beta1.Cluster{
|
||||||
Status: v1alpha1.ClusterStatus{
|
Status: v1beta1.ClusterStatus{
|
||||||
Zones: []string{"foozone"},
|
Zones: []string{"foozone"},
|
||||||
Region: "fooregion",
|
Region: "fooregion",
|
||||||
},
|
},
|
||||||
@ -111,8 +111,8 @@ func TestProcessEndpointDeletion(t *testing.T) {
|
|||||||
cc := clusterClientCache{
|
cc := clusterClientCache{
|
||||||
clientMap: map[string]*clusterCache{
|
clientMap: map[string]*clusterCache{
|
||||||
clusterName: {
|
clusterName: {
|
||||||
cluster: &v1alpha1.Cluster{
|
cluster: &v1beta1.Cluster{
|
||||||
Status: v1alpha1.ClusterStatus{
|
Status: v1beta1.ClusterStatus{
|
||||||
Zones: []string{"foozone"},
|
Zones: []string{"foozone"},
|
||||||
Region: "fooregion",
|
Region: "fooregion",
|
||||||
},
|
},
|
||||||
|
@ -24,7 +24,7 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
v1alpha1 "k8s.io/kubernetes/federation/apis/federation/v1alpha1"
|
v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||||
federationcache "k8s.io/kubernetes/federation/client/cache"
|
federationcache "k8s.io/kubernetes/federation/client/cache"
|
||||||
federation_release_1_3 "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3"
|
federation_release_1_3 "k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_3"
|
||||||
"k8s.io/kubernetes/federation/pkg/dnsprovider"
|
"k8s.io/kubernetes/federation/pkg/dnsprovider"
|
||||||
@ -176,17 +176,17 @@ func New(federationClient federation_release_1_3.Interface, dns dnsprovider.Inte
|
|||||||
return s.federationClient.Federation().Clusters().Watch(options)
|
return s.federationClient.Federation().Clusters().Watch(options)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&v1alpha1.Cluster{},
|
&v1beta1.Cluster{},
|
||||||
clusterSyncPeriod,
|
clusterSyncPeriod,
|
||||||
framework.ResourceEventHandlerFuncs{
|
framework.ResourceEventHandlerFuncs{
|
||||||
DeleteFunc: s.clusterCache.delFromClusterSet,
|
DeleteFunc: s.clusterCache.delFromClusterSet,
|
||||||
AddFunc: s.clusterCache.addToClientMap,
|
AddFunc: s.clusterCache.addToClientMap,
|
||||||
UpdateFunc: func(old, cur interface{}) {
|
UpdateFunc: func(old, cur interface{}) {
|
||||||
oldCluster, ok := old.(*v1alpha1.Cluster)
|
oldCluster, ok := old.(*v1beta1.Cluster)
|
||||||
if !ok {
|
if !ok {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
curCluster, ok := cur.(*v1alpha1.Cluster)
|
curCluster, ok := cur.(*v1beta1.Cluster)
|
||||||
if !ok {
|
if !ok {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -608,7 +608,7 @@ func portEqualExcludeNodePort(x, y *v1.ServicePort) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func clustersFromList(list *v1alpha1.ClusterList) []string {
|
func clustersFromList(list *v1beta1.ClusterList) []string {
|
||||||
result := []string{}
|
result := []string{}
|
||||||
for ix := range list.Items {
|
for ix := range list.Items {
|
||||||
result = append(result, list.Items[ix].Name)
|
result = append(result, list.Items[ix].Name)
|
||||||
@ -619,7 +619,7 @@ func clustersFromList(list *v1alpha1.ClusterList) []string {
|
|||||||
// getClusterConditionPredicate filter all clusters meet condition of
|
// getClusterConditionPredicate filter all clusters meet condition of
|
||||||
// condition.type=Ready and condition.status=true
|
// condition.type=Ready and condition.status=true
|
||||||
func getClusterConditionPredicate() federationcache.ClusterConditionPredicate {
|
func getClusterConditionPredicate() federationcache.ClusterConditionPredicate {
|
||||||
return func(cluster v1alpha1.Cluster) bool {
|
return func(cluster v1beta1.Cluster) bool {
|
||||||
// If we have no info, don't accept
|
// If we have no info, don't accept
|
||||||
if len(cluster.Status.Conditions) == 0 {
|
if len(cluster.Status.Conditions) == 0 {
|
||||||
return false
|
return false
|
||||||
@ -627,7 +627,7 @@ func getClusterConditionPredicate() federationcache.ClusterConditionPredicate {
|
|||||||
for _, cond := range cluster.Status.Conditions {
|
for _, cond := range cluster.Status.Conditions {
|
||||||
//We consider the cluster for load balancing only when its ClusterReady condition status
|
//We consider the cluster for load balancing only when its ClusterReady condition status
|
||||||
//is ConditionTrue
|
//is ConditionTrue
|
||||||
if cond.Type == v1alpha1.ClusterReady && cond.Status != v1.ConditionTrue {
|
if cond.Type == v1beta1.ClusterReady && cond.Status != v1.ConditionTrue {
|
||||||
glog.V(4).Infof("Ignoring cluser %v with %v condition status %v", cluster.Name, cond.Type, cond.Status)
|
glog.V(4).Infof("Ignoring cluser %v with %v condition status %v", cluster.Name, cond.Type, cond.Status)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"k8s.io/kubernetes/federation/apis/federation/v1alpha1"
|
"k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||||
"k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns" // Only for unit testing purposes.
|
"k8s.io/kubernetes/federation/pkg/dnsprovider/providers/google/clouddns" // Only for unit testing purposes.
|
||||||
"k8s.io/kubernetes/pkg/api/v1"
|
"k8s.io/kubernetes/pkg/api/v1"
|
||||||
"k8s.io/kubernetes/pkg/util/sets"
|
"k8s.io/kubernetes/pkg/util/sets"
|
||||||
@ -39,22 +39,22 @@ func TestGetClusterConditionPredicate(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
cluster v1alpha1.Cluster
|
cluster v1beta1.Cluster
|
||||||
expectAccept bool
|
expectAccept bool
|
||||||
name string
|
name string
|
||||||
serviceController *ServiceController
|
serviceController *ServiceController
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
cluster: v1alpha1.Cluster{},
|
cluster: v1beta1.Cluster{},
|
||||||
expectAccept: false,
|
expectAccept: false,
|
||||||
name: "empty",
|
name: "empty",
|
||||||
serviceController: &serviceController,
|
serviceController: &serviceController,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
cluster: v1alpha1.Cluster{
|
cluster: v1beta1.Cluster{
|
||||||
Status: v1alpha1.ClusterStatus{
|
Status: v1beta1.ClusterStatus{
|
||||||
Conditions: []v1alpha1.ClusterCondition{
|
Conditions: []v1beta1.ClusterCondition{
|
||||||
{Type: v1alpha1.ClusterReady, Status: v1.ConditionTrue},
|
{Type: v1beta1.ClusterReady, Status: v1.ConditionTrue},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -63,10 +63,10 @@ func TestGetClusterConditionPredicate(t *testing.T) {
|
|||||||
serviceController: &serviceController,
|
serviceController: &serviceController,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
cluster: v1alpha1.Cluster{
|
cluster: v1beta1.Cluster{
|
||||||
Status: v1alpha1.ClusterStatus{
|
Status: v1beta1.ClusterStatus{
|
||||||
Conditions: []v1alpha1.ClusterCondition{
|
Conditions: []v1beta1.ClusterCondition{
|
||||||
{Type: v1alpha1.ClusterReady, Status: v1.ConditionFalse},
|
{Type: v1beta1.ClusterReady, Status: v1.ConditionFalse},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -23,7 +23,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
federation_v1alpha1 "k8s.io/kubernetes/federation/apis/federation/v1alpha1"
|
federation_v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/client/restclient"
|
"k8s.io/kubernetes/pkg/client/restclient"
|
||||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||||
@ -40,7 +40,7 @@ const (
|
|||||||
getSecretTimeout = 1 * time.Minute
|
getSecretTimeout = 1 * time.Minute
|
||||||
)
|
)
|
||||||
|
|
||||||
func BuildClusterConfig(c *federation_v1alpha1.Cluster) (*restclient.Config, error) {
|
func BuildClusterConfig(c *federation_v1beta1.Cluster) (*restclient.Config, error) {
|
||||||
var serverAddress string
|
var serverAddress string
|
||||||
var clusterConfig *restclient.Config
|
var clusterConfig *restclient.Config
|
||||||
hostIP, err := utilnet.ChooseHostInterface()
|
hostIP, err := utilnet.ChooseHostInterface()
|
||||||
@ -78,7 +78,7 @@ func BuildClusterConfig(c *federation_v1alpha1.Cluster) (*restclient.Config, err
|
|||||||
|
|
||||||
// This is to inject a different kubeconfigGetter in tests.
|
// This is to inject a different kubeconfigGetter in tests.
|
||||||
// We dont use the standard one which calls NewInCluster in tests to avoid having to setup service accounts and mount files with secret tokens.
|
// We dont use the standard one which calls NewInCluster in tests to avoid having to setup service accounts and mount files with secret tokens.
|
||||||
var KubeconfigGetterForCluster = func(c *federation_v1alpha1.Cluster) clientcmd.KubeconfigGetter {
|
var KubeconfigGetterForCluster = func(c *federation_v1beta1.Cluster) clientcmd.KubeconfigGetter {
|
||||||
return func() (*clientcmdapi.Config, error) {
|
return func() (*clientcmdapi.Config, error) {
|
||||||
secretRefName := ""
|
secretRefName := ""
|
||||||
if c.Spec.SecretRef != nil {
|
if c.Spec.SecretRef != nil {
|
||||||
|
@ -60,7 +60,7 @@ KUBE_GOVERALLS_BIN=${KUBE_GOVERALLS_BIN:-}
|
|||||||
# "v1,compute/v1alpha1,experimental/v1alpha2;v1,compute/v2,experimental/v1alpha3"
|
# "v1,compute/v1alpha1,experimental/v1alpha2;v1,compute/v2,experimental/v1alpha3"
|
||||||
# FIXME: due to current implementation of a test client (see: pkg/api/testapi/testapi.go)
|
# FIXME: due to current implementation of a test client (see: pkg/api/testapi/testapi.go)
|
||||||
# ONLY the last version is tested in each group.
|
# ONLY the last version is tested in each group.
|
||||||
KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,autoscaling/v1,batch/v1,batch/v2alpha1,extensions/v1beta1,apps/v1alpha1,federation/v1alpha1,policy/v1alpha1,rbac.authorization.k8s.io/v1alpha1,certificates/v1alpha1"}
|
KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,autoscaling/v1,batch/v1,batch/v2alpha1,extensions/v1beta1,apps/v1alpha1,federation/v1beta1,policy/v1alpha1,rbac.authorization.k8s.io/v1alpha1,certificates/v1alpha1"}
|
||||||
# once we have multiple group supports
|
# once we have multiple group supports
|
||||||
# Create a junit-style XML test report in this directory if set.
|
# Create a junit-style XML test report in this directory if set.
|
||||||
KUBE_JUNIT_REPORT_DIR=${KUBE_JUNIT_REPORT_DIR:-}
|
KUBE_JUNIT_REPORT_DIR=${KUBE_JUNIT_REPORT_DIR:-}
|
||||||
|
@ -46,7 +46,7 @@ ${clientgen} -t "$@"
|
|||||||
${clientgen} --clientset-name="release_1_3" --input="api/v1,extensions/v1beta1,autoscaling/v1,batch/v1"
|
${clientgen} --clientset-name="release_1_3" --input="api/v1,extensions/v1beta1,autoscaling/v1,batch/v1"
|
||||||
# Clientgen for federation clientset.
|
# Clientgen for federation clientset.
|
||||||
${clientgen} --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --input="../../federation/apis/federation/","api/" --included-types-overrides="api/Service" "$@"
|
${clientgen} --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --input="../../federation/apis/federation/","api/" --included-types-overrides="api/Service" "$@"
|
||||||
${clientgen} --clientset-name=federation_release_1_3 --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --input="../../federation/apis/federation/v1alpha1","api/v1" --included-types-overrides="api/v1/Service" "$@"
|
${clientgen} --clientset-name=federation_release_1_3 --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --input="../../federation/apis/federation/v1beta1","api/v1" --included-types-overrides="api/v1/Service" "$@"
|
||||||
${conversiongen} "$@"
|
${conversiongen} "$@"
|
||||||
${deepcopygen} "$@"
|
${deepcopygen} "$@"
|
||||||
${setgen} "$@"
|
${setgen} "$@"
|
||||||
|
@ -2116,22 +2116,6 @@ func describeCluster(cluster *federation.Cluster) (string, error) {
|
|||||||
c.Message)
|
c.Message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Fprintf(out, "Version:\t%s\n", cluster.Status.Version)
|
|
||||||
|
|
||||||
if len(cluster.Status.Capacity) > 0 {
|
|
||||||
fmt.Fprintf(out, "Capacity:\n")
|
|
||||||
for resource, value := range cluster.Status.Capacity {
|
|
||||||
fmt.Fprintf(out, " %s:\t%s\n", resource, value.String())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(cluster.Status.Allocatable) > 0 {
|
|
||||||
fmt.Fprintf(out, "Allocatable:\n")
|
|
||||||
for resource, value := range cluster.Status.Allocatable {
|
|
||||||
fmt.Fprintf(out, " %s:\t%s\n", resource, value.String())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -568,7 +568,7 @@ func TestDescribeCluster(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("unexpected error: %v", err)
|
t.Errorf("unexpected error: %v", err)
|
||||||
}
|
}
|
||||||
if !strings.Contains(out, "foo") || !strings.Contains(out, "Version:") {
|
if !strings.Contains(out, "foo") {
|
||||||
t.Errorf("unexpected out: %s", out)
|
t.Errorf("unexpected out: %s", out)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -863,10 +863,9 @@ func printCluster(c *federation.Cluster, w io.Writer, options PrintOptions) erro
|
|||||||
statuses = append(statuses, "Unknown")
|
statuses = append(statuses, "Unknown")
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\n",
|
if _, err := fmt.Fprintf(w, "%s\t%s\t%s\n",
|
||||||
c.Name,
|
c.Name,
|
||||||
strings.Join(statuses, ","),
|
strings.Join(statuses, ","),
|
||||||
c.Status.Version,
|
|
||||||
translateTimestamp(c.CreationTimestamp),
|
translateTimestamp(c.CreationTimestamp),
|
||||||
); err != nil {
|
); err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user