Commit 31c8b53
fix(deployment): prevent shell glob expansion in deleted files JSON
Fix shell glob expansion bug in detect-removed-stacks.sh discovery analysis
function that caused deployment failures when stacks were deleted.
Problem:
- JSON array ['["stack/compose.yaml"]'] passed to remote bash/zsh via SSH
- Square brackets [] interpreted as glob pattern (character class matching)
- On zsh with 'nomatch' option, this caused: "no matches found" error
- Deployment failed when trying to detect and clean up removed stacks
Root Cause:
Line 208: The JSON string was passed as an unquoted argument to the remote
shell, allowing glob expansion of the [] characters.
Solution:
Use single quotes around the SSH command and expand the JSON variable with
double quotes to prevent local and remote shell glob expansion:
'ssh ... /bin/bash -s -- "'"$deleted_files_json"'"'
This ensures:
- JSON is expanded locally (before SSH)
- Properly quoted for remote shell (prevents glob expansion)
- Works with both bash and zsh on remote servers
Testing:
- Verified JSON parsing works correctly
- Tested with zsh (previously failing shell)
- Confirmed no glob expansion occurs
Fixes: docker-zendc deployment failure run #20583514124
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Happy <[email protected]>1 parent 46481ac commit 31c8b53
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
209 | 211 | | |
210 | 212 | | |
211 | 213 | | |
| |||
0 commit comments