Skip to content

Commit

Permalink
fix(registry): swap map key/value for alternative mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
ekristen committed Jan 9, 2025
1 parent 1fd86be commit c8d836b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func GetAlternativeResourceTypeMapping() map[string]string {
mapping := make(map[string]string)
for _, r := range registrations {
if r.AlternativeResource != "" {
mapping[r.Name] = r.AlternativeResource
mapping[r.AlternativeResource] = r.Name
}
}
return mapping
Expand Down
2 changes: 1 addition & 1 deletion pkg/registry/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func Test_RegisterResourcesWithAlternative(t *testing.T) {

deprecatedMapping := GetAlternativeResourceTypeMapping()
assert.Len(t, deprecatedMapping, 1)
assert.Equal(t, "test2", deprecatedMapping["test"])
assert.Equal(t, "test", deprecatedMapping["test2"])
}

func Test_RegisterResourcesWithDuplicateAlternative(t *testing.T) {
Expand Down

0 comments on commit c8d836b

Please sign in to comment.