Set run_as permissions after variable interpolation (#1141)

## Changes

This PR sets run as permissions after variable interpolation.

Terraform does not allow specifying permissions for current user.

The following configuration would fail becuase we would assign a
permission block for self, bypassing this check here:
4ee926b885/bundle/config/mutator/run_as.go (L47)

```
run_as:
  user_name: ${workspace.current_user.userName}
```



## Tests
Manually, setting run_as to ${workspace.current_user.userName} works now
This commit is contained in:
shreyas-goenka 2024-01-24 17:52:04 +05:30 committed by GitHub
parent deb7e67ad5
commit cf2a1c38ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,6 @@ func Initialize() bundle.Mutator {
[]bundle.Mutator{
mutator.InitializeWorkspaceClient(),
mutator.PopulateCurrentUser(),
mutator.SetRunAs(),
mutator.DefineDefaultWorkspaceRoot(),
mutator.ExpandWorkspaceRoot(),
mutator.DefineDefaultWorkspacePaths(),
@ -33,6 +32,7 @@ func Initialize() bundle.Mutator {
interpolation.IncludeLookupsInPath("workspace"),
interpolation.IncludeLookupsInPath(variable.VariableReferencePrefix),
),
mutator.SetRunAs(),
mutator.OverrideCompute(),
mutator.ProcessTargetMode(),
mutator.ExpandPipelineGlobPaths(),