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 4614439
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/oci/client/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ func (c *Client) Push(
metadata meta.Metadata,
ignorePaths []string,
) (string, string, error) {

Check failure on line 40 in pkg/oci/client/push.go

View workflow job for this annotation

GitHub Actions / Golang Lint

unnecessary leading newline (whitespace)
ref, err := oci.ParseArtifactRef(ociURL)

Check failure on line 41 in pkg/oci/client/push.go

View workflow job for this annotation

GitHub Actions / Golang Lint

File is not `gofumpt`-ed (gofumpt)
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 +161,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 4614439

Please sign in to comment.