Merge pull request #1760 from balena-os/images-local-mode

Fix regression with local mode push
This commit is contained in:
bulldozer-balena[bot] 2021-08-02 16:34:08 +00:00 committed by GitHub
commit 57fc32e436
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -674,7 +674,9 @@ function saveAndRemoveImages(
(svc) =>
_.find(availableImages, {
dockerImageId: svc.config.image,
name: svc.imageName,
// There is no 1-1 mapping between services and images
// on disk, so the only way to compare is by imageId
imageId: svc.imageId,
}) ?? _.find(availableImages, { dockerImageId: svc.config.image }),
),
) as imageManager.Image[];

View File

@ -80,7 +80,7 @@ export function getRegistryAndName(uri: string): ImageNameParts {
// Normalise an image name to always have a tag, with :latest being the default
export function normaliseImageName(image: string) {
const { registry, imageName, tagName, digest } = getRegistryAndName(image);
const repository = [registry, imageName].join('/');
const repository = [registry, imageName].filter((s) => !!s).join('/');
if (!digest) {
return [repository, tagName || 'latest'].join(':');