Skip to content

Commit

Permalink
fix: add the version info in the index oci url to differentiate index…
Browse files Browse the repository at this point in the history
… versions
  • Loading branch information
SparkYuan committed Apr 19, 2024
1 parent abc3596 commit 36effa3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/oci/client/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ func (c *Client) Push(
metadata meta.Metadata,
ignorePaths []string,
) (string, string, error) {
ref, err := oci.ParseArtifactRef(ociURL)
idxURL := fmt.Sprintf("%s:%s", ociURL, version)
ref, err := oci.ParseArtifactRef(idxURL)
if err != nil {
return "", "", fmt.Errorf("invalid OCI repository url: %w", err)
}
Expand Down Expand Up @@ -159,7 +160,7 @@ func (c *Client) Push(

idxDigestURL := ref.Context().Digest(idxDigest.String()).String()
imgDigestURL := ref.Context().Digest(imgDigest.String()).String()
idxURL := fmt.Sprintf("%s%s", oci.OCIRepositoryPrefix, idxDigestURL)
idxURL = fmt.Sprintf("%s%s", oci.OCIRepositoryPrefix, idxDigestURL)
imgURL = fmt.Sprintf("%s%s", oci.OCIRepositoryPrefix, imgDigestURL)
return idxURL, imgURL, nil
}

0 comments on commit 36effa3

Please sign in to comment.