fix(images): create tags from RepoDigests when no tags are available (#1522)

pull/1988/head
Duvel 7 years ago committed by Anthony Lapenna
parent 61c74e22f0
commit f8370a1421

@ -20,6 +20,17 @@ angular.module('portainer.docker')
return deferred.promise;
};
function replaceEmptyTagsWhenPossible(item) {
if (!item.RepoTags && item.RepoDigests) {
item.RepoTags = [];
for (var iDigest = 0; iDigest < item.RepoDigests.length; iDigest++) {
var digest = item.RepoDigests[iDigest];
var repository = digest.substring(0, digest.indexOf('@'));
item.RepoTags.push(repository + ':<none>');
}
}
}
service.images = function(withUsage) {
var deferred = $q.defer();
@ -38,6 +49,7 @@ angular.module('portainer.docker')
item.ContainerCount++;
}
}
replaceEmptyTagsWhenPossible(item);
return new ImageViewModel(item);
});

Loading…
Cancel
Save