def get_layers(self, content_retriever): """ Returns the layers of this manifest, from base to leaf or None if this kind of manifest does not support layers. """ for layer in self.layers: created_datetime = None try: created_datetime = dateutil.parser.parse( layer.v1_metadata.created).replace(tzinfo=None) except: pass yield ManifestImageLayer( layer_id=layer.v1_metadata.image_id, compressed_size=layer.compressed_size, is_remote=False, urls=None, command=layer.v1_metadata.command, comment=layer.v1_metadata.comment, author=layer.v1_metadata.author, blob_digest=layer.digest, created_datetime=created_datetime, internal_layer=layer, )
def get_layers(self, content_retriever): """ Returns the layers of this manifest, from base to leaf or None if this kind of manifest does not support layers. """ for image_layer in self._manifest_image_layers(content_retriever): is_remote = image_layer.blob_layer.is_remote if image_layer.blob_layer else False urls = image_layer.blob_layer.urls if image_layer.blob_layer else None yield ManifestImageLayer( layer_id=image_layer.v1_id, compressed_size=image_layer.compressed_size, is_remote=is_remote, urls=urls, command=image_layer.history.command, blob_digest=image_layer.blob_digest, created_datetime=image_layer.history.created_datetime, author=image_layer.history.author, comment=image_layer.history.comment, internal_layer=image_layer, )