Make the squashed path smaller and handle failure cases on the curl side

This commit is contained in:
Joseph Schorr 2014-09-19 12:54:52 -04:00
parent 9003670826
commit e5055763f6
3 changed files with 4 additions and 5 deletions

View file

@ -44,7 +44,7 @@ application.register_blueprint(callback, url_prefix='/oauth2')
application.register_blueprint(index, url_prefix='/v1') application.register_blueprint(index, url_prefix='/v1')
application.register_blueprint(tags, url_prefix='/v1') application.register_blueprint(tags, url_prefix='/v1')
application.register_blueprint(registry, url_prefix='/v1') application.register_blueprint(registry, url_prefix='/v1')
application.register_blueprint(verbs, url_prefix='/verbs/v1/repositories') application.register_blueprint(verbs, url_prefix='/c1')
application.register_blueprint(api_bp, url_prefix='/api') application.register_blueprint(api_bp, url_prefix='/api')
application.register_blueprint(webhooks, url_prefix='/webhooks') application.register_blueprint(webhooks, url_prefix='/webhooks')
application.register_blueprint(realtime, url_prefix='/realtime') application.register_blueprint(realtime, url_prefix='/realtime')

View file

@ -53,7 +53,7 @@ def _write_synthetic_image_to_storage(linked_storage_uuid, linked_locations, que
done_uploading.save() done_uploading.save()
@verbs.route('/<namespace>/<repository>/<tag>/squash', methods=['GET']) @verbs.route('/squash/<namespace>/<repository>/<tag>', methods=['GET'])
@process_auth @process_auth
def get_squashed_tag(namespace, repository, tag): def get_squashed_tag(namespace, repository, tag):
permission = ReadRepositoryPermission(namespace, repository) permission = ReadRepositoryPermission(namespace, repository)

View file

@ -422,9 +422,8 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi
}); });
if ($scope.currentTag) { if ($scope.currentTag) {
var squash = 'curl ' + Config.getHost('ACCOUNTNAME:PASSWORDORTOKEN'); var squash = 'curl -f ' + Config.getHost('ACCOUNTNAME:PASSWORDORTOKEN');
squash += '/verbs/v1/repositories/' + namespace + '/' + name + '/'; squash += '/c1/squash/' + namespace + '/' + name + '/' + $scope.currentTag.name;
squash += $scope.currentTag.name + '/squash';
squash += ' | docker load'; squash += ' | docker load';
$scope.pullCommands.push({ $scope.pullCommands.push({