Skip to content

Commit fd75143

Browse files
authored
feat: Add WithEnvVars option to pass environment variables (#33)
Added WithEnvVars function to set environment variables in Options struct.
1 parent 32a2381 commit fd75143

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/scenario/client.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ type Options struct {
2929
isParallel bool
3030
// retryOptions
3131
retryOptions *retryableOptions
32+
//envVars is the environment variables
33+
envVars map[string]string
3234
}
3335

3436
type retryableOptions struct {
@@ -106,6 +108,13 @@ func WithParallel() OptFn {
106108
}
107109
}
108110

111+
func WithEnvVars(envVars map[string]string) OptFn {
112+
return func(o *Options) error {
113+
o.envVars = envVars
114+
return nil
115+
}
116+
}
117+
109118
func WithVarFiles(workdir string, varFiles ...string) OptFn {
110119
return func(o *Options) error {
111120
if err := validation.IsValidTFDir(workdir); err != nil {

0 commit comments

Comments
 (0)