Skip to content

Commit

Permalink
tests(awsmachine controller): improve test for precedence of tags
Browse files Browse the repository at this point in the history
  • Loading branch information
philjb committed Sep 22, 2023
1 parent 577bcda commit b805082
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions controllers/awsmachine_controller_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,8 @@ func TestAWSMachineReconciler(t *testing.T) {
instanceCreate(t, g)
getCoreSecurityGroups(t, g)

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

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

Expand All @@ -500,20 +500,20 @@ func TestAWSMachineReconciler(t *testing.T) {
ec2Svc.EXPECT().UpdateResourceTags(
PointsTo("myMachine"),
map[string]string{
"colour": "lavender",
"colour": "pink",
"shape": "round",
"kind": "alicorn",
},
map[string]string{},
).Return(nil)

ec2Svc.EXPECT().UpdateResourceTags(
gomock.Any(),
//create
map[string]string{
"colour": "lavender",
"colour": "pink",
"shape": "round",
"kind": "alicorn",
},
//remove
map[string]string{},
).Return(nil).Times(2)

Expand Down

0 comments on commit b805082

Please sign in to comment.