Azure / terraform-azurerm-avm-template

Template repo for Azure Verified Modules using Terraform
MIT License
40 stars 27 forks source link

[AVM Module Issue]: `unknown shorthand flag: 'r' in -r` received after running avm scripts post grept-apply #150

Closed donovm4 closed 2 weeks ago

donovm4 commented 2 weeks ago

Check for previous/existing GitHub issues

Issue Type?

Bug

(Optional) Module Version

No response

(Optional) Correlation Id

No response

Description

After merging chore: repository governance to the AVM Terraform avm-res-web-site repository, I decided to work on a branch.

Once my changes were made, I attempted to run ./avm pre-commit and received the following response in the console:

PS C:\Users\donovanmccoy\GIt\AVM\terraform-azurerm-avm-res-web-site> ./avm pre-commit
unknown shorthand flag: 'r' in -r
See 'docker run --help'.

Upon checking the changed files, I concluded that the 'r' in the -r ARM_SUBSCRIPTION_ID (line 21) may need to be changed to 'e'. This is the only occurance of an environment variable that follows the -r flag, as opposed to the -e flag.

I changed line 21 of avm.bat to see if this would allow docker to run the script. current:

%CONTAINER_RUNTIME% run --pull always --rm -v "%cd%":/src -w /src --user "1000:1000" -r ARM_SUBSCRIPTION_ID -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER mcr.microsoft.com/azterraform make %1

potential fix:

%CONTAINER_RUNTIME% run --pull always --rm -v "%cd%":/src -w /src --user "1000:1000" -e ARM_SUBSCRIPTION_ID -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER mcr.microsoft.com/azterraform make %1

This change resulted in the script running successfully.

Let me know what you all think 👍

matt-FFFFFF commented 2 weeks ago

Sorry - thanks for raising

matt-FFFFFF commented 2 weeks ago

Should be fixed now! Please confirm after running grept 😊

donovm4 commented 2 weeks ago

@matt-FFFFFF: issue fixed - thanks a lot!