Skip to content
This repository was archived by the owner on Oct 3, 2020. It is now read-only.

Commit ffb4375

Browse files
committed
Merge branch 'mcasperson-fix-no-masters'
2 parents 538e61a + 0479671 commit ffb4375

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

app/src/cluster.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,20 +130,23 @@ export default class Cluster extends PIXI.Graphics {
130130
nodeBox.y += masterHeight
131131
}
132132

133+
/*
134+
Place unassigned pods to the right of the master nodes, or
135+
to the right of the worker nodes if there were no masters.
136+
*/
137+
var unassignedX = masterX === left ? workerX : masterX
133138

134139
for (const pod of Object.values(this.cluster.unassigned_pods)) {
135140
var podBox = Pod.getOrCreate(pod, this, this.tooltip)
136-
podBox.x = masterX
141+
podBox.x = unassignedX
137142
podBox.y = masterY
138143
podBox.draw()
139144
this.addChild(podBox)
140-
masterX += 20
145+
unassignedX += 20
141146
}
142-
masterWidth = Math.max(masterX, masterWidth)
143-
workerWidth = Math.max(workerX, workerWidth)
144147

145148
this.lineStyle(2, App.current.theme.primaryColor, 1)
146-
const width = Math.max(masterWidth, workerWidth)
149+
const width = Math.max(masterX, masterWidth, workerX, workerWidth, unassignedX)
147150
this.drawRect(0, 0, width, top + masterHeight + workerHeight)
148151

149152
const topHandle = this.topHandle = new PIXI.Graphics()

kube_ops_view/mock.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ def query_mock_cluster(cluster):
8585
if i == 8 and int(time.time() / 13) % 2 == 0:
8686
continue
8787
labels = {}
88-
if i < 2:
88+
# only the first two clusters have master nodes
89+
if i < 2 and index < 2:
8990
if index == 0:
9091
labels['kubernetes.io/role'] = 'master'
9192
elif index == 1:

0 commit comments

Comments
 (0)