Skip to content

Commit

Permalink
fix: Use go object to do correct comparision on child repos
Browse files Browse the repository at this point in the history
`rootRepository` is a arg to the function and a string that has hostname
and path. Catalog() returns a slice of repositories, making the
HasPrefix check never work.

ref: GoogleCloudPlatform#38
  • Loading branch information
grumps committed Jul 29, 2021
1 parent 0b89326 commit 6303e39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/gcrcleaner/cleaner.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (c *Cleaner) ListChildRepositories(ctx context.Context, rootRepository stri

var childRepos = make([]string, 0, len(allRepos))
for _, repo := range allRepos {
if strings.HasPrefix(repo, rootRepository) {
if strings.HasPrefix(repo, rootRepo.RepositoryStr()) {
childRepos = append(childRepos, fmt.Sprintf("%s/%s", registry.Name(), repo))
}
}
Expand Down

0 comments on commit 6303e39

Please sign in to comment.