Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
pkg/cache: skip creating reverse URL files for oci
Browse files Browse the repository at this point in the history
Signed-off-by: Akihiro Suda <[email protected]>
  • Loading branch information
AkihiroSuda committed Jul 25, 2023
1 parent 78998c1 commit eb41d6b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ func (c *Cache) writeMetadataFiles(sha256sum string, u *url.URL, m *Metadata) er
return fmt.Errorf("failed to create %q: %w", metadataFileAbs, err)
}
}
if u != nil {
if u != nil && u.Scheme != "oci" && !strings.HasPrefix(u.Scheme, "oci+") {
revURLFileAbs, err := c.ReverseURLFileAbsPath(u)
if err != nil {
return err
Expand Down Expand Up @@ -432,6 +432,9 @@ func (c *Cache) MetadataBySHA256(sha256sum string) (*Metadata, error) {
// Not always available.
// Do not use this unless you are sure that the URL is unique.
func (c *Cache) SHA256ByOriginURL(u *url.URL) (string, error) {
if u.Scheme == "oci" || strings.HasPrefix(u.Scheme, "oci+") {
return "", fmt.Errorf("oci URL scheme is not supported")
}
revUrlFileAbs, err := c.ReverseURLFileAbsPath(u)
if err != nil {
return "", err
Expand Down

0 comments on commit eb41d6b

Please sign in to comment.