Skip to content

Commit

Permalink
revert more
Browse files Browse the repository at this point in the history
  • Loading branch information
thesayyn committed Feb 22, 2024
1 parent 34e9aca commit c0c6e7e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
10 changes: 5 additions & 5 deletions pkg/crane/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ func getManifest(r string, opt ...Option) (*remote.Descriptor, error) {
return remote.Get(ref, o.Remote...)
}

// Get calls remote.Get and returns an uninterpreted response.
func Get(r string, opt ...Option) (*remote.Descriptor, error) {
return getManifest(r, opt...)
}

func getArtifact(r string, opt ...Option) (partial.Artifact, error) {
o := makeOptions(opt...)
ref, err := name.ParseReference(r, o.Name...)
Expand All @@ -46,6 +41,11 @@ func getArtifact(r string, opt ...Option) (partial.Artifact, error) {
return remote.Artifact(ref, o.Remote...)
}

// Get calls remote.Get and returns an uninterpreted response.
func Get(r string, opt ...Option) (*remote.Descriptor, error) {
return getManifest(r, opt...)
}

func Artifact(r string, opt ...Option) (partial.Artifact, error) {
return getArtifact(r, opt...)
}
Expand Down
12 changes: 0 additions & 12 deletions pkg/v1/remote/artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package remote
import (
"github.com/google/go-containerregistry/pkg/name"
"github.com/google/go-containerregistry/pkg/v1/partial"
"github.com/google/go-containerregistry/pkg/v1/types"
)

// Get returns a partial.Artifact for the given reference.
Expand All @@ -30,14 +29,3 @@ func Artifact(ref name.Reference, options ...Option) (partial.Artifact, error) {
}
return newPuller(o).Artifact(o.context, ref)
}

// Handle options and fetch the manifest with the acceptable MediaTypes in the
// Accept header.
func artifact(ref name.Reference, acceptable []types.MediaType, options ...Option) (partial.Artifact, error) {
o, err := makeOptions(append(options, WithAcceptableMediaTypes(acceptable))...)
if err != nil {
return nil, err
}

return newPuller(o).Artifact(o.context, ref)
}

0 comments on commit c0c6e7e

Please sign in to comment.