Skip to content

Commit b805082

Browse files
committed
tests(awsmachine controller): improve test for precedence of tags
1 parent 577bcda commit b805082

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

controllers/awsmachine_controller_unit_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,8 @@ func TestAWSMachineReconciler(t *testing.T) {
489489
instanceCreate(t, g)
490490
getCoreSecurityGroups(t, g)
491491

492-
ms.AWSMachine.Spec.AdditionalTags = infrav1.Tags{"kind": "alicorn"}
493-
cs.AWSCluster.Spec.AdditionalTags = infrav1.Tags{"colour": "lavender"}
492+
ms.AWSMachine.Spec.AdditionalTags = infrav1.Tags{"kind": "alicorn", "colour": "pink"} // takes precedence
493+
cs.AWSCluster.Spec.AdditionalTags = infrav1.Tags{"colour": "lavender", "shape": "round"}
494494

495495
ec2Svc.EXPECT().GetAdditionalSecurityGroupsIDs(gomock.Any()).Return(nil, nil)
496496

@@ -500,20 +500,20 @@ func TestAWSMachineReconciler(t *testing.T) {
500500
ec2Svc.EXPECT().UpdateResourceTags(
501501
PointsTo("myMachine"),
502502
map[string]string{
503-
"colour": "lavender",
503+
"colour": "pink",
504+
"shape": "round",
504505
"kind": "alicorn",
505506
},
506507
map[string]string{},
507508
).Return(nil)
508509

509510
ec2Svc.EXPECT().UpdateResourceTags(
510511
gomock.Any(),
511-
//create
512512
map[string]string{
513-
"colour": "lavender",
513+
"colour": "pink",
514+
"shape": "round",
514515
"kind": "alicorn",
515516
},
516-
//remove
517517
map[string]string{},
518518
).Return(nil).Times(2)
519519

0 commit comments

Comments
 (0)