pulumi-az-pipelines-task icon indicating copy to clipboard operation
pulumi-az-pipelines-task copied to clipboard

Incorrect parsing of args with whitespace

Open macpak opened this issue 11 months ago • 0 comments

Describe the bug We've tried to use Pulumi Azure DevOps task in a way described below:

- task: Pulumi@1
    condition: succeeded()
    displayName: 'Pulumi up ${{ parameters.project.dir }} ${{ parameters.stack }}'
    inputs:
      azureSubscription: ${{ parameters.azureSubscription }}
      command: 'up'
      loginArgs: 'azblob://my-blob'
      versionSpec: 3.71.0
      cwd: modules/${{ parameters.project.dir }}
      stack: ${{ parameters.stack }}
      createStack: true
      args: '-y ${{ parameters.pulumiVariables }} --config CDP_API_KEY="ab cd"'

When the task runs, we get the following error:

error: template 'cd"' not found
##[error]Pulumi command exited with code '255' while trying to run 'up -y --config CDP_API_KEY="ab cd"'.

The problem is that CDP_API_KEY contains a whitespace. We've also tried to enclose the value with the whitespace in ''.

To Reproduce Steps to reproduce the behavior:

  1. Create an azure pipeline with the Pulumi task.
  2. Try to pass a config variable (in args, --config) that contains a whitespace

Expected behavior A config variable is correctly passed to pulumi and pulumi up works correctly.

macpak avatar Sep 25 '23 08:09 macpak