diff --git a/machine.go b/machine.go index d23f61f4..fd63939b 100644 --- a/machine.go +++ b/machine.go @@ -670,6 +670,7 @@ func getTags( owners, err := expandTagOwners(aclPolicy, tag, stripEmailDomain) if errors.Is(err, errInvalidTag) { invalidTagMap[tag] = true + continue } var found bool for _, owner := range owners { diff --git a/machine_test.go b/machine_test.go index a72dfbf0..a1ddcff4 100644 --- a/machine_test.go +++ b/machine_test.go @@ -385,11 +385,17 @@ func Test_getTags(t *testing.T) { test.args.machine, test.args.stripEmailDomain, ) - if !reflect.DeepEqual(gotValid, test.wantValid) { - t.Errorf("getTags() = %v, want %v", gotValid, test.wantValid) + for _, valid := range gotValid { + if !contains(test.wantValid, valid) { + t.Errorf("valids: getTags() = %v, want %v", gotValid, test.wantValid) + break + } } - if !reflect.DeepEqual(gotInvalid, test.wantInvalid) { - t.Errorf("getTags() = %v, want %v", gotInvalid, test.wantInvalid) + for _, invalid := range gotInvalid { + if !contains(test.wantInvalid, invalid) { + t.Errorf("invalids: getTags() = %v, want %v", gotInvalid, test.wantInvalid) + break + } } }) }