Fix the order and number of arguments for squashing/ACI

This commit is contained in:
Jake Moshenko 2017-01-11 15:16:49 -05:00
parent a6ae770b77
commit fe9f97cd0e
2 changed files with 4 additions and 5 deletions

View file

@ -31,7 +31,7 @@ verbs = Blueprint('verbs', __name__)
license_validator.enforce_license_before_request(verbs) license_validator.enforce_license_before_request(verbs)
def _open_stream(formatter, namespace, repository, tag, derived_image_id, repo_image, handlers): def _open_stream(formatter, repo_image, tag, derived_image_id, handlers):
""" """
This method generates a stream of data which will be replicated and read from the queue files. This method generates a stream of data which will be replicated and read from the queue files.
This method runs in a separate process. This method runs in a separate process.
@ -56,8 +56,7 @@ def _open_stream(formatter, namespace, repository, tag, derived_image_id, repo_i
logger.debug('Returning image layer %s: %s', current_image.image_id, current_image_path) logger.debug('Returning image layer %s: %s', current_image.image_id, current_image_path)
yield current_image_stream yield current_image_stream
stream = formatter.build_stream(namespace, repository, tag, repo_image, derived_image_id, stream = formatter.build_stream(repo_image, tag, derived_image_id, get_next_image, get_next_layer)
get_next_image, get_next_layer)
for handler_fn in handlers: for handler_fn in handlers:
stream = wrap_with_handler(stream, handler_fn) stream = wrap_with_handler(stream, handler_fn)
@ -259,7 +258,7 @@ def _repo_verb(namespace, repository, tag, verb, formatter, sign=False, checker=
# Create a queue process to generate the data. The queue files will read from the process # Create a queue process to generate the data. The queue files will read from the process
# and send the results to the client and storage. # and send the results to the client and storage.
handlers = [hasher.update] handlers = [hasher.update]
args = (formatter, namespace, repository, tag, derived_image_id, repo_image, handlers) args = (formatter, repo_image, tag, derived_image_id, handlers)
queue_process = QueueProcess(_open_stream, queue_process = QueueProcess(_open_stream,
8 * 1024, 10 * 1024 * 1024, # 8K/10M chunk/max 8 * 1024, 10 * 1024 * 1024, # 8K/10M chunk/max
args, finished=_store_metadata_and_cleanup) args, finished=_store_metadata_and_cleanup)

View file

@ -31,8 +31,8 @@ class AppCImageFormatter(TarImageFormatter):
# Yield the manifest. # Yield the manifest.
manifest = json.dumps(DockerV1ToACIManifestTranslator.build_manifest( manifest = json.dumps(DockerV1ToACIManifestTranslator.build_manifest(
tag,
repo_image, repo_image,
tag,
synthetic_image_id synthetic_image_id
)) ))
yield self.tar_file('manifest', manifest, mtime=image_mtime) yield self.tar_file('manifest', manifest, mtime=image_mtime)