Skip to content

Commit

Permalink
fix: adds additional spot scheduling label (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmazionis authored Jun 8, 2021
1 parent d3c759a commit 8f1df5e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/services/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (c *Controller) nodeAddHandler(
}

if spot {
node.Labels[labels.Spot] = "true"
node.Labels[labels.FakeSpot] = "true"
}

genericHandler(log, c.queue, reflect.TypeOf(&corev1.Node{}), event, node)
Expand Down
2 changes: 1 addition & 1 deletion internal/services/controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func Test(t *testing.T) {

node := &v1.Node{ObjectMeta: metav1.ObjectMeta{Name: "node1", Labels: map[string]string{}}}
expectedNode := node.DeepCopy()
expectedNode.Labels[labels.Spot] = "true"
expectedNode.Labels[labels.FakeSpot] = "true"
nodeData, err := encode(expectedNode)
require.NoError(t, err)

Expand Down
3 changes: 2 additions & 1 deletion pkg/labels/labels.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package labels

const (
Spot = "scheduling.cast.ai/spot"
Spot = "scheduling.cast.ai/spot"
FakeSpot = "scheduling.cast.ai/fake-spot"
)

0 comments on commit 8f1df5e

Please sign in to comment.