diff options
| author | Michal Arbet <michal.arbet@ultimum.io> | 2023-09-12 02:28:08 +0200 |
|---|---|---|
| committer | Michal Arbet <michal.arbet@ultimum.io> | 2023-09-21 11:01:21 +0200 |
| commit | b76bd4c6efa22af43d7895a7b5e95c75806d3893 (patch) | |
| tree | f9fcabc48ef5e6badbb0800a98c4cc605886eea9 /kolla/image/build.py | |
| parent | 4871ca4d6b83f6d28d790722eae52de5e56becee (diff) | |
| download | kolla-b76bd4c6efa22af43d7895a7b5e95c75806d3893.tar.gz kolla-b76bd4c6efa22af43d7895a7b5e95c75806d3893.zip | |
Add podman for image building
Add podman as an option to choose for container engine
for kolla-build (--engine podman)
Signed-off-by: Konstantin Yarovoy <konstantin.yarovoy@tietoevry.com>
Co-Authored-By: Michal Arbet <michal.arbet@ultimum.io>
Change-Id: I068c906df97745e397408d8c3ef6af47ee037638
Diffstat (limited to 'kolla/image/build.py')
| -rw-r--r-- | kolla/image/build.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/kolla/image/build.py b/kolla/image/build.py index 41cc11708..f75ca64c8 100644 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -106,7 +106,8 @@ def run_build(): if conf.debug: LOG.setLevel(logging.DEBUG) - if conf.engine not in (engine.Engine.DOCKER.value,): + if conf.engine not in (engine.Engine.DOCKER.value, + engine.Engine.PODMAN.value): LOG.error(f'Unsupported engine name "{conf.engine}", exiting.') sys.exit(1) LOG.info(f'Using engine: {conf.engine}') @@ -123,12 +124,21 @@ def run_build(): except AttributeError: LOG.error("Error, Docker Python library is too old, " "Try running 'pip install docker --upgrade'") - if conf.squash: squash_version = utils.get_docker_squash_version() LOG.info('Image squash is enabled and "docker-squash" version ' 'is %s', squash_version) + if conf.engine == engine.Engine.PODMAN.value: + try: + import podman + podman.__version__ + except ImportError: + LOG.error("Error, you have set podman as container engine, " + "but library is not found." + "Try running pip install podman") + exit(1) + kolla = KollaWorker(conf) kolla.setup_working_dir() kolla.find_dockerfiles() |
