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

Commit

Permalink
Merge branch 'mcasperson-fix-no-masters'
Browse files Browse the repository at this point in the history
  • Loading branch information
hjacobs committed Mar 23, 2019
2 parents 538e61a + 0479671 commit ffb4375
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
13 changes: 8 additions & 5 deletions app/src/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,23 @@ export default class Cluster extends PIXI.Graphics {
nodeBox.y += masterHeight
}

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

for (const pod of Object.values(this.cluster.unassigned_pods)) {
var podBox = Pod.getOrCreate(pod, this, this.tooltip)
podBox.x = masterX
podBox.x = unassignedX
podBox.y = masterY
podBox.draw()
this.addChild(podBox)
masterX += 20
unassignedX += 20
}
masterWidth = Math.max(masterX, masterWidth)
workerWidth = Math.max(workerX, workerWidth)

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

const topHandle = this.topHandle = new PIXI.Graphics()
Expand Down
3 changes: 2 additions & 1 deletion kube_ops_view/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ def query_mock_cluster(cluster):
if i == 8 and int(time.time() / 13) % 2 == 0:
continue
labels = {}
if i < 2:
# only the first two clusters have master nodes
if i < 2 and index < 2:
if index == 0:
labels['kubernetes.io/role'] = 'master'
elif index == 1:
Expand Down

0 comments on commit ffb4375

Please sign in to comment.