Skip to content

Commit

Permalink
Add the node's UID to the machine's noderef.
Browse files Browse the repository at this point in the history
  • Loading branch information
spew committed Jun 14, 2018
1 parent ca0cee6 commit e8ccfd5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/controller/machine/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,6 @@ func objectRef(node *corev1.Node) *corev1.ObjectReference {
return &corev1.ObjectReference{
Kind: "Node",
Name: node.ObjectMeta.Name,
UID: node.UID,
}
}
4 changes: 4 additions & 0 deletions pkg/controller/machine/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ func TestReconcileNode(t *testing.T) {
node := &corev1.Node{
ObjectMeta: metav1.ObjectMeta{
Name: "bar",
UID: "the-uid",
Annotations: make(map[string]string),
},
}
Expand Down Expand Up @@ -240,6 +241,9 @@ func TestReconcileNode(t *testing.T) {
if actualMachine.Status.NodeRef.Name != "bar" {
t.Errorf("got %v node ref name, expected bar node ref name.", actualMachine.Status.NodeRef.Name)
}
if actualMachine.Status.NodeRef.UID != "the-uid" {
t.Errorf("got '%v' node ref uid, expected 'the-uid' node ref uid", actualMachine.Status.NodeRef.UID)
}
}
if !test.expectLinked {
if actualMachine != nil && actualMachine.Status.NodeRef != nil {
Expand Down

0 comments on commit e8ccfd5

Please sign in to comment.