Skip to content

Commit a795277

Browse files
committed
Fix ConfigMap masking not applied when called from gather_run
The masking code in gather_services_cm was only executed when the script was run directly (CALLED=1), but not when sourced and called from gather_run. This caused passwords and sensitive data in ConfigMaps to remain unmasked during must-gather collection. Move the wait_bg and masking logic inside the gather_services_cm() function itself, following the same pattern used in gather_secrets. This ensures masking is applied regardless of how the script is invoked. Follow-up to: 466f4e7 (Mask sensitive data in CRs and ConfigMaps) Jira: OSPRH-20621 Signed-off-by: Martin Schuppert <[email protected]>
1 parent df553ff commit a795277

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

collection-scripts/gather_services_cm

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ gather_services_cm () {
3434
for svc in "${OSP_SERVICES[@]}"; do
3535
get_cm "$NS" "$svc"
3636
done
37+
38+
# Ensure background configmap gathering tasks are done before masking
39+
wait_bg
40+
41+
if [[ "${DO_NOT_MASK}" -eq 0 ]]; then
42+
# All configmaps have been collected, apply masking on the configmaps directory
43+
/usr/bin/mask.py --dir "${NAMESPACE_PATH}/${NS}/configmaps"
44+
fi
3745
}
3846

3947

@@ -45,10 +53,4 @@ if [[ $CALLED -eq 1 ]]; then
4553
fi
4654

4755
gather_services_cm "$NS"
48-
wait_bg
49-
50-
if [[ "${DO_NOT_MASK}" -eq 0 ]]; then
51-
# All configmaps have been collected, apply masking on the configmaps directory
52-
/usr/bin/mask.py --dir "${NAMESPACE_PATH}/${NS}/configmaps"
53-
fi
5456
fi

0 commit comments

Comments
 (0)