Skip to content

Commit

Permalink
Merge branch 'crosbymichael-master' into crosbymichael-dist
Browse files Browse the repository at this point in the history
  • Loading branch information
kevana committed Dec 15, 2015
2 parents 106b0f3 + 2f003a5 commit d4cfa11
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion app/components/image/imageController.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,29 @@ angular.module('image', [])
return defer.promise;
}

/**
* Get RepoTags from the /images/query endpoint instead of /image/json,
* for backwards compatibility with Docker API versions older than 1.21
* @param {string} imageId
*/
function getRepoTags(imageId) {
Image.query({}, function (d) {
d.forEach(function(image) {
if (image.Id === imageId && image.RepoTags[0] !== '<none>:<none>') {
$scope.RepoTags = image.RepoTags;
}
});
});
}

Image.get({id: $routeParams.id}, function (d) {
$scope.image = d;
$scope.id = d.Id;
$scope.RepoTags = d.RepoTags;
if (d.RepoTags) {
$scope.RepoTags = d.RepoTags;
} else {
getRepoTags($scope.id);
}

getContainersFromImage($q, Container, $scope.id).then(function (containers) {
LineChart.build('#containers-started-chart', containers, function (c) {
Expand Down

0 comments on commit d4cfa11

Please sign in to comment.