From 49d880c589cdf2b60f604daddfea2cb1ee60fce8 Mon Sep 17 00:00:00 2001 From: Sylvain Laperche Date: Mon, 10 Aug 2020 22:18:01 +0200 Subject: [PATCH] salt/volume: fix the volume state. The "Update pillar after volume provisioning" step should be outside of the for loop because: - it's ID is not customized per-volume (duplicate ID) - we only need to refresh once after deploying all the volumes Refs: #2726 Closes: #2729 Signed-off-by: Sylvain Laperche --- salt/metalk8s/volumes/prepared/init.sls | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/salt/metalk8s/volumes/prepared/init.sls b/salt/metalk8s/volumes/prepared/init.sls index f8a920c3e4..ca9d2300a0 100644 --- a/salt/metalk8s/volumes/prepared/init.sls +++ b/salt/metalk8s/volumes/prepared/init.sls @@ -48,12 +48,21 @@ Provision backing storage for {{ volume }}: - name: {{ volume }} - require: - metalk8s_volumes: Prepare backing storage for {{ volume }} + - require_in: + - module: Update pillar after volume provisioning -Update pillar after volume provisionning: +{%- endfor %} + +{%- if volumes_to_create %} + +Update pillar after volume provisioning: module.run: - saltutil.refresh_pillar: - wait: True - - require: - - metalk8s_volumes: Provision backing storage for {{ volume }} -{%- endfor %} +{%- else %} + +No volume to create: + test.succeed_without_changes: [] + +{%- endif %}