mirror of
https://github.com/containers/skopeo.git
synced 2025-08-10 10:52:30 +00:00
ping before trying to pull
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
74a06ac414
commit
f34af0b7aa
22
inspect.go
22
inspect.go
@ -125,20 +125,14 @@ func getData(ref reference.Named, authConfig types.AuthConfig) (*imageInspect, e
|
|||||||
)
|
)
|
||||||
|
|
||||||
for _, endpoint := range endpoints {
|
for _, endpoint := range endpoints {
|
||||||
// TODO(runcom):
|
// make sure I can reach the registry, same as docker pull does
|
||||||
//
|
v1endpoint, err := endpoint.ToV1Endpoint(nil)
|
||||||
// always try to login first so the registry is pinged and we can return timeout
|
if err != nil {
|
||||||
// instead of trying every v version (like push,pull and others do in docker)
|
return nil, err
|
||||||
//
|
}
|
||||||
//./skopeo --debug --username runcom --password 20121990cia0@! myreg.com:4000/rhel7
|
if _, err := v1endpoint.Ping(); err != nil {
|
||||||
//DEBU[0000] hostDir: /etc/docker/certs.d/https:/index.docker.io/v1
|
return nil, err
|
||||||
//FATA[0000] open /etc/docker/certs.d/https:/index.docker.io/v1: permission denied
|
}
|
||||||
//
|
|
||||||
//status, err := registryService.Auth(&authConfig)
|
|
||||||
//if err != nil {
|
|
||||||
//return nil, err
|
|
||||||
//}
|
|
||||||
//logrus.Debug(status)
|
|
||||||
|
|
||||||
if confirmedV2 && endpoint.Version == registry.APIVersion1 {
|
if confirmedV2 && endpoint.Version == registry.APIVersion1 {
|
||||||
logrus.Debugf("Skipping v1 endpoint %s because v2 registry was detected", endpoint.URL)
|
logrus.Debugf("Skipping v1 endpoint %s because v2 registry was detected", endpoint.URL)
|
||||||
|
Loading…
Reference in New Issue
Block a user