Skip to content

Commit

Permalink
resourceop cdk: use different var name then reassing to avoid shadow
Browse files Browse the repository at this point in the history
opRole was being redefined and was staying nil. This makes it so opRole
is always set on both paths
  • Loading branch information
dschofie committed Apr 19, 2024
1 parent b4f34a8 commit 32d1476
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions resourceoperation/cdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,15 @@ func (co *cdkOperation) Call(ctx context.Context) error {
return err
}
} else {
opRole, region, err := authAWS(*co.Account, co.Account.AssumeRoleARN(), co.OutputUI)
subRole, region, err := authAWS(*co.Account, co.Account.AssumeRoleARN(), co.OutputUI)
if err != nil {
return err
}
bootstrapCDK := bootstrapCDK(opRole, region, *co.Account, co.Stack)
bootstrapCDK := bootstrapCDK(subRole, region, *co.Account, co.Stack)
if err := co.OutputUI.RunCmd(bootstrapCDK, *co.Account); err != nil {
return err
}
opRole = subRole
}

synthCDK := synthCDK(opRole, *co.Account, co.Stack)
Expand Down

0 comments on commit 32d1476

Please sign in to comment.