Commit Graph

1066 Commits

Author SHA1 Message Date
Povilas Kanapickas
2ed50b9538 Merge pull request #1258 from mokibit/add-env-var-interpolation-to-keys
Implement environment variable interpolation to YAML dictionary keys
2025-07-01 00:15:05 +03:00
Monika Kairaityte
e97d446a04 Implement environment variable interpolation to YAML dictionary keys
`podman-compose` currently does not support interpolating environment
variables in dictionary keys, despite the compose file specification
indicating this capability.
See the relevant compose-spec documentation:
https://github.com/compose-spec/compose-spec/blob/main/12-interpolation.md

This feature is useful in `labels` or `environment` sections, where keys
can be user-defined strings. To enable interpolation, an alternate equal
sign syntax must be used, e.g.:
services:
  foo:
    labels:
      - "$VAR_NAME=label_value"

After this PR `podman-compose` will align more closely with the compose
file specification, allowing for the interpolation of environment
variables in dictionary keys.

Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-06-30 23:54:27 +03:00
Povilas Kanapickas
9fe6e7f284 Merge pull request #1253 from whym/yaml-parse-error
Hide stack trace shown on YAML parse error by default
2025-06-30 16:06:11 +03:00
Yusuke Matsubara
764efd360c Hide stack trace shown on YAML parse error by default
Fixes https://github.com/containers/podman-compose/issues/1139

Signed-off-by: Yusuke Matsubara <whym@whym.org>
2025-06-30 15:33:25 +03:00
Povilas Kanapickas
b06224389e Merge pull request #1257 from astrojuanlu/migrate-pep-621
Migrate to PEP 621
2025-06-30 15:31:10 +03:00
Juan Luis Cano Rodríguez
0e37b31e45 Adapt release script
Signed-off-by: Juan Luis Cano Rodríguez <hello@juanlu.space>
2025-06-29 20:57:28 +02:00
Juan Luis Cano Rodríguez
3918f7e5f8 Add requires-python lower boundary
Signed-off-by: Juan Luis Cano Rodríguez <hello@juanlu.space>
2025-06-29 20:57:28 +02:00
Juan Luis Cano Rodríguez
d7cd02e3e9 Migrate to SPDX identifier for the license
Signed-off-by: Juan Luis Cano Rodríguez <hello@juanlu.space>
2025-06-29 20:57:28 +02:00
Juan Luis Cano Rodríguez
05f341b3c5 Python 2 is EOL
Signed-off-by: Juan Luis Cano Rodríguez <hello@juanlu.space>
2025-06-29 20:57:28 +02:00
Juan Luis Cano Rodríguez
f8d05babd7 Migrate to PEP 621
Signed-off-by: Juan Luis Cano Rodríguez <hello@juanlu.space>
2025-06-29 20:57:28 +02:00
Povilas Kanapickas
8eb55735e9 Merge pull request #1250 from mokibit/fix-formatting-systemd-cmd-help
Fix formatting of description and help of `systemd` command
2025-06-27 11:22:02 +03:00
Cleber Rosa
1c0c63aaf2 Fix formatting of description of systemd command
When running "podman-compose", the list of commands gets displayed.
The "systemd" command is an outlier, showing multiple lines, unintended
at this location.

This change moves the longer command description to its proper place,
that is, it gets shown when "podman-compose systemd --help" is
executed.

Signed-off-by: Cleber Rosa <crosa@redhat.com
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-06-27 11:15:34 +03:00
Cleber Rosa
2f8dbdcd09 Remove assignment to variable that gets overriden and never used
Signed-off-by: Cleber Rosa <crosa@redhat.com>
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-06-26 20:54:54 +03:00
Povilas Kanapickas
e789d98bf0 Merge pull request #1249 from p12tic/update-contributing
Update CONTRIBUTING.md
2025-06-26 14:59:42 +03:00
Povilas Kanapickas
0de04b32bb CONTRIBUTING: Suggest contributors to split their commits
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-06-26 14:37:43 +03:00
Povilas Kanapickas
d864e195ce CONTRIBUTING: Update instructions on commit message
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-06-26 14:37:41 +03:00
Povilas Kanapickas
96ec9617f1 CONTRIBUTING: Update instructions for creating virtualenv
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-06-26 14:37:35 +03:00
Povilas Kanapickas
b48317c22b Merge pull request #1248 from mokibit/add-short-syntax-for-env-variables
Implement short syntax for env variables in compose.yml "environment:"
2025-06-26 14:21:52 +03:00
Monika Kairaityte
0cbf70a4e9 Implement short syntax for env variables in compose.yml "environment:"
This commit allows compose file to directly use environment variable
values in "environment:" section when variables were set in `.env` file.
This functionality was missing, as docker-compose supports both: short
and variable interpolation syntax forms:
environment:
	- FOO
and
environment:
	- FOO=${FOO}
Relevant docker-compose documentation:
https://docs.docker.com/compose/how-tos/environment-variables/set-environment-variables/
podman-compose is more compatible with docker-compose after this change.

Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-06-26 12:40:39 +03:00
Povilas Kanapickas
7105198ae1 Merge pull request #1247 from whym/log-formatter-bug
Fixes #1237: Remove unnecessary 'or "text"'
2025-06-25 22:45:13 +03:00
Yusuke Matsubara
8f9f6d0657 Remove unnecessary 'or "text"'
Fixes #1237

Signed-off-by: Yusuke Matsubara <whym@whym.org>
2025-06-25 21:53:34 +09:00
Povilas Kanapickas
61392e9cba Merge pull request #1243 from mokibit/fix-dockerfile-definition
Fix dockerfile definition if directory name ends with ".git"
2025-06-17 19:53:15 +03:00
Monika Kairaityte
dd471c8918 Fix dockerfile definition if directory name ends with ".git"
After changes in 92f0a8583a, the
dockerfile parameter is igored if the (local) work directory's name ends
in `.git`.
This commit fixes the regression and adds more tests.

Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-06-17 19:43:29 +03:00
Povilas Kanapickas
1113c833da Merge pull request #1242 from uosis/docker-compat
Add docker_compose_compat setting
2025-06-16 12:04:47 +03:00
Uosis
4177bae807 Add docker_compose_compat setting
Signed-off-by: Uosis <uosisl+github@gmail.com>
2025-06-15 18:31:06 -06:00
Povilas Kanapickas
fa2252801a Merge pull request #1241 from uosis/name-separator
Add support for using hyphens for name separation
2025-06-15 21:04:19 +03:00
Uosis
6635b8b570 cleanup bool parsing
Signed-off-by: Uosis <uosisl+github@gmail.com>
2025-06-13 19:20:09 -06:00
Uosis
8f55227167 add name_separator_compat
Signed-off-by: Uosis <uosisl+github@gmail.com>
2025-06-13 19:20:09 -06:00
Povilas Kanapickas
9cde3993f2 Merge pull request #1238 from uosis/env-var-override
Add support for providing x-podman settings using environment variables
2025-06-11 22:38:25 +03:00
Povilas Kanapickas
04155d0d09 Add documentation for env variables
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-06-11 22:31:56 +03:00
uosis
605495233e allow overriding x-podman using env vars 2025-06-11 22:27:45 +03:00
Povilas Kanapickas
3e579f65f0 Merge pull request #1235 from p12tic/readme
Update README
2025-06-05 18:34:40 +03:00
Povilas Kanapickas
034b86ea73 README: Remove basic usage section
There are plenty of resources on compose format, no need to repeat
anything. Beginners won't be helped by the examples and experienced
users will look into better places anyway.

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-06-05 18:24:19 +03:00
Povilas Kanapickas
bbdb63604e README: Update section on tests
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-06-05 18:24:18 +03:00
Povilas Kanapickas
93371b0f4e README: Merge all repositories under single section
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-06-05 18:24:17 +03:00
Povilas Kanapickas
27d1fc67a0 README: Add installation instructions on Debian
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-06-05 18:24:16 +03:00
Povilas Kanapickas
77bc9c5602 Merge pull request #1234 from p12tic/release-notes
Release notes for 1.4.1
2025-06-05 17:20:19 +03:00
Povilas Kanapickas
82dd0acab2 Release notes for 1.4.1
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-06-05 17:12:49 +03:00
Povilas Kanapickas
0e4f686f4b Merge pull request #1231 from mokibit/fix-volume-bind-source
Fix relative host path resolution for volume bind mount source
2025-06-05 16:56:18 +03:00
Monika Kairaityte
0491269f53 Fix relative host path resolution for volume bind mount source
e03d675b9b broke relative host path
resolution by deleting os.chdir(). After this commit current working
directory is not relevant anymore.

Fixes e03d675b9b.

Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-06-05 16:46:07 +03:00
Povilas Kanapickas
ee90712843 Merge pull request #1210 from jarovo/main
Add relabel option to secrets
2025-06-05 13:02:18 +03:00
Jaroslav Henner
82d7622c45 Add relabel option to secrets
On selinux enabled system, the secrets cannot be read without proper
relabeling or correct policy being set.

This patch enables user to instruc podman-copose to use :z or :Z podman
volume options to make podman relabel the file under bind-mount.

More info here:
https://unix.stackexchange.com/questions/728801/host-wide-consequences-of-setting-selinux-z-z-option-on-container-bind-mounts?rq=1

Signed-off-by: Jaroslav Henner <1187265+jarovo@users.noreply.github.com>
2025-06-05 00:13:58 +02:00
Povilas Kanapickas
4c6df85efa Merge pull request #1224 from p12tic/podman-label
Expose io.podman.compose.service label
2025-05-29 22:18:42 +03:00
Povilas Kanapickas
7b3276e5d7 Expose io.podman.compose.service label
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-29 22:01:35 +03:00
Povilas Kanapickas
fc6bfc9931 Merge pull request #1223 from p12tic/github-mypy
.github: Run mypy as part of checks
2025-05-29 21:38:59 +03:00
Povilas Kanapickas
949af2a50c .github: Run mypy as part of checks
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2025-05-29 21:23:21 +03:00
Povilas Kanapickas
b650efbb33 Merge pull request #1222 from mokibit/print-full-dockerfile-path
Print full Dockerfile path instead of context on error
2025-05-28 17:34:45 +03:00
Monika Kairaityte
0b8b483cb7 Print full dockerfile path instead of context on error
Current error message does not provide the exact path where the
Dockerfile is being searched.

This commit distinguishes two types of errors when Dockerfile is not
found in build context:
- when the context does not have provided custom-named Dockerfile, the
path in the error message is absolute: "OSError: Dockerfile not found in
.../podman-compose/tests/integration/build_fail/context_no_file/custom-named-Dockerfile"
- when the context does not have any Dockerfile, the path in the error
message is: "OSError: Dockerfile not found in
.../podman-compose/tests/integration/build_fail/context_no_file"
Only this error message was used before the fix.

Signed-off-by: Monika Kairaityte <monika@kibit.lt>
Co-authored-by: Siteshwar Vashisht <svashisht@redhat.com>
2025-05-28 16:19:38 +03:00
Povilas Kanapickas
0dcc864fdd Merge pull request #1205 from mokibit/add-missing-init-py-files
tests/integration: Add missing __init__.py files to actually run tests and fix the broken ones
2025-05-26 22:27:48 +03:00
Monika Kairaityte
56238b10e3 tests/integration: Fix service_scale tests
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
2025-05-26 18:19:11 +03:00