HelmDeploy@0 does not play well with values that have spaces
See original GitHub issueRequired Information
Type: Bug
Enter Task Name: HelmDeploy@0
Environment
-
Server - Azure Pipelines
- If using Azure Pipelines, provide the account name, team project name, build definition name/build number: simp-cloud/SaaS/pipelineId=50/buildId=1788
-
Agent - Private:
- OS of the machine running the agent and the agent version: Ubuntu 18.04, agent 2.160.0
Issue Description
If you have values with spaces that you need to set, it is already very complicated to get this to work with helm, you end up having to use double quotes with single quotes, or escape the string (see this - still open - issue on the Helm repo).
The problem gets worse on Azure DevOps because the Helm task is removing quotes from the arguments.
Task logs
Here is a stripped down, commented and redacted version of the logs. Note that the quotes are being stripped, even though they appear on the arguments.
##[debug]found: '/agent/_works/c47a627d22eb/_tool/helm/2.14.3/x64/linux-amd64/helm'
##[debug]/(stripped))/helm arg: upgrade
(stripped for brevity)
##[debug]/(stripped))/helm arg: '--set=foo.ConnectionStrings__DefaultConnection="***"'
^^^^^
quotes
##[debug]exec tool: /agent/_works/c47a627d22eb/_tool/helm/2.14.3/x64/linux-amd64/helm
##[debug]arguments:
(stripped for brevity)
##[debug] '--set=foo.ConnectionStrings__DefaultConnection=***'
^^^
no quotes
I suggest you battle test this scenario, as I guess it is a common one. Also the connection string is a Sql Connection string, and the spaces come from Initial Catalog
and Connect Timeout
.
If you need more info I’m glad to help. Right now I’m moving to a bash script to work around this.
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (6 by maintainers)
Top GitHub Comments
I didn’t, the variable is the same, I only switched from the helm task to the script task, and it worked, and that shows me that the problem exists. I’m fine using scripts, so to me that is ok, I reported to let Microsoft aware. The problem will happen to other users, for sure.
To test this scenario, I executed a simple Helm upgrade command with arguments as: –set=my-key=“$(my-val)” I’ve set the variable my-val as my value. There is a space in the variable, but the build is still successful. Although the quotes are stripped in the log, but that doesn’t affect the execution of the command.