mirror of
https://github.com/Quiq/docker-registry-ui.git
synced 2025-07-19 16:46:58 +00:00
Add more error logging
This commit is contained in:
parent
b8faa4b9b1
commit
c4a70ba1df
3
Makefile
3
Makefile
@ -13,5 +13,8 @@ build:
|
|||||||
public:
|
public:
|
||||||
docker buildx build ${NOCACHE} --platform linux/amd64,linux/arm64 -t ${IMAGE}:${VERSION} -t ${IMAGE}:latest --push .
|
docker buildx build ${NOCACHE} --platform linux/amd64,linux/arm64 -t ${IMAGE}:${VERSION} -t ${IMAGE}:latest --push .
|
||||||
|
|
||||||
|
debug:
|
||||||
|
docker buildx build ${NOCACHE} --platform linux/amd64,linux/arm64 -t ${IMAGE}:debug --push .
|
||||||
|
|
||||||
test:
|
test:
|
||||||
docker buildx build ${NOCACHE} --platform linux/amd64 -t docker.quiq.im/registry-ui:test -t docker.quiq.sh/registry-ui:test --push .
|
docker buildx build ${NOCACHE} --platform linux/amd64 -t docker.quiq.im/registry-ui:test -t docker.quiq.sh/registry-ui:test --push .
|
||||||
|
@ -205,7 +205,11 @@ func (c *Client) GetImageInfo(imageRef string) (ImageInfo, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ii.IsImage {
|
if ii.IsImage {
|
||||||
img, _ := descr.Image()
|
img, err := descr.Image()
|
||||||
|
if err != nil {
|
||||||
|
c.logger.Errorf("Cannot convert descriptor to Image for image reference %s: %s", imageRef, err)
|
||||||
|
return ImageInfo{}, err
|
||||||
|
}
|
||||||
cfg, err := img.ConfigFile()
|
cfg, err := img.ConfigFile()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.logger.Errorf("Cannot fetch ConfigFile for image reference %s: %s", imageRef, err)
|
c.logger.Errorf("Cannot fetch ConfigFile for image reference %s: %s", imageRef, err)
|
||||||
@ -228,7 +232,11 @@ func (c *Client) GetImageInfo(imageRef string) (ImageInfo, error) {
|
|||||||
// In case of Image Index, if we request for Image() > ConfigFile(), it will be resolved
|
// In case of Image Index, if we request for Image() > ConfigFile(), it will be resolved
|
||||||
// to a config of one of the manifests (one of the platforms).
|
// to a config of one of the manifests (one of the platforms).
|
||||||
// It doesn't make a lot of sense, even they are usually identical. Also extra API calls which slows things down.
|
// It doesn't make a lot of sense, even they are usually identical. Also extra API calls which slows things down.
|
||||||
imgIdx, _ := descr.ImageIndex()
|
imgIdx, err := descr.ImageIndex()
|
||||||
|
if err != nil {
|
||||||
|
c.logger.Errorf("Cannot convert descriptor to ImageIndex for image reference %s: %s", imageRef, err)
|
||||||
|
return ImageInfo{}, err
|
||||||
|
}
|
||||||
IdxMf, _ := imgIdx.IndexManifest()
|
IdxMf, _ := imgIdx.IndexManifest()
|
||||||
platforms := []string{}
|
platforms := []string{}
|
||||||
for _, m := range IdxMf.Manifests {
|
for _, m := range IdxMf.Manifests {
|
||||||
@ -271,7 +279,11 @@ func (c *Client) GetImageCreated(imageRef string) time.Time {
|
|||||||
return *zeroTime
|
return *zeroTime
|
||||||
}
|
}
|
||||||
// In case of ImageIndex, it is resolved to a random sub-image which should be fine.
|
// In case of ImageIndex, it is resolved to a random sub-image which should be fine.
|
||||||
img, _ := descr.Image()
|
img, err := descr.Image()
|
||||||
|
if err != nil {
|
||||||
|
c.logger.Errorf("Cannot convert descriptor to Image for image reference %s: %s", imageRef, err)
|
||||||
|
return *zeroTime
|
||||||
|
}
|
||||||
cfg, err := img.ConfigFile()
|
cfg, err := img.ConfigFile()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.logger.Errorf("Cannot fetch ConfigFile for image reference %s: %s", imageRef, err)
|
c.logger.Errorf("Cannot fetch ConfigFile for image reference %s: %s", imageRef, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user