Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/cloudscale_ccm/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ func nextLbActions(

// If the name of the lb is wrong, change it
if desired.lb.Name != actual.lb.Name {
next = append(next, actions.RenameLb(actual.lb.UUID, actual.lb.Name))
next = append(next, actions.RenameLb(actual.lb.UUID, desired.lb.Name))
}

// All other changes are applied aggressively, as the customer would have
Expand Down
10 changes: 5 additions & 5 deletions pkg/cloudscale_ccm/reconcile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,16 +397,16 @@ func TestNextLbActions(t *testing.T) {
// Rename lb if name changed. This is safe because the lbs have either
// been acquired by name (in which case both will have the same name),
// or by UUID through the service annotation.
one := &cloudscale.LoadBalancer{
want := &cloudscale.LoadBalancer{
Name: "foo",
}
two := &cloudscale.LoadBalancer{
have := &cloudscale.LoadBalancer{
UUID: "2",
Name: "bar",
}
assertActions(&lbState{lb: one}, &lbState{lb: two}, []actions.Action{
actions.AwaitLb(two),
actions.RenameLb("2", "bar"),
assertActions(&lbState{lb: want}, &lbState{lb: have}, []actions.Action{
actions.AwaitLb(have),
actions.RenameLb("2", "foo"),
})
}

Expand Down