From 8dacb9cd169ca4b1fbac75290543ca5d70d4353c Mon Sep 17 00:00:00 2001 From: accuROAMC Date: Tue, 20 Jan 2026 13:50:50 +0000 Subject: [PATCH] cri-o: fix duplicate top-level "auths" keys in registry config template (#12845) The config.json.j2 template was generating invalid JSON when multiple crio_registry_auth entries were defined, resulting in multiple top-level "auths" objects being rendered, e.g.: { "auths": { "registry1": { "auth": "xxxx" } }, "auths": { "registry2": { "auth": "yyyy" } } } This change moves the loop inside the "auths" object so that all registries are rendered as siblings under a single "auths" key, producing valid JSON: { "auths": { "registry1": { "auth": "xxxx" }, "registry2": { "auth": "yyyy" } } } --- roles/container-engine/cri-o/templates/config.json.j2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/container-engine/cri-o/templates/config.json.j2 b/roles/container-engine/cri-o/templates/config.json.j2 index 4afd49f6b..8d2fff842 100644 --- a/roles/container-engine/cri-o/templates/config.json.j2 +++ b/roles/container-engine/cri-o/templates/config.json.j2 @@ -1,16 +1,16 @@ {% if crio_registry_auth is defined and crio_registry_auth|length %} { -{% for reg in crio_registry_auth %} "auths": { +{% for reg in crio_registry_auth %} "{{ reg.registry }}": { "auth": "{{ (reg.username + ':' + reg.password) | string | b64encode }}" - } {% if not loop.last %} - }, + }, {% else %} - } + } {% endif %} {% endfor %} + } } {% else %} {}