mirror of
https://github.com/containers/ansible-podman-collections.git
synced 2026-03-22 02:29:08 +00:00
Update podman_image to specify CPU arch when pulling image (#578)
* Add test to sprcify CPU arch when pulling image Signed-off-by: nishipy <goodisonev4@gmail.com> * Update to specify CPU arch when pulling image Signed-off-by: nishipy <goodisonev4@gmail.com> * Add document for specifying arch Signed-off-by: nishipy <goodisonev4@gmail.com> * Fix for idempotency Signed-off-by: nishipy <goodisonev4@gmail.com> * Update plugins/modules/podman_image.py Signed-off-by: nishipy <goodisonev4@gmail.com> --------- Signed-off-by: nishipy <goodisonev4@gmail.com>
This commit is contained in:
parent
e8c270370d
commit
ab64d5f953
2 changed files with 63 additions and 4 deletions
|
|
@ -161,7 +161,7 @@
|
|||
- name: Pull image with SHA256 tag
|
||||
containers.podman.podman_image:
|
||||
executable: "{{ test_executable | default('podman') }}"
|
||||
name: "quay.io/coreos/etcd@{{ sha_image_info.images.0.Digest }}" #quay.io/coreos/coreos-installer:latest
|
||||
name: "quay.io/coreos/etcd@{{ sha_image_info.images.0.Digest }}" #quay.io/coreos/coreos-installer:latest
|
||||
state: present
|
||||
|
||||
- name: Create a build directory with a subdirectory
|
||||
|
|
@ -277,6 +277,45 @@
|
|||
- "'Failed to find image bad_image' in bad_push.msg"
|
||||
- "'image pull set to False' in bad_push.msg"
|
||||
|
||||
- name: Pull an image for a specific CPU architecture
|
||||
containers.podman.podman_image:
|
||||
executable: "{{ test_executable | default('podman') }}"
|
||||
name: docker.io/library/ubuntu
|
||||
arch: amd64
|
||||
register: pull_arch1
|
||||
|
||||
- name: Pull the same image for the same CPU architecture
|
||||
containers.podman.podman_image:
|
||||
executable: "{{ test_executable | default('podman') }}"
|
||||
name: docker.io/library/ubuntu
|
||||
arch: amd64
|
||||
register: pull_arch2
|
||||
|
||||
- name: Pull the same image but for another CPU architecture
|
||||
containers.podman.podman_image:
|
||||
executable: "{{ test_executable | default('podman') }}"
|
||||
name: docker.io/library/ubuntu
|
||||
arch: arm
|
||||
register: pull_arch3
|
||||
|
||||
- name: Ensure the result of pulling image for another CPU architecture
|
||||
assert:
|
||||
that:
|
||||
- "pull_arch2 is not changed"
|
||||
- "pull_arch3 is changed"
|
||||
|
||||
- name: Get the image info
|
||||
containers.podman.podman_image_info:
|
||||
executable: "{{ test_executable | default('podman') }}"
|
||||
name: docker.io/library/ubuntu
|
||||
register: imageinfo_arch
|
||||
|
||||
- name: Ensure the CPU architecture of the image is as expected
|
||||
assert:
|
||||
that:
|
||||
- item.Architecture == "arm"
|
||||
loop: "{{ imageinfo_arch.images }}"
|
||||
|
||||
always:
|
||||
- name: Cleanup images
|
||||
containers.podman.podman_image:
|
||||
|
|
@ -284,6 +323,7 @@
|
|||
name: "{{ item }}"
|
||||
state: absent
|
||||
loop:
|
||||
- docker.io/library/ubuntu
|
||||
- quay.io/coreos/alpine-sh
|
||||
- quay.io/coreos/etcd:v3.3.11
|
||||
- localhost/testimage
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue