squashed format: _build_layer_json now static
This commit is contained in:
parent
844a960608
commit
75fa007c54
1 changed files with 3 additions and 3 deletions
|
@ -44,7 +44,7 @@ class SquashedDockerImage(TarImageFormatter):
|
|||
yield self.tar_folder(synthetic_image_id)
|
||||
|
||||
# Yield the JSON layer data.
|
||||
layer_json = self._build_layer_json(layer_json, synthetic_image_id)
|
||||
layer_json = SquashedDockerImage._build_layer_json(layer_json, synthetic_image_id)
|
||||
yield self.tar_file(synthetic_image_id + '/json', json.dumps(layer_json))
|
||||
|
||||
# Yield the VERSION file.
|
||||
|
@ -85,7 +85,8 @@ class SquashedDockerImage(TarImageFormatter):
|
|||
yield '\0' * 512
|
||||
|
||||
|
||||
def _build_layer_json(self, layer_json, synthetic_image_id):
|
||||
@staticmethod
|
||||
def _build_layer_json(layer_json, synthetic_image_id):
|
||||
updated_json = copy.deepcopy(layer_json)
|
||||
updated_json['id'] = synthetic_image_id
|
||||
|
||||
|
@ -99,4 +100,3 @@ class SquashedDockerImage(TarImageFormatter):
|
|||
updated_json['container_config']['Image'] = synthetic_image_id
|
||||
|
||||
return updated_json
|
||||
|
||||
|
|
Reference in a new issue