Skip to content

Commit ec00f2c

Browse files
authored
Merge pull request #30 from cloudscale-ch/denis/rename-fix
Fix LB name changes not being applied
2 parents f81b6a0 + e032540 commit ec00f2c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pkg/cloudscale_ccm/reconcile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ func nextLbActions(
464464

465465
// If the name of the lb is wrong, change it
466466
if desired.lb.Name != actual.lb.Name {
467-
next = append(next, actions.RenameLb(actual.lb.UUID, actual.lb.Name))
467+
next = append(next, actions.RenameLb(actual.lb.UUID, desired.lb.Name))
468468
}
469469

470470
// All other changes are applied aggressively, as the customer would have

pkg/cloudscale_ccm/reconcile_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -397,16 +397,16 @@ func TestNextLbActions(t *testing.T) {
397397
// Rename lb if name changed. This is safe because the lbs have either
398398
// been acquired by name (in which case both will have the same name),
399399
// or by UUID through the service annotation.
400-
one := &cloudscale.LoadBalancer{
400+
want := &cloudscale.LoadBalancer{
401401
Name: "foo",
402402
}
403-
two := &cloudscale.LoadBalancer{
403+
have := &cloudscale.LoadBalancer{
404404
UUID: "2",
405405
Name: "bar",
406406
}
407-
assertActions(&lbState{lb: one}, &lbState{lb: two}, []actions.Action{
408-
actions.AwaitLb(two),
409-
actions.RenameLb("2", "bar"),
407+
assertActions(&lbState{lb: want}, &lbState{lb: have}, []actions.Action{
408+
actions.AwaitLb(have),
409+
actions.RenameLb("2", "foo"),
410410
})
411411
}
412412

0 commit comments

Comments
 (0)