pulumi / pulumi-az-pipelines-task

Azure Pipelines task extension for running Pulumi apps.
https://marketplace.visualstudio.com/publishers/pulumi
Apache License 2.0
27 stars 19 forks source link

Incorrect parsing of args with whitespace #148

Open macpak opened 11 months ago

macpak commented 11 months ago

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.