Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Commit

Permalink
Remove an outstanding TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
Porges committed Nov 24, 2020
1 parent 52d346c commit f794832
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 1 addition & 11 deletions hack/generated/pkg/util/armresourceresolver/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (h ResourceHierarchy) FullAzureName() string {
}

for _, res := range resources {
azureNames = append(azureNames, getAzureName(res))
azureNames = append(azureNames, res.AzureName())
}

return strings.Join(azureNames, "/")
Expand Down Expand Up @@ -201,13 +201,3 @@ func (r *Resolver) findGVK(owner *genruntime.ResourceReference) (schema.GroupVer

return ownerGvk, nil
}

// TODO: Remove this when we have proper AzureName defaulting on the way in
// getAzureName returns the specified AzureName, or else the name of the Kubernetes resource
func getAzureName(r genruntime.MetaObject) string {
if r.AzureName() == "" {
return r.GetName()
}

return r.AzureName()
}
Original file line number Diff line number Diff line change
Expand Up @@ -242,5 +242,5 @@ func Test_ResourceHierarchy_ResourceGroup_NestedResource(t *testing.T) {
rg, err := hierarchy.ResourceGroup()
g.Expect(err).ToNot(HaveOccurred())
g.Expect(rg).To(Equal(resourceGroupName))
g.Expect(hierarchy.FullAzureName()).To(Equal(fmt.Sprintf("%s/%s", getAzureName(hierarchy[1]), getAzureName(hierarchy[2]))))
g.Expect(hierarchy.FullAzureName()).To(Equal(fmt.Sprintf("%s/%s", hierarchy[1].AzureName(), hierarchy[2].AzureName())))
}

0 comments on commit f794832

Please sign in to comment.