removed some prefix methods from resource

This commit is contained in:
Natasha Sarkar
2021-02-01 17:29:19 -08:00
parent f71854a0c8
commit cd918483f9
2 changed files with 1 additions and 19 deletions

View File

@@ -151,7 +151,7 @@ type ResMap interface {
// an exact match, returning an error on multiple or no matches.
GetByCurrentId(resid.ResId) (*resource.Resource, error)
// GetByPreviousId is shorthand for calling
// GetById is shorthand for calling
// GetMatchingResourcesByAnyId with a matcher requiring
// an exact match, returning an error on multiple or no matches.
GetById(resid.ResId) (*resource.Resource, error)

View File

@@ -282,24 +282,6 @@ func (r *Resource) appendCsvAnnotation(name, value string) {
r.SetAnnotations(annotations)
}
// Implements ResCtx GetOutermostNamePrefix
func (r *Resource) GetOutermostNamePrefix() string {
namePrefixes := r.GetNamePrefixes()
if len(namePrefixes) == 0 {
return ""
}
return namePrefixes[len(namePrefixes)-1]
}
// Implements ResCtx GetOutermostNameSuffix
func (r *Resource) GetOutermostNameSuffix() string {
nameSuffixes := r.GetNameSuffixes()
if len(nameSuffixes) == 0 {
return ""
}
return nameSuffixes[len(nameSuffixes)-1]
}
func SameEndingSubarray(shortest, longest []string) bool {
if len(shortest) > len(longest) {
longest, shortest = shortest, longest