Fix incorrect image URL formation when using separate name and tag parameters
where the tag contains a digest. Previously, tags like "8-bookworm@sha256:..."
would incorrectly use "@" as the delimiter between name and tag, resulting in
malformed URLs like "docker.io/valkey/valkey@8-bookworm@sha256:...".
The issue was in ImageRepository.delimiter logic which used substring matching
("sha256" in tag) instead of checking for pure digest format.
Changes:
- Fix delimiter selection in ImageRepository.__init__() to only use "@" for
pure digests starting with "sha256:", not any tag containing "sha256"
- Add comprehensive unit tests covering all delimiter scenarios
- Add integration tests with real digest validation and edge cases
- Ensure proper URL formation: name:tag@digest vs name@digest
Before: docker.io/valkey/valkey@8-bookworm@sha256:abc123 (broken)
After: docker.io/valkey/valkey:8-bookworm@sha256:abc123 (correct)
Fixes#947
Generated with [Claude Code](https://claude.ai/code)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
* Trigger a new image build when we detect that the Containerfile has
changed.
Signed-off-by: gw <gw@bob.lol>
* Fix return type issues from PR feedback
Signed-off-by: gw <gw@bob.lol>
---------
Signed-off-by: gw <gw@bob.lol>
Co-authored-by: gw <gw@bob.lol>
* `podman_image`: correct `path` parameter description
The `path` parameter is the last parameter when running `podman build
...`. As specified in the manpage, it is defined as the build context,
and not necessarily should it contain the Containerfile.
Signed-off-by: Yuriy Gabuev <yuriy.gabuev@holoplot.com>
* `podman_image`: add `file` parameter for Containerfile location
Add the `file` parameter to `podman_image` module which mirrors the
`--file` command line argument for `podman build ...`. This parameter
specifies the location of the Containerfile to use in case it should be
different from the one contained in the build context directory.
Signed-off-by: Yuriy Gabuev <yuriy.gabuev@holoplot.com>
* `podman_image`: add integration tests for `file` parameter
Add tests to ensure that:
- building from a directory without a Containerfile (or Dockerfile)
fails
- specifying the location of Containerfile with `file` parameter works
Signed-off-by: Yuriy Gabuev <yuriy.gabuev@holoplot.com>
Signed-off-by: Yuriy Gabuev <yuriy.gabuev@holoplot.com>