Skip to content

Commit

Permalink
feat: Add WithEnvVars option to pass environment variables (#33)
Browse files Browse the repository at this point in the history
Added WithEnvVars function to set environment variables in Options struct.
  • Loading branch information
Excoriate authored May 23, 2024
1 parent 32a2381 commit fd75143
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/scenario/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ type Options struct {
isParallel bool
// retryOptions
retryOptions *retryableOptions
//envVars is the environment variables

Check failure on line 32 in pkg/scenario/client.go

View workflow job for this annotation

GitHub Actions / Golangci-lint

commentFormatting: put a space between `//` and comment text (gocritic)
envVars map[string]string
}

type retryableOptions struct {
Expand Down Expand Up @@ -106,6 +108,13 @@ func WithParallel() OptFn {
}
}

func WithEnvVars(envVars map[string]string) OptFn {
return func(o *Options) error {
o.envVars = envVars
return nil
}
}

func WithVarFiles(workdir string, varFiles ...string) OptFn {
return func(o *Options) error {
if err := validation.IsValidTFDir(workdir); err != nil {
Expand Down

0 comments on commit fd75143

Please sign in to comment.