Double quotes in "task" commands should be escaped

Task commands like:

terraform state rm module.app_vm.module.vm_ubuntu["gitlab"].solidserver_ip_address.vm_ip_address

fail with a somewhat confusing error message:

Error: Index value required │  │  on line 1: │  (source code not available) │  │ Index brackets must contain either a literal number or a literal string.

because the double quote characters are not escaped. I believe this command would have worked if executed directly at a shell and that Spacelift is doing something like:

/bin/sh -c “<user-specified-command>”

The wrapping Spacelift quotes interfere with the quotes around the string literal. Thus it would be better if Spacelift automatically escaped (added backslashes) in front of any double quotes found within the submitted task command.

Please authenticate to join the conversation.

Upvoters
Status

🗑️ Archived

Board

📝 Feedback

Date

11 months ago

Subscribe to post

Get notified by email when there are changes.