Skip to content

Commit

Permalink
Add import image
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejbrown committed Oct 8, 2024
1 parent 8932cca commit 9861d1e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion buildrunner/docker/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
with the terms of the Adobe license agreement accompanying it.
"""

import python_on_whales
import yaml

import docker
import docker.errors

from buildrunner.config import BuildRunnerConfig
from buildrunner.docker import new_client
from buildrunner.errors import BuildRunnerProcessingError
from buildrunner.utils import is_dict
Expand Down Expand Up @@ -41,7 +43,11 @@ def import_image(self):
"""

try:
import_return = self.docker_client.import_image(self.src)
import_return = None
if BuildRunnerConfig.get_instance().run_config.use_legacy_builder:
import_return = self.docker_client.import_image(self.src)
else:
import_return = python_on_whales.docker.import_(self.src)
except docker.errors.APIError as apie:
raise BuildRunnerProcessingError(
f"Error importing image from archive file {self.src}: {apie}"
Expand Down

0 comments on commit 9861d1e

Please sign in to comment.