|
|
|
@ -31,6 +31,7 @@ import (
|
|
|
|
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
|
|
|
|
"github.com/pkg/errors"
|
|
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
|
errdef "oras.land/oras-go/pkg/content"
|
|
|
|
|
orascontext "oras.land/oras-go/pkg/context"
|
|
|
|
|
"oras.land/oras-go/pkg/registry"
|
|
|
|
|
|
|
|
|
@ -135,6 +136,9 @@ func parseReference(raw string) (registry.Reference, error) {
|
|
|
|
|
}
|
|
|
|
|
parts := strings.Split(raw, ":")
|
|
|
|
|
if len(parts) > 1 && !strings.Contains(parts[len(parts)-1], "/") {
|
|
|
|
|
if len(digest) > 0 {
|
|
|
|
|
return registry.Reference{}, fmt.Errorf("%w: specify digest or version", errdef.ErrInvalidReference)
|
|
|
|
|
}
|
|
|
|
|
tag := parts[len(parts)-1]
|
|
|
|
|
|
|
|
|
|
if tag != "" {
|
|
|
|
|