From 426c71f753cde332a24252283e00252423b6b74d Mon Sep 17 00:00:00 2001 From: Stephen Taylor Date: Wed, 6 Dec 2023 12:15:57 -0700 Subject: [PATCH] Initialize registry_namespaces unconditionally if not initialized The deploy-env playbook can fail with an error stating that registry_namespaces is not defined in some cases. This change moves the initialization of registry_namespaces so that buildset_registry is not required for it to be set when other conditions are not met. Change-Id: I160e7d479008fd3afd460382691673b92bd042c9 --- roles/deploy-env/tasks/containerd.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/deploy-env/tasks/containerd.yaml b/roles/deploy-env/tasks/containerd.yaml index 372933ec9..34924c441 100644 --- a/roles/deploy-env/tasks/containerd.yaml +++ b/roles/deploy-env/tasks/containerd.yaml @@ -80,6 +80,11 @@ skip_verify: true when: registry_mirror is defined +- name: Init registry_namespaces if not defined + set_fact: + registry_namespaces: "[]" + when: not registry_namespaces is defined + - name: Buildset registry namespace when: buildset_registry is defined block: @@ -106,11 +111,6 @@ ca: "/usr/local/share/ca-certificates/{{ buildset_registry_alias }}.crt" auth: "{{ (buildset_registry.username + ':' + buildset_registry.password) | b64encode }}" - - name: Init registry_namespaces if not defined - set_fact: - registry_namespaces: "[]" - when: not registry_namespaces is defined - - name: Append buildset_registry to registry namespaces when: - buildset_registry_namespace is defined