From e5055763f60960880e9eaa649c847eb03549dcd1 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Fri, 19 Sep 2014 12:54:52 -0400 Subject: [PATCH] Make the squashed path smaller and handle failure cases on the curl side --- application.py | 2 +- endpoints/verbs.py | 2 +- static/js/controllers.js | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/application.py b/application.py index c11d8e9dc..e7f8548f8 100644 --- a/application.py +++ b/application.py @@ -44,7 +44,7 @@ application.register_blueprint(callback, url_prefix='/oauth2') application.register_blueprint(index, url_prefix='/v1') application.register_blueprint(tags, 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(webhooks, url_prefix='/webhooks') application.register_blueprint(realtime, url_prefix='/realtime') diff --git a/endpoints/verbs.py b/endpoints/verbs.py index 8cc421098..91b9f30a9 100644 --- a/endpoints/verbs.py +++ b/endpoints/verbs.py @@ -53,7 +53,7 @@ def _write_synthetic_image_to_storage(linked_storage_uuid, linked_locations, que done_uploading.save() -@verbs.route('////squash', methods=['GET']) +@verbs.route('/squash///', methods=['GET']) @process_auth def get_squashed_tag(namespace, repository, tag): permission = ReadRepositoryPermission(namespace, repository) diff --git a/static/js/controllers.js b/static/js/controllers.js index d4ef7fe56..789b07b10 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -422,9 +422,8 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi }); if ($scope.currentTag) { - var squash = 'curl ' + Config.getHost('ACCOUNTNAME:PASSWORDORTOKEN'); - squash += '/verbs/v1/repositories/' + namespace + '/' + name + '/'; - squash += $scope.currentTag.name + '/squash'; + var squash = 'curl -f ' + Config.getHost('ACCOUNTNAME:PASSWORDORTOKEN'); + squash += '/c1/squash/' + namespace + '/' + name + '/' + $scope.currentTag.name; squash += ' | docker load'; $scope.pullCommands.push({