From b805082d60433e267cc6bbf93a4882224d8c4a40 Mon Sep 17 00:00:00 2001 From: Phil Bracikowski Date: Fri, 22 Sep 2023 10:21:24 -0700 Subject: [PATCH] tests(awsmachine controller): improve test for precedence of tags --- controllers/awsmachine_controller_unit_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/controllers/awsmachine_controller_unit_test.go b/controllers/awsmachine_controller_unit_test.go index f1e2205df7..cb953bcd72 100644 --- a/controllers/awsmachine_controller_unit_test.go +++ b/controllers/awsmachine_controller_unit_test.go @@ -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) @@ -500,7 +500,8 @@ func TestAWSMachineReconciler(t *testing.T) { ec2Svc.EXPECT().UpdateResourceTags( PointsTo("myMachine"), map[string]string{ - "colour": "lavender", + "colour": "pink", + "shape": "round", "kind": "alicorn", }, map[string]string{}, @@ -508,12 +509,11 @@ func TestAWSMachineReconciler(t *testing.T) { 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)