Skip to content

Fix inspect template .HostIp for Docker compatibility#29168

Open
Honny1 wants to merge 1 commit into
podman-container-tools:mainfrom
Honny1:fix-json-format
Open

Fix inspect template .HostIp for Docker compatibility#29168
Honny1 wants to merge 1 commit into
podman-container-tools:mainfrom
Honny1:fix-json-format

Conversation

@Honny1

@Honny1 Honny1 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Docker-compatible inspect templates using {{.HostIp}} fail in Podman because Go templates resolve by struct field name (HostIP), not JSON tag (HostIp). Add a HostIp() method so both notations work.

Fixes: #29164

Checklist

Ensure you have completed the following checklist for your pull request to be reviewed:

  • Certify you wrote the patch or otherwise have the right to pass it on as an open-source patch by signing all
    commits. (git commit -s). (If needed, use git commit -s --amend). The author email must match
    the sign-off email address. See CONTRIBUTING.md
    for more information.
  • Referenced issues using Fixes: #00000 in commit message (if applicable)
  • Tests have been added/updated (or no tests are needed)
  • Documentation has been updated (or no documentation changes are needed)
  • All commits pass make validatepr (format/lint checks)
  • Release note entered in the section below (or None if no user-facing changes)

Does this PR introduce a user-facing change?

Fixed `inspect --format` to support Docker-compatible `{{.HostIp}}` in `NetworkSettings.Ports` templates (https://github.com/podman-container-tools/podman/issues/29164).

Docker-compatible inspect templates using `{{.HostIp}}` fail in Podman
because Go templates resolve by struct field name (`HostIP`), not JSON
tag (`HostIp`). Add a `HostIp()` method so both notations work.

Fixes: podman-container-tools#29164

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
@packit-as-a-service

Copy link
Copy Markdown

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

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.

inspect template for .NetworkSettings.Ports inconsistent with docker

1 participant