fix: use immutable list operations in Jinja2 template
Some checks failed
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 22s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 9s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 25s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Failing after 59s
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Successful in 14s
Some checks failed
Security Vulnerability Scan / Check for Dependency Changes (push) Successful in 22s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Successful in 9s
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
🚀 Build & Deploy Image / Determine Build Necessity (push) Successful in 25s
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Failing after 59s
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
Security Vulnerability Scan / Composer Security Audit (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Successful in 14s
Ansible doesn't allow .append() on lists in Jinja2 templates. Changed to use select() filter with regex match instead of loop with append. This is the same filtering logic but using immutable operations.
This commit is contained in:
@@ -248,12 +248,7 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
registries_to_login: >-
|
registries_to_login: >-
|
||||||
{%- set found_registries = actual_registry_urls_full.stdout | trim | split('\n') | select('match', '.+') | list -%}
|
{%- set found_registries = actual_registry_urls_full.stdout | trim | split('\n') | select('match', '.+') | list -%}
|
||||||
{%- set filtered_registries = [] -%}
|
{%- set filtered_registries = found_registries | select('match', '.*\.(de|com|org|net|io|dev).*|.*:[0-9]+.*|^localhost$') | list -%}
|
||||||
{%- for reg in found_registries -%}
|
|
||||||
{%- if reg | regex_search('\.(de|com|org|net|io|dev)') or reg | regex_search(':[0-9]+') or reg == 'localhost' -%}
|
|
||||||
{%- set _ = filtered_registries.append(reg) -%}
|
|
||||||
{%- endif -%}
|
|
||||||
{%- endfor -%}
|
|
||||||
{%- set default_registry = [docker_registry] -%}
|
{%- set default_registry = [docker_registry] -%}
|
||||||
{%- if filtered_registries | length > 0 -%}
|
{%- if filtered_registries | length > 0 -%}
|
||||||
{{ filtered_registries | unique | list }}
|
{{ filtered_registries | unique | list }}
|
||||||
|
|||||||
Reference in New Issue
Block a user