Skip to content

Fix healthcheck kwargs for container.create()#647

Open
inknos wants to merge 1 commit into
containers:mainfrom
inknos:rhel-140716
Open

Fix healthcheck kwargs for container.create()#647
inknos wants to merge 1 commit into
containers:mainfrom
inknos:rhel-140716

Conversation

@inknos

@inknos inknos commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

The health_* kwargs were being passed as snake_case in the JSON payload, but /libpod/containers/create endpoint expects nested objects.

Assemble kwargs into proper structures:

  • healthconfig: {Test, Interval, Timeout, Retries, StartPeriod}
  • startupHealthConfig: {Test, Interval, Timeout, Retries, Successes}
  • healthLogDestination, healthMaxLogCount, healthMaxLogSize (camelCase)
  • health_on_failure string mapped to health_check_on_failure_action int

Also, it's possible to pass duration values as go-style strings ("30s", "1m", "500ms") and integers as nanoseconds.

Fixes: https://redhat.atlassian.net/browse/RHEL-140716


keeping as draft since I want to sleep on the code before saying it's ready

The health_* kwargs were being passed as snake_case in the JSON
payload, but /libpod/containers/create endpoint expects nested objects.

Assemble kwargs into proper structures:
- healthconfig: {Test, Interval, Timeout, Retries, StartPeriod}
- startupHealthConfig: {Test, Interval, Timeout, Retries, Successes}
- healthLogDestination, healthMaxLogCount, healthMaxLogSize (camelCase)
- health_on_failure string mapped to health_check_on_failure_action int

Also, it's possible to pass duration values as go-style strings
("30s", "1m", "500ms") and integers as nanoseconds.

Fixes: https://redhat.atlassian.net/browse/RHEL-140716

Signed-off-by: Nicola Sella <nsella@redhat.com>
@inknos inknos marked this pull request as ready for review June 9, 2026 14:52
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.

1 participant