Skip to content

Warn and drop the broken healthcheck.start_interval mapping - #1539

Open
wahajahmed010 wants to merge 1 commit into
containers:mainfrom
wahajahmed010:fix/1500-start-interval-warning
Open

Warn and drop the broken healthcheck.start_interval mapping#1539
wahajahmed010 wants to merge 1 commit into
containers:mainfrom
wahajahmed010:fix/1500-start-interval-warning

Conversation

@wahajahmed010

Copy link
Copy Markdown

Summary

Fix the silent mistranslation of healthcheck.start_interval to the Podman flag --health-startup-interval.

The two have different semantics:

  • Compose start_interval changes the interval of the regular healthcheck during start_period.
  • Podman --health-startup-interval belongs to a separate startup-healthcheck mechanism gated by --health-startup-cmd, which podman-compose does not generate.

So start_interval was being silently dropped from the user's intent, and the existing unit test only checked the generated CLI string rather than the resulting schedule.

This PR stops the broken translation and emits a log.warning(...) explaining that start_interval is not currently supported, so users get an explicit signal instead of silent loss of behaviour. The mapping can be re-enabled once Podman ships a native equivalent (tracked in containers/podman#26505).

Compose spec reference for healthcheck.start_interval:
https://github.com/compose-spec/compose-spec/blob/main/spec.md#healthcheck

Changes

  • podman_compose.py: drop the --health-startup-interval translation; emit a log.warning(...) when start_interval is set, including the service name and the upstream Podman tracking issue.
  • tests/unit/test_container_to_args.py:
    • test_healthcheck_options no longer asserts the (now-removed) --health-startup-interval output.
    • New test_healthcheck_start_interval_warns_and_omits_podman_flag verifies the new contract: a warning mentioning start_interval is logged, and the resulting args list does not contain --health-startup-interval.
  • newsfragments/start_interval_unsupported.bugfix: towncrier fragment.

Verification

$ python -m unittest discover tests/unit
Ran 477 tests in 7.273s
OK

$ python -m ruff check podman_compose.py tests/unit/test_container_to_args.py
All checks passed!

$ python -m ruff format --check podman_compose.py tests/unit/test_container_to_args.py
2 files already formatted

Fixes #1500

Signed-off-by: wahajahmed010 wahajahmed010@users.noreply.github.com

The previous behaviour translated Compose's healthcheck.start_interval
field to the Podman flag --health-startup-interval, but those two have
different semantics. Podman's --health-startup-interval belongs to a
separate startup-healthcheck mechanism gated by --health-startup-cmd,
which podman-compose does not generate. The result was that user
compose.yaml files using start_interval silently lost the start_period
interval behaviour defined in the Compose spec.

Stop the incorrect translation and warn the user that start_interval is
not currently supported. Once Podman ships a native equivalent
(podman-container-tools/podman#26505), the field can be remapped to the matching
Podman option.

The existing test_healthcheck_options is updated to drop the
start_interval input/expected output, and a new
test_healthcheck_start_interval_warns_and_omits_podman_flag asserts
the new contract (warning is emitted, no --health-startup-interval
flag is added to the podman args).

Fixes containers#1500

Signed-off-by: wahajahmed010 <wahajahmed010@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

healthcheck.start_interval is ineffective and incorrectly mapped to --health-startup-interval

1 participant