Skip to content

Commit

Permalink
Need to chech to make sure the StateEnvProvider is set before using. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-of-codecraft authored Nov 15, 2024
1 parent 8785f8c commit e582e3f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions libs/scheduler/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,12 @@ func(job *Job) AuthBackendConfig() error {

func(job *Job) AuthTerragrunt() error {
var err error
job.StateEnvVars, err = populateKeys(job.StateEnvVars, *job.StateEnvProvider)
if err != nil {
log.Printf("Failed to get keys from role (StateEnvProvider): %v", err)
return fmt.Errorf("failed to get (state) keys from role: %v", err)
if(job.StateEnvProvider != nil) {
job.StateEnvVars, err = populateKeys(job.StateEnvVars, *job.StateEnvProvider)
if err != nil {
log.Printf("Failed to get keys from role (StateEnvProvider): %v", err)
return fmt.Errorf("failed to get (state) keys from role: %v", err)
}
}

if job.CommandEnvProvider != nil {
Expand Down

0 comments on commit e582e3f

Please sign in to comment.