8772465ecc
We don't strictly need namespacing in order to have a buildset registry serve as multiple registries. If we don't configure it in zuul-registry itself, and treat dockerhub images as non-namespaced, then both docker and oci configurations can use the same buildset registry. We would configure docker to talk to the registry as normal and it will fetch unqualified image names, but we would set up containers/registries.conf to prepend urls for non-dockerhub registries, and it would not prepend anything for dockerhub. In this way, both configurations can use the same buildset registry. Change-Id: I8af4ea0f5da5ad835384400108250e14a8435656
59 lines
1.7 KiB
YAML
59 lines
1.7 KiB
YAML
# Test push and pull from the standard registry
|
|
|
|
- name: Start the registry
|
|
shell:
|
|
cmd: docker-compose up -d
|
|
chdir: "{{ ansible_user_dir }}/src/opendev.org/zuul/zuul-registry/playbooks/functional-test"
|
|
|
|
- name: Print list of images
|
|
command: podman image ls --all --digests --no-trunc
|
|
register: image_list
|
|
failed_when: "'test/image' in image_list.stdout"
|
|
|
|
- name: Copy the test image into local containers image storage
|
|
command: >
|
|
skopeo copy
|
|
docker-archive:{{ workspace }}/test.img
|
|
containers-storage:localhost:9000/test/image:latest
|
|
|
|
- name: Log in to registry
|
|
command: podman login localhost:9000 -u testuser -p testpass
|
|
|
|
- name: Push the test image to the registry
|
|
command: podman push localhost:9000/test/image
|
|
|
|
- name: Remove the test image from the local cache
|
|
command: podman rmi localhost:9000/test/image
|
|
|
|
- name: Clean up the local image cache
|
|
command: podman image prune
|
|
|
|
- name: Print list of images
|
|
command: podman image ls --all --digests --no-trunc
|
|
register: image_list
|
|
failed_when: "'test/image' in image_list.stdout"
|
|
|
|
- name: Pull the image from the registry
|
|
command: podman pull localhost:9000/test/image
|
|
|
|
- name: Print list of images
|
|
command: podman image ls --all --digests --no-trunc
|
|
register: image_list
|
|
failed_when: "'test/image' not in image_list.stdout"
|
|
|
|
- name: Try to pull an image that does not exist
|
|
command: podman pull localhost:9000/test/dne
|
|
register: result
|
|
failed_when: result.rc != 125
|
|
|
|
- name: Stop the registry
|
|
shell:
|
|
cmd: docker-compose down
|
|
chdir: "{{ ansible_user_dir }}/src/opendev.org/zuul/zuul-registry/playbooks/functional-test"
|
|
|
|
- name: Clean up podman volumes
|
|
command: podman volume prune -f
|
|
|
|
- name: Log out of registry
|
|
command: podman logout localhost:9000
|