Skip to content

Commit

Permalink
add FullyLabeledReplicas in Replicaset Status and ReplicationControll…
Browse files Browse the repository at this point in the history
…er Status
  • Loading branch information
Chao Xu committed Mar 12, 2016
1 parent 0787b31 commit a6240c1
Show file tree
Hide file tree
Showing 31 changed files with 510 additions and 181 deletions.
8 changes: 7 additions & 1 deletion api/swagger-spec/extensions_v1beta1.json
Original file line number Diff line number Diff line change
Expand Up @@ -7877,14 +7877,20 @@
"id": "v1beta1.ReplicaSetStatus",
"description": "ReplicaSetStatus represents the current status of a ReplicaSet.",
"required": [
"replicas"
"replicas",
"fullyLabeledReplicas"
],
"properties": {
"replicas": {
"type": "integer",
"format": "int32",
"description": "Replicas is the most recently oberved number of replicas. More info: http://releases.k8s.io/HEAD/docs/user-guide/replication-controller.md#what-is-a-replication-controller"
},
"fullyLabeledReplicas": {
"type": "integer",
"format": "int32",
"description": "The number of pods that have labels matching the labels of the pod template of the replicaset."
},
"observedGeneration": {
"type": "integer",
"format": "int64",
Expand Down
8 changes: 7 additions & 1 deletion api/swagger-spec/v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -17617,14 +17617,20 @@
"id": "v1.ReplicationControllerStatus",
"description": "ReplicationControllerStatus represents the current status of a replication controller.",
"required": [
"replicas"
"replicas",
"fullyLabeledReplicas"
],
"properties": {
"replicas": {
"type": "integer",
"format": "int32",
"description": "Replicas is the most recently oberved number of replicas. More info: http://releases.k8s.io/HEAD/docs/user-guide/replication-controller.md#what-is-a-replication-controller"
},
"fullyLabeledReplicas": {
"type": "integer",
"format": "int32",
"description": "The number of pods that have labels matching the labels of the pod template of the replication controller."
},
"observedGeneration": {
"type": "integer",
"format": "int64",
Expand Down
9 changes: 8 additions & 1 deletion docs/api-reference/extensions/v1beta1/definitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -4581,6 +4581,13 @@ <h3 id="_v1beta1_replicasetstatus">v1beta1.ReplicaSetStatus</h3>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">fullyLabeledReplicas</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The number of pods that have labels matching the labels of the pod template of the replicaset.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int32)</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">observedGeneration</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ObservedGeneration reflects the generation of the most recently observed ReplicaSet.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
Expand Down Expand Up @@ -5598,7 +5605,7 @@ <h3 id="_any">any</h3>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2016-03-09 19:21:59 UTC
Last updated 2016-03-11 23:39:49 UTC
</div>
</div>
</body>
Expand Down
9 changes: 8 additions & 1 deletion docs/api-reference/v1/definitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -5563,6 +5563,13 @@ <h3 id="_v1_replicationcontrollerstatus">v1.ReplicationControllerStatus</h3>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">fullyLabeledReplicas</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The number of pods that have labels matching the labels of the pod template of the replication controller.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int32)</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">observedGeneration</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ObservedGeneration reflects the generation of the most recently observed replication controller.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
Expand Down Expand Up @@ -7625,7 +7632,7 @@ <h3 id="_any">any</h3>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2016-03-03 20:47:22 UTC
Last updated 2016-03-11 23:39:43 UTC
</div>
</div>
</body>
Expand Down
1 change: 1 addition & 0 deletions pkg/api/deep_copy_generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2400,6 +2400,7 @@ func DeepCopy_api_ReplicationControllerSpec(in ReplicationControllerSpec, out *R

func DeepCopy_api_ReplicationControllerStatus(in ReplicationControllerStatus, out *ReplicationControllerStatus, c *conversion.Cloner) error {
out.Replicas = in.Replicas
out.FullyLabeledReplicas = in.FullyLabeledReplicas
out.ObservedGeneration = in.ObservedGeneration
return nil
}
Expand Down
101 changes: 71 additions & 30 deletions pkg/api/types.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -26953,15 +26953,15 @@ func (x *ReplicationControllerStatus) CodecEncodeSelf(e *codec1978.Encoder) {
} else {
yysep2 := !z.EncBinary()
yy2arr2 := z.EncBasicHandle().StructToArray
var yyq2 [2]bool
var yyq2 [3]bool
_, _, _ = yysep2, yyq2, yy2arr2
const yyr2 bool = false
yyq2[1] = x.ObservedGeneration != 0
yyq2[2] = x.ObservedGeneration != 0
var yynn2 int
if yyr2 || yy2arr2 {
r.EncodeArrayStart(2)
r.EncodeArrayStart(3)
} else {
yynn2 = 1
yynn2 = 2
for _, b := range yyq2 {
if b {
yynn2++
Expand Down Expand Up @@ -26991,9 +26991,28 @@ func (x *ReplicationControllerStatus) CodecEncodeSelf(e *codec1978.Encoder) {
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq2[1] {
yym7 := z.EncBinary()
_ = yym7
yym7 := z.EncBinary()
_ = yym7
if false {
} else {
r.EncodeInt(int64(x.FullyLabeledReplicas))
}
} else {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("fullyLabeledReplicas"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
yym8 := z.EncBinary()
_ = yym8
if false {
} else {
r.EncodeInt(int64(x.FullyLabeledReplicas))
}
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq2[2] {
yym10 := z.EncBinary()
_ = yym10
if false {
} else {
r.EncodeInt(int64(x.ObservedGeneration))
Expand All @@ -27002,12 +27021,12 @@ func (x *ReplicationControllerStatus) CodecEncodeSelf(e *codec1978.Encoder) {
r.EncodeInt(0)
}
} else {
if yyq2[1] {
if yyq2[2] {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("observedGeneration"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
yym8 := z.EncBinary()
_ = yym8
yym11 := z.EncBinary()
_ = yym11
if false {
} else {
r.EncodeInt(int64(x.ObservedGeneration))
Expand Down Expand Up @@ -27081,6 +27100,12 @@ func (x *ReplicationControllerStatus) codecDecodeSelfFromMap(l int, d *codec1978
} else {
x.Replicas = int(r.DecodeInt(codecSelferBitsize1234))
}
case "fullyLabeledReplicas":
if r.TryDecodeAsNil() {
x.FullyLabeledReplicas = 0
} else {
x.FullyLabeledReplicas = int(r.DecodeInt(codecSelferBitsize1234))
}
case "observedGeneration":
if r.TryDecodeAsNil() {
x.ObservedGeneration = 0
Expand All @@ -27098,16 +27123,16 @@ func (x *ReplicationControllerStatus) codecDecodeSelfFromArray(l int, d *codec19
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
var yyj6 int
var yyb6 bool
var yyhl6 bool = l >= 0
yyj6++
if yyhl6 {
yyb6 = yyj6 > l
var yyj7 int
var yyb7 bool
var yyhl7 bool = l >= 0
yyj7++
if yyhl7 {
yyb7 = yyj7 > l
} else {
yyb6 = r.CheckBreak()
yyb7 = r.CheckBreak()
}
if yyb6 {
if yyb7 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
Expand All @@ -27117,13 +27142,29 @@ func (x *ReplicationControllerStatus) codecDecodeSelfFromArray(l int, d *codec19
} else {
x.Replicas = int(r.DecodeInt(codecSelferBitsize1234))
}
yyj6++
if yyhl6 {
yyb6 = yyj6 > l
yyj7++
if yyhl7 {
yyb7 = yyj7 > l
} else {
yyb6 = r.CheckBreak()
yyb7 = r.CheckBreak()
}
if yyb6 {
if yyb7 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.FullyLabeledReplicas = 0
} else {
x.FullyLabeledReplicas = int(r.DecodeInt(codecSelferBitsize1234))
}
yyj7++
if yyhl7 {
yyb7 = yyj7 > l
} else {
yyb7 = r.CheckBreak()
}
if yyb7 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
Expand All @@ -27134,17 +27175,17 @@ func (x *ReplicationControllerStatus) codecDecodeSelfFromArray(l int, d *codec19
x.ObservedGeneration = int64(r.DecodeInt(64))
}
for {
yyj6++
if yyhl6 {
yyb6 = yyj6 > l
yyj7++
if yyhl7 {
yyb7 = yyj7 > l
} else {
yyb6 = r.CheckBreak()
yyb7 = r.CheckBreak()
}
if yyb6 {
if yyb7 {
break
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj6-1, "")
z.DecStructFieldNotFound(yyj7-1, "")
}
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}
Expand Down Expand Up @@ -51389,7 +51430,7 @@ func (x codecSelfer1234) decSliceReplicationController(v *[]ReplicationControlle

yyrg1 := len(yyv1) > 0
yyv21 := yyv1
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 232)
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 240)
if yyrt1 {
if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1]
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,9 @@ type ReplicationControllerStatus struct {
// Replicas is the number of actual replicas.
Replicas int `json:"replicas"`

// The number of pods that have labels matching the labels of the pod template of the replication controller.
FullyLabeledReplicas int `json:"fullyLabeledReplicas"`

// ObservedGeneration is the most recent generation observed by the controller.
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/v1/conversion_generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2598,6 +2598,7 @@ func autoConvert_api_ReplicationControllerStatus_To_v1_ReplicationControllerStat
defaulting.(func(*api.ReplicationControllerStatus))(in)
}
out.Replicas = int32(in.Replicas)
out.FullyLabeledReplicas = int32(in.FullyLabeledReplicas)
out.ObservedGeneration = in.ObservedGeneration
return nil
}
Expand Down Expand Up @@ -5836,6 +5837,7 @@ func autoConvert_v1_ReplicationControllerStatus_To_api_ReplicationControllerStat
defaulting.(func(*ReplicationControllerStatus))(in)
}
out.Replicas = int(in.Replicas)
out.FullyLabeledReplicas = int(in.FullyLabeledReplicas)
out.ObservedGeneration = in.ObservedGeneration
return nil
}
Expand Down
1 change: 1 addition & 0 deletions pkg/api/v1/deep_copy_generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -2031,6 +2031,7 @@ func deepCopy_v1_ReplicationControllerSpec(in ReplicationControllerSpec, out *Re

func deepCopy_v1_ReplicationControllerStatus(in ReplicationControllerStatus, out *ReplicationControllerStatus, c *conversion.Cloner) error {
out.Replicas = in.Replicas
out.FullyLabeledReplicas = in.FullyLabeledReplicas
out.ObservedGeneration = in.ObservedGeneration
return nil
}
Expand Down
Loading

0 comments on commit a6240c1

Please sign in to comment.