diff --git a/pkg/cmd/export/cmd.go b/pkg/cmd/export/cmd.go index 5e02e574..436614b1 100644 --- a/pkg/cmd/export/cmd.go +++ b/pkg/cmd/export/cmd.go @@ -97,7 +97,7 @@ func runCommand(opts *exportOptions) func(*cobra.Command, []string) { } store, err := getStoreForRef(cmd.Context(), opts) if err != nil { - ref := repo.StripRepository(opts.modelRef.String()) + ref := repo.FormatRepositoryForDisplay(opts.modelRef.String()) output.Fatalf("Failed to find reference %s: %s", ref, err) } diff --git a/pkg/cmd/list/list.go b/pkg/cmd/list/list.go index b0102912..8c699381 100644 --- a/pkg/cmd/list/list.go +++ b/pkg/cmd/list/list.go @@ -63,7 +63,7 @@ func getManifestInfoLine(repository string, desc ocispec.Descriptor, manifest *o } // Strip localhost from repo if present, since we added it - repository = repo.StripRepository(repository) + repository = repo.FormatRepositoryForDisplay(repository) if repository == "" { repository = "" } diff --git a/pkg/lib/repo/repo.go b/pkg/lib/repo/repo.go index 663df046..807be49f 100644 --- a/pkg/lib/repo/repo.go +++ b/pkg/lib/repo/repo.go @@ -75,9 +75,9 @@ func DefaultReference() *registry.Reference { } } -// StripRepository removes default values from a repository string to avoid surfacing defaulted fields +// FormatRepositoryForDisplay removes default values from a repository string to avoid surfacing defaulted fields // when displaying references, which may be confusing. -func StripRepository(repo string) string { +func FormatRepositoryForDisplay(repo string) string { repo = strings.TrimPrefix(repo, DefaultRegistry+"/") repo = strings.TrimPrefix(repo, DefaultRepository) return repo