grim/tagpull
Clone
Summary
Browse
Changes
Graph
Update the annotation tag
draft
2020-07-05, Gary Kramlich
33f8b28b8dc3
Update the annotation tag
package
main
import
(
"strings"
"github.com/heroku/docker-registry-client/registry"
)
func
registryGetDigest
(
repository
,
tag
string
)
(
string
,
error
)
{
reg
,
err
:=
registry
.
New
(
"https://index.docker.io"
,
""
,
""
)
if
err
!=
nil
{
return
""
,
err
}
// make sure the repository doesn't have a tag
repository
=
strings
.
SplitN
(
repository
,
":"
,
2
)[
0
]
// disable the logger on the registry
reg
.
Logf
=
func
(
format
string
,
args
...
interface
{})
{}
manifest
,
err
:=
reg
.
ManifestV2
(
repository
,
tag
)
if
err
!=
nil
{
return
""
,
err
}
return
manifest
.
Config
.
Digest
.
String
(),
nil
}