Merge "Add container repository cred permission checks"

This commit is contained in:
Zuul 2023-03-22 00:32:47 +00:00 committed by Gerrit Code Review
commit b017e4832c
2 changed files with 18 additions and 0 deletions

View File

@ -8,6 +8,15 @@
fail:
msg: "{{ zj_image.registry }} credentials not found"
- name: Verify repository permission
when: |
not zj_image.repository | regex_search(container_registry_credentials[zj_image.registry].repository)
loop: "{{ container_images }}"
loop_control:
loop_var: zj_image
fail:
msg: "{{ zj_image.repository }} not permitted by {{ container_registry_credentials[zj_image.registry].repository }}"
- name: Log in to registry
no_log: true
command: >-

View File

@ -8,6 +8,15 @@
fail:
msg: "{{ zj_image.registry }} credentials not found"
- name: Verify repository permission
when: |
not zj_image.repository | regex_search(container_registry_credentials[zj_image.registry].repository)
loop: "{{ container_images }}"
loop_control:
loop_var: zj_image
fail:
msg: "{{ zj_image.repository }} not permitted by {{ container_registry_credentials[zj_image.registry].repository }}"
- name: Upload image to container registry
loop: "{{ container_images }}"
loop_control: