mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 02:00:43 +00:00
Merge pull request #2955 from weaveworks/fix-replicaset-desiredreplicas
fix incorrect reporting of replicaset DesiredReplicas
This commit is contained in:
@@ -53,10 +53,15 @@ func (r *replicaSet) AddParent(topology, id string) {
|
||||
}
|
||||
|
||||
func (r *replicaSet) GetNode(probeID string) report.Node {
|
||||
// Spec.Replicas can be omitted, and the pointer will be nil. It defaults to 1.
|
||||
desiredReplicas := 1
|
||||
if r.Spec.Replicas != nil {
|
||||
desiredReplicas = int(*r.Spec.Replicas)
|
||||
}
|
||||
return r.MetaNode(report.MakeReplicaSetNodeID(r.UID())).WithLatests(map[string]string{
|
||||
ObservedGeneration: fmt.Sprint(r.Status.ObservedGeneration),
|
||||
Replicas: fmt.Sprint(r.Status.Replicas),
|
||||
DesiredReplicas: fmt.Sprint(r.Spec.Replicas),
|
||||
DesiredReplicas: fmt.Sprint(desiredReplicas),
|
||||
FullyLabeledReplicas: fmt.Sprint(r.Status.FullyLabeledReplicas),
|
||||
report.ControlProbeID: probeID,
|
||||
}).WithParents(r.parents).WithLatestActiveControls(ScaleUp, ScaleDown)
|
||||
|
||||
Reference in New Issue
Block a user