mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Merge pull request #26308 from quinton-hoole/2016-05-25-uberentes-add-cluster-zone
Add zones and region to federation cluster API object status.
This commit is contained in:
commit
f6b4707619
@ -163,6 +163,14 @@ func DeepCopy_federation_ClusterStatus(in ClusterStatus, out *ClusterStatus, c *
|
|||||||
if err := DeepCopy_federation_ClusterMeta(in.ClusterMeta, &out.ClusterMeta, c); err != nil {
|
if err := DeepCopy_federation_ClusterMeta(in.ClusterMeta, &out.ClusterMeta, c); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if in.Zones != nil {
|
||||||
|
in, out := in.Zones, &out.Zones
|
||||||
|
*out = make([]string, len(in))
|
||||||
|
copy(*out, in)
|
||||||
|
} else {
|
||||||
|
out.Zones = nil
|
||||||
|
}
|
||||||
|
out.Region = in.Region
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1161,16 +1161,18 @@ 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 [4]bool
|
var yyq2 [6]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.Capacity) != 0
|
||||||
yyq2[2] = len(x.Allocatable) != 0
|
yyq2[2] = len(x.Allocatable) != 0
|
||||||
yyq2[3] = x.Version != ""
|
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(4)
|
r.EncodeArrayStart(6)
|
||||||
} else {
|
} else {
|
||||||
yynn2 = 0
|
yynn2 = 0
|
||||||
for _, b := range yyq2 {
|
for _, b := range yyq2 {
|
||||||
@ -1267,9 +1269,67 @@ func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) {
|
|||||||
if yyr2 || yy2arr2 {
|
if yyr2 || yy2arr2 {
|
||||||
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
||||||
if yyq2[3] {
|
if yyq2[3] {
|
||||||
|
if x.Zones == nil {
|
||||||
|
r.EncodeNil()
|
||||||
|
} else {
|
||||||
yym13 := z.EncBinary()
|
yym13 := z.EncBinary()
|
||||||
_ = yym13
|
_ = yym13
|
||||||
if false {
|
if false {
|
||||||
|
} else {
|
||||||
|
z.F.EncSliceStringV(x.Zones, false, e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
r.EncodeNil()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if yyq2[3] {
|
||||||
|
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
||||||
|
r.EncodeString(codecSelferC_UTF81234, string("zones"))
|
||||||
|
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
||||||
|
if x.Zones == nil {
|
||||||
|
r.EncodeNil()
|
||||||
|
} else {
|
||||||
|
yym14 := z.EncBinary()
|
||||||
|
_ = yym14
|
||||||
|
if false {
|
||||||
|
} else {
|
||||||
|
z.F.EncSliceStringV(x.Zones, false, e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if yyr2 || yy2arr2 {
|
||||||
|
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
||||||
|
if yyq2[4] {
|
||||||
|
yym16 := z.EncBinary()
|
||||||
|
_ = yym16
|
||||||
|
if false {
|
||||||
|
} else {
|
||||||
|
r.EncodeString(codecSelferC_UTF81234, string(x.Region))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
r.EncodeString(codecSelferC_UTF81234, "")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if yyq2[4] {
|
||||||
|
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
||||||
|
r.EncodeString(codecSelferC_UTF81234, string("region"))
|
||||||
|
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
||||||
|
yym17 := z.EncBinary()
|
||||||
|
_ = yym17
|
||||||
|
if false {
|
||||||
|
} else {
|
||||||
|
r.EncodeString(codecSelferC_UTF81234, string(x.Region))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if yyr2 || yy2arr2 {
|
||||||
|
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
||||||
|
if yyq2[5] {
|
||||||
|
yym19 := z.EncBinary()
|
||||||
|
_ = yym19
|
||||||
|
if false {
|
||||||
} else {
|
} else {
|
||||||
r.EncodeString(codecSelferC_UTF81234, string(x.Version))
|
r.EncodeString(codecSelferC_UTF81234, string(x.Version))
|
||||||
}
|
}
|
||||||
@ -1277,12 +1337,12 @@ func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) {
|
|||||||
r.EncodeString(codecSelferC_UTF81234, "")
|
r.EncodeString(codecSelferC_UTF81234, "")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if yyq2[3] {
|
if yyq2[5] {
|
||||||
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
||||||
r.EncodeString(codecSelferC_UTF81234, string("version"))
|
r.EncodeString(codecSelferC_UTF81234, string("version"))
|
||||||
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
||||||
yym14 := z.EncBinary()
|
yym20 := z.EncBinary()
|
||||||
_ = yym14
|
_ = yym20
|
||||||
if false {
|
if false {
|
||||||
} else {
|
} else {
|
||||||
r.EncodeString(codecSelferC_UTF81234, string(x.Version))
|
r.EncodeString(codecSelferC_UTF81234, string(x.Version))
|
||||||
@ -1376,6 +1436,24 @@ func (x *ClusterStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
|
|||||||
yyv7 := &x.Allocatable
|
yyv7 := &x.Allocatable
|
||||||
yyv7.CodecDecodeSelf(d)
|
yyv7.CodecDecodeSelf(d)
|
||||||
}
|
}
|
||||||
|
case "zones":
|
||||||
|
if r.TryDecodeAsNil() {
|
||||||
|
x.Zones = nil
|
||||||
|
} else {
|
||||||
|
yyv8 := &x.Zones
|
||||||
|
yym9 := z.DecBinary()
|
||||||
|
_ = yym9
|
||||||
|
if false {
|
||||||
|
} else {
|
||||||
|
z.F.DecSliceStringX(yyv8, false, d)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case "region":
|
||||||
|
if r.TryDecodeAsNil() {
|
||||||
|
x.Region = ""
|
||||||
|
} else {
|
||||||
|
x.Region = string(r.DecodeString())
|
||||||
|
}
|
||||||
case "version":
|
case "version":
|
||||||
if r.TryDecodeAsNil() {
|
if r.TryDecodeAsNil() {
|
||||||
x.Version = ""
|
x.Version = ""
|
||||||
@ -1393,16 +1471,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 yyj9 int
|
var yyj12 int
|
||||||
var yyb9 bool
|
var yyb12 bool
|
||||||
var yyhl9 bool = l >= 0
|
var yyhl12 bool = l >= 0
|
||||||
yyj9++
|
yyj12++
|
||||||
if yyhl9 {
|
if yyhl12 {
|
||||||
yyb9 = yyj9 > l
|
yyb12 = yyj12 > l
|
||||||
} else {
|
} else {
|
||||||
yyb9 = r.CheckBreak()
|
yyb12 = r.CheckBreak()
|
||||||
}
|
}
|
||||||
if yyb9 {
|
if yyb12 {
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1410,21 +1488,21 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|||||||
if r.TryDecodeAsNil() {
|
if r.TryDecodeAsNil() {
|
||||||
x.Conditions = nil
|
x.Conditions = nil
|
||||||
} else {
|
} else {
|
||||||
yyv10 := &x.Conditions
|
yyv13 := &x.Conditions
|
||||||
yym11 := z.DecBinary()
|
yym14 := z.DecBinary()
|
||||||
_ = yym11
|
_ = yym14
|
||||||
if false {
|
if false {
|
||||||
} else {
|
} else {
|
||||||
h.decSliceClusterCondition((*[]ClusterCondition)(yyv10), d)
|
h.decSliceClusterCondition((*[]ClusterCondition)(yyv13), d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
yyj9++
|
yyj12++
|
||||||
if yyhl9 {
|
if yyhl12 {
|
||||||
yyb9 = yyj9 > l
|
yyb12 = yyj12 > l
|
||||||
} else {
|
} else {
|
||||||
yyb9 = r.CheckBreak()
|
yyb12 = r.CheckBreak()
|
||||||
}
|
}
|
||||||
if yyb9 {
|
if yyb12 {
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1432,16 +1510,16 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|||||||
if r.TryDecodeAsNil() {
|
if r.TryDecodeAsNil() {
|
||||||
x.Capacity = nil
|
x.Capacity = nil
|
||||||
} else {
|
} else {
|
||||||
yyv12 := &x.Capacity
|
yyv15 := &x.Capacity
|
||||||
yyv12.CodecDecodeSelf(d)
|
yyv15.CodecDecodeSelf(d)
|
||||||
}
|
}
|
||||||
yyj9++
|
yyj12++
|
||||||
if yyhl9 {
|
if yyhl12 {
|
||||||
yyb9 = yyj9 > l
|
yyb12 = yyj12 > l
|
||||||
} else {
|
} else {
|
||||||
yyb9 = r.CheckBreak()
|
yyb12 = r.CheckBreak()
|
||||||
}
|
}
|
||||||
if yyb9 {
|
if yyb12 {
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1449,16 +1527,54 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|||||||
if r.TryDecodeAsNil() {
|
if r.TryDecodeAsNil() {
|
||||||
x.Allocatable = nil
|
x.Allocatable = nil
|
||||||
} else {
|
} else {
|
||||||
yyv13 := &x.Allocatable
|
yyv16 := &x.Allocatable
|
||||||
yyv13.CodecDecodeSelf(d)
|
yyv16.CodecDecodeSelf(d)
|
||||||
}
|
}
|
||||||
yyj9++
|
yyj12++
|
||||||
if yyhl9 {
|
if yyhl12 {
|
||||||
yyb9 = yyj9 > l
|
yyb12 = yyj12 > l
|
||||||
} else {
|
} else {
|
||||||
yyb9 = r.CheckBreak()
|
yyb12 = r.CheckBreak()
|
||||||
}
|
}
|
||||||
if yyb9 {
|
if yyb12 {
|
||||||
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
||||||
|
if r.TryDecodeAsNil() {
|
||||||
|
x.Zones = nil
|
||||||
|
} else {
|
||||||
|
yyv17 := &x.Zones
|
||||||
|
yym18 := z.DecBinary()
|
||||||
|
_ = yym18
|
||||||
|
if false {
|
||||||
|
} else {
|
||||||
|
z.F.DecSliceStringX(yyv17, false, 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.Region = ""
|
||||||
|
} else {
|
||||||
|
x.Region = string(r.DecodeString())
|
||||||
|
}
|
||||||
|
yyj12++
|
||||||
|
if yyhl12 {
|
||||||
|
yyb12 = yyj12 > l
|
||||||
|
} else {
|
||||||
|
yyb12 = r.CheckBreak()
|
||||||
|
}
|
||||||
|
if yyb12 {
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1469,17 +1585,17 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|||||||
x.Version = string(r.DecodeString())
|
x.Version = string(r.DecodeString())
|
||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
yyj9++
|
yyj12++
|
||||||
if yyhl9 {
|
if yyhl12 {
|
||||||
yyb9 = yyj9 > l
|
yyb12 = yyj12 > l
|
||||||
} else {
|
} else {
|
||||||
yyb9 = r.CheckBreak()
|
yyb12 = r.CheckBreak()
|
||||||
}
|
}
|
||||||
if yyb9 {
|
if yyb12 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
||||||
z.DecStructFieldNotFound(yyj9-1, "")
|
z.DecStructFieldNotFound(yyj12-1, "")
|
||||||
}
|
}
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
}
|
}
|
||||||
@ -2448,7 +2564,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, 328)
|
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 368)
|
||||||
if yyrt1 {
|
if yyrt1 {
|
||||||
if yyrl1 <= cap(yyv1) {
|
if yyrl1 <= cap(yyv1) {
|
||||||
yyv1 = yyv1[:yyrl1]
|
yyv1 = yyv1[:yyrl1]
|
||||||
|
@ -85,6 +85,11 @@ type ClusterStatus struct {
|
|||||||
// Allocatable represents the total resources of a cluster that are available for scheduling.
|
// Allocatable represents the total resources of a cluster that are available for scheduling.
|
||||||
Allocatable api.ResourceList `json:"allocatable,omitempty"`
|
Allocatable api.ResourceList `json:"allocatable,omitempty"`
|
||||||
ClusterMeta `json:",inline"`
|
ClusterMeta `json:",inline"`
|
||||||
|
// 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.
|
||||||
|
Zones []string `json:"zones,omitempty"`
|
||||||
|
// Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'.
|
||||||
|
Region string `json:"region,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// +genclient=true,nonNamespaced=true
|
// +genclient=true,nonNamespaced=true
|
||||||
|
@ -275,6 +275,14 @@ func autoConvert_v1alpha1_ClusterStatus_To_federation_ClusterStatus(in *ClusterS
|
|||||||
if err := Convert_v1alpha1_ClusterMeta_To_federation_ClusterMeta(&in.ClusterMeta, &out.ClusterMeta, s); err != nil {
|
if err := Convert_v1alpha1_ClusterMeta_To_federation_ClusterMeta(&in.ClusterMeta, &out.ClusterMeta, s); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if in.Zones != nil {
|
||||||
|
in, out := &in.Zones, &out.Zones
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
} else {
|
||||||
|
out.Zones = nil
|
||||||
|
}
|
||||||
|
out.Region = in.Region
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,6 +331,14 @@ func autoConvert_federation_ClusterStatus_To_v1alpha1_ClusterStatus(in *federati
|
|||||||
if err := Convert_federation_ClusterMeta_To_v1alpha1_ClusterMeta(&in.ClusterMeta, &out.ClusterMeta, s); err != nil {
|
if err := Convert_federation_ClusterMeta_To_v1alpha1_ClusterMeta(&in.ClusterMeta, &out.ClusterMeta, s); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if in.Zones != nil {
|
||||||
|
in, out := &in.Zones, &out.Zones
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
} else {
|
||||||
|
out.Zones = nil
|
||||||
|
}
|
||||||
|
out.Region = in.Region
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,6 +164,14 @@ func DeepCopy_v1alpha1_ClusterStatus(in ClusterStatus, out *ClusterStatus, c *co
|
|||||||
if err := DeepCopy_v1alpha1_ClusterMeta(in.ClusterMeta, &out.ClusterMeta, c); err != nil {
|
if err := DeepCopy_v1alpha1_ClusterMeta(in.ClusterMeta, &out.ClusterMeta, c); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if in.Zones != nil {
|
||||||
|
in, out := in.Zones, &out.Zones
|
||||||
|
*out = make([]string, len(in))
|
||||||
|
copy(*out, in)
|
||||||
|
} else {
|
||||||
|
out.Zones = nil
|
||||||
|
}
|
||||||
|
out.Region = in.Region
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -358,6 +358,25 @@ func (m *ClusterStatus) MarshalTo(data []byte) (int, error) {
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
i += n10
|
i += n10
|
||||||
|
if len(m.Zones) > 0 {
|
||||||
|
for _, s := range m.Zones {
|
||||||
|
data[i] = 0x2a
|
||||||
|
i++
|
||||||
|
l = len(s)
|
||||||
|
for l >= 1<<7 {
|
||||||
|
data[i] = uint8(uint64(l)&0x7f | 0x80)
|
||||||
|
l >>= 7
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
data[i] = uint8(l)
|
||||||
|
i++
|
||||||
|
i += copy(data[i:], s)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data[i] = 0x32
|
||||||
|
i++
|
||||||
|
i = encodeVarintGenerated(data, i, uint64(len(m.Region)))
|
||||||
|
i += copy(data[i:], m.Region)
|
||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -511,6 +530,14 @@ func (m *ClusterStatus) Size() (n int) {
|
|||||||
}
|
}
|
||||||
l = m.ClusterMeta.Size()
|
l = m.ClusterMeta.Size()
|
||||||
n += 1 + l + sovGenerated(uint64(l))
|
n += 1 + l + sovGenerated(uint64(l))
|
||||||
|
if len(m.Zones) > 0 {
|
||||||
|
for _, s := range m.Zones {
|
||||||
|
l = len(s)
|
||||||
|
n += 1 + l + sovGenerated(uint64(l))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
l = len(m.Region)
|
||||||
|
n += 1 + l + sovGenerated(uint64(l))
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1529,6 +1556,64 @@ func (m *ClusterStatus) Unmarshal(data []byte) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
|
case 5:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Zones", 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.Zones = append(m.Zones, string(data[iNdEx:postIndex]))
|
||||||
|
iNdEx = postIndex
|
||||||
|
case 6:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Region", 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.Region = string(data[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
default:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := skipGenerated(data[iNdEx:])
|
skippy, err := skipGenerated(data[iNdEx:])
|
||||||
|
@ -106,6 +106,13 @@ message ClusterStatus {
|
|||||||
map<string, k8s.io.kubernetes.pkg.api.resource.Quantity> allocatable = 3;
|
map<string, k8s.io.kubernetes.pkg.api.resource.Quantity> allocatable = 3;
|
||||||
|
|
||||||
optional ClusterMeta clusterMeta = 4;
|
optional ClusterMeta clusterMeta = 4;
|
||||||
|
|
||||||
|
// 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.
|
||||||
|
repeated string zones = 5;
|
||||||
|
|
||||||
|
// Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'.
|
||||||
|
optional string region = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.
|
// ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.
|
||||||
|
@ -1161,16 +1161,18 @@ 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 [4]bool
|
var yyq2 [6]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.Capacity) != 0
|
||||||
yyq2[2] = len(x.Allocatable) != 0
|
yyq2[2] = len(x.Allocatable) != 0
|
||||||
yyq2[3] = x.Version != ""
|
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(4)
|
r.EncodeArrayStart(6)
|
||||||
} else {
|
} else {
|
||||||
yynn2 = 0
|
yynn2 = 0
|
||||||
for _, b := range yyq2 {
|
for _, b := range yyq2 {
|
||||||
@ -1267,9 +1269,67 @@ func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) {
|
|||||||
if yyr2 || yy2arr2 {
|
if yyr2 || yy2arr2 {
|
||||||
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
||||||
if yyq2[3] {
|
if yyq2[3] {
|
||||||
|
if x.Zones == nil {
|
||||||
|
r.EncodeNil()
|
||||||
|
} else {
|
||||||
yym13 := z.EncBinary()
|
yym13 := z.EncBinary()
|
||||||
_ = yym13
|
_ = yym13
|
||||||
if false {
|
if false {
|
||||||
|
} else {
|
||||||
|
z.F.EncSliceStringV(x.Zones, false, e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
r.EncodeNil()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if yyq2[3] {
|
||||||
|
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
||||||
|
r.EncodeString(codecSelferC_UTF81234, string("zones"))
|
||||||
|
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
||||||
|
if x.Zones == nil {
|
||||||
|
r.EncodeNil()
|
||||||
|
} else {
|
||||||
|
yym14 := z.EncBinary()
|
||||||
|
_ = yym14
|
||||||
|
if false {
|
||||||
|
} else {
|
||||||
|
z.F.EncSliceStringV(x.Zones, false, e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if yyr2 || yy2arr2 {
|
||||||
|
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
||||||
|
if yyq2[4] {
|
||||||
|
yym16 := z.EncBinary()
|
||||||
|
_ = yym16
|
||||||
|
if false {
|
||||||
|
} else {
|
||||||
|
r.EncodeString(codecSelferC_UTF81234, string(x.Region))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
r.EncodeString(codecSelferC_UTF81234, "")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if yyq2[4] {
|
||||||
|
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
||||||
|
r.EncodeString(codecSelferC_UTF81234, string("region"))
|
||||||
|
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
||||||
|
yym17 := z.EncBinary()
|
||||||
|
_ = yym17
|
||||||
|
if false {
|
||||||
|
} else {
|
||||||
|
r.EncodeString(codecSelferC_UTF81234, string(x.Region))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if yyr2 || yy2arr2 {
|
||||||
|
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
||||||
|
if yyq2[5] {
|
||||||
|
yym19 := z.EncBinary()
|
||||||
|
_ = yym19
|
||||||
|
if false {
|
||||||
} else {
|
} else {
|
||||||
r.EncodeString(codecSelferC_UTF81234, string(x.Version))
|
r.EncodeString(codecSelferC_UTF81234, string(x.Version))
|
||||||
}
|
}
|
||||||
@ -1277,12 +1337,12 @@ func (x *ClusterStatus) CodecEncodeSelf(e *codec1978.Encoder) {
|
|||||||
r.EncodeString(codecSelferC_UTF81234, "")
|
r.EncodeString(codecSelferC_UTF81234, "")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if yyq2[3] {
|
if yyq2[5] {
|
||||||
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
||||||
r.EncodeString(codecSelferC_UTF81234, string("version"))
|
r.EncodeString(codecSelferC_UTF81234, string("version"))
|
||||||
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
||||||
yym14 := z.EncBinary()
|
yym20 := z.EncBinary()
|
||||||
_ = yym14
|
_ = yym20
|
||||||
if false {
|
if false {
|
||||||
} else {
|
} else {
|
||||||
r.EncodeString(codecSelferC_UTF81234, string(x.Version))
|
r.EncodeString(codecSelferC_UTF81234, string(x.Version))
|
||||||
@ -1376,6 +1436,24 @@ func (x *ClusterStatus) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
|
|||||||
yyv7 := &x.Allocatable
|
yyv7 := &x.Allocatable
|
||||||
yyv7.CodecDecodeSelf(d)
|
yyv7.CodecDecodeSelf(d)
|
||||||
}
|
}
|
||||||
|
case "zones":
|
||||||
|
if r.TryDecodeAsNil() {
|
||||||
|
x.Zones = nil
|
||||||
|
} else {
|
||||||
|
yyv8 := &x.Zones
|
||||||
|
yym9 := z.DecBinary()
|
||||||
|
_ = yym9
|
||||||
|
if false {
|
||||||
|
} else {
|
||||||
|
z.F.DecSliceStringX(yyv8, false, d)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case "region":
|
||||||
|
if r.TryDecodeAsNil() {
|
||||||
|
x.Region = ""
|
||||||
|
} else {
|
||||||
|
x.Region = string(r.DecodeString())
|
||||||
|
}
|
||||||
case "version":
|
case "version":
|
||||||
if r.TryDecodeAsNil() {
|
if r.TryDecodeAsNil() {
|
||||||
x.Version = ""
|
x.Version = ""
|
||||||
@ -1393,16 +1471,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 yyj9 int
|
var yyj12 int
|
||||||
var yyb9 bool
|
var yyb12 bool
|
||||||
var yyhl9 bool = l >= 0
|
var yyhl12 bool = l >= 0
|
||||||
yyj9++
|
yyj12++
|
||||||
if yyhl9 {
|
if yyhl12 {
|
||||||
yyb9 = yyj9 > l
|
yyb12 = yyj12 > l
|
||||||
} else {
|
} else {
|
||||||
yyb9 = r.CheckBreak()
|
yyb12 = r.CheckBreak()
|
||||||
}
|
}
|
||||||
if yyb9 {
|
if yyb12 {
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1410,21 +1488,21 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|||||||
if r.TryDecodeAsNil() {
|
if r.TryDecodeAsNil() {
|
||||||
x.Conditions = nil
|
x.Conditions = nil
|
||||||
} else {
|
} else {
|
||||||
yyv10 := &x.Conditions
|
yyv13 := &x.Conditions
|
||||||
yym11 := z.DecBinary()
|
yym14 := z.DecBinary()
|
||||||
_ = yym11
|
_ = yym14
|
||||||
if false {
|
if false {
|
||||||
} else {
|
} else {
|
||||||
h.decSliceClusterCondition((*[]ClusterCondition)(yyv10), d)
|
h.decSliceClusterCondition((*[]ClusterCondition)(yyv13), d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
yyj9++
|
yyj12++
|
||||||
if yyhl9 {
|
if yyhl12 {
|
||||||
yyb9 = yyj9 > l
|
yyb12 = yyj12 > l
|
||||||
} else {
|
} else {
|
||||||
yyb9 = r.CheckBreak()
|
yyb12 = r.CheckBreak()
|
||||||
}
|
}
|
||||||
if yyb9 {
|
if yyb12 {
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1432,16 +1510,16 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|||||||
if r.TryDecodeAsNil() {
|
if r.TryDecodeAsNil() {
|
||||||
x.Capacity = nil
|
x.Capacity = nil
|
||||||
} else {
|
} else {
|
||||||
yyv12 := &x.Capacity
|
yyv15 := &x.Capacity
|
||||||
yyv12.CodecDecodeSelf(d)
|
yyv15.CodecDecodeSelf(d)
|
||||||
}
|
}
|
||||||
yyj9++
|
yyj12++
|
||||||
if yyhl9 {
|
if yyhl12 {
|
||||||
yyb9 = yyj9 > l
|
yyb12 = yyj12 > l
|
||||||
} else {
|
} else {
|
||||||
yyb9 = r.CheckBreak()
|
yyb12 = r.CheckBreak()
|
||||||
}
|
}
|
||||||
if yyb9 {
|
if yyb12 {
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1449,16 +1527,54 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|||||||
if r.TryDecodeAsNil() {
|
if r.TryDecodeAsNil() {
|
||||||
x.Allocatable = nil
|
x.Allocatable = nil
|
||||||
} else {
|
} else {
|
||||||
yyv13 := &x.Allocatable
|
yyv16 := &x.Allocatable
|
||||||
yyv13.CodecDecodeSelf(d)
|
yyv16.CodecDecodeSelf(d)
|
||||||
}
|
}
|
||||||
yyj9++
|
yyj12++
|
||||||
if yyhl9 {
|
if yyhl12 {
|
||||||
yyb9 = yyj9 > l
|
yyb12 = yyj12 > l
|
||||||
} else {
|
} else {
|
||||||
yyb9 = r.CheckBreak()
|
yyb12 = r.CheckBreak()
|
||||||
}
|
}
|
||||||
if yyb9 {
|
if yyb12 {
|
||||||
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
||||||
|
if r.TryDecodeAsNil() {
|
||||||
|
x.Zones = nil
|
||||||
|
} else {
|
||||||
|
yyv17 := &x.Zones
|
||||||
|
yym18 := z.DecBinary()
|
||||||
|
_ = yym18
|
||||||
|
if false {
|
||||||
|
} else {
|
||||||
|
z.F.DecSliceStringX(yyv17, false, 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.Region = ""
|
||||||
|
} else {
|
||||||
|
x.Region = string(r.DecodeString())
|
||||||
|
}
|
||||||
|
yyj12++
|
||||||
|
if yyhl12 {
|
||||||
|
yyb12 = yyj12 > l
|
||||||
|
} else {
|
||||||
|
yyb12 = r.CheckBreak()
|
||||||
|
}
|
||||||
|
if yyb12 {
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1469,17 +1585,17 @@ func (x *ClusterStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|||||||
x.Version = string(r.DecodeString())
|
x.Version = string(r.DecodeString())
|
||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
yyj9++
|
yyj12++
|
||||||
if yyhl9 {
|
if yyhl12 {
|
||||||
yyb9 = yyj9 > l
|
yyb12 = yyj12 > l
|
||||||
} else {
|
} else {
|
||||||
yyb9 = r.CheckBreak()
|
yyb12 = r.CheckBreak()
|
||||||
}
|
}
|
||||||
if yyb9 {
|
if yyb12 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
||||||
z.DecStructFieldNotFound(yyj9-1, "")
|
z.DecStructFieldNotFound(yyj12-1, "")
|
||||||
}
|
}
|
||||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||||
}
|
}
|
||||||
@ -2448,7 +2564,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, 328)
|
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 368)
|
||||||
if yyrt1 {
|
if yyrt1 {
|
||||||
if yyrl1 <= cap(yyv1) {
|
if yyrl1 <= cap(yyv1) {
|
||||||
yyv1 = yyv1[:yyrl1]
|
yyv1 = yyv1[:yyrl1]
|
||||||
|
@ -85,6 +85,11 @@ type ClusterStatus struct {
|
|||||||
// Allocatable represents the total resources of a cluster that are available for scheduling.
|
// 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"`
|
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"`
|
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'.
|
||||||
|
// These will always be in the same region.
|
||||||
|
Zones []string `json:"zones,omitempty" protobuf:"bytes,5,rep,name=zones"`
|
||||||
|
// Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'.
|
||||||
|
Region string `json:"region,omitempty" protobuf:"bytes,6,opt,name=region"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// +genclient=true,nonNamespaced=true
|
// +genclient=true,nonNamespaced=true
|
||||||
|
Loading…
Reference in New Issue
Block a user