redhat-cop / ee_utilities

This ansible collection includes a number of roles and tools which can be useful for managing Ansible Execution Environments.
https://galaxy.ansible.com/infra/ee_utilities
GNU General Public License v3.0
57 stars 34 forks source link

Explicitly add EE name and tag to destination #167

Closed james-allan-lloyd closed 2 months ago

james-allan-lloyd commented 2 months ago

This avoids changes in containers.podman behavior where the image name is not always automatically appended. In particular, if you happen to have a port specification it will not automatically append the image name, see https://github.com/containers/ansible-podman-collections/blob/master/plugins/modules/podman_image.py#L792.

What does this PR do?

Instead of relying on automatic appending of the EE name by the podman module, be explicit and append it to the ee_registry_dest variable, and if tag is defined, assume that it should also be pushed to the registry with the same tag.

How should this be tested?

Build any existing execution environment. There should be no change in behaviour - the image should still be pushed. The actual image push is easy to see when running with -vvv:

    "podman_actions": [
        "/usr/bin/podman image ls my_image:my_tag --format json",
        "/usr/bin/podman inspect my_image:my_tag --format json",
        "/usr/bin/podman push --tls-verify=false --creds username:**** my_image:my_tag some.registry:7001/org/namespace/my_image:my_tag",
        "/usr/bin/podman inspect my_image:my_tag --format json"
    ],

Is there a relevant Issue open for this?

Provide a link to any open issues that describe the problem you are solving. resolves #[number]

Other Relevant info, PRs, etc

Please provide link to other PRs that may be related (blocking, resolves, etc. etc.)