
Skopeo has problems with ipv6 address literals just like docker as they use the same underlying checks for url validity. However, we think we can fix that by using a port forward from the executor to the buildset registry so that skopeo can connect via ipv4 Go back to aliases the registries on test nodes via /etc/hosts. Change-Id: I5f9316ffe84de06cb2fb2b65a7e1c31d9f8b0e35 Co-Authored-By: James E. Blair <jeblair@redhat.com>
33 lines
1.4 KiB
YAML
33 lines
1.4 KiB
YAML
# Docker doesn't understand docker push [1234:5678::]:5000/image/path:tag
|
|
# so we set up /etc/hosts with a registry alias name to support ipv6 and 4.
|
|
- name: Configure /etc/hosts for buildset_registry to workaround docker not understanding ipv6 addresses
|
|
become: yes
|
|
lineinfile:
|
|
path: /etc/hosts
|
|
state: present
|
|
regex: "^{{ buildset_registry.host }}\tzuul-jobs.buildset_registry$"
|
|
line: "{{ buildset_registry.host }}\tzuul-jobs.buildset_registry"
|
|
insertafter: EOF
|
|
when: buildset_registry.host | ipaddr
|
|
- name: Set buildset_registry alias variable when using ip
|
|
set_fact:
|
|
buildset_registry_alias: zuul-jobs.buildset_registry
|
|
when: buildset_registry.host | ipaddr
|
|
- name: Set buildset_registry alias variable when using name
|
|
set_fact:
|
|
buildset_registry_alias: "{{ buildset_registry.host }}"
|
|
when: not ( buildset_registry.host | ipaddr )
|
|
|
|
- name: Tag image for buildset registry
|
|
command: >-
|
|
docker tag {{ image.repository }}:{{ image_tag }} {{ buildset_registry_alias }}:{{ buildset_registry.port }}/{{ image.repository }}:{{ image_tag }}
|
|
loop: "{{ image.tags | default(['latest']) }}"
|
|
loop_control:
|
|
loop_var: image_tag
|
|
- name: Push tag to buildset registry
|
|
command: >-
|
|
docker push {{ buildset_registry_alias }}:{{ buildset_registry.port }}/{{ image.repository }}:{{ image_tag }}
|
|
loop: "{{ image.tags | default(['latest']) }}"
|
|
loop_control:
|
|
loop_var: image_tag
|