Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: simplify env vars for localstack module #873

Merged
merged 1 commit into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions modules/localstack/localstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,7 @@ func StartContainer(ctx context.Context, overrideReq OverrideContainerRequestOpt
Binds: []string{fmt.Sprintf("%s:/var/run/docker.sock", testcontainersdocker.ExtractDockerHost(ctx))},
WaitingFor: wait.ForHTTP("/_localstack/health").WithPort("4566/tcp").WithStartupTimeout(120 * time.Second),
ExposedPorts: []string{fmt.Sprintf("%d/tcp", defaultPort)},
Env: map[string]string{
"AWS_ACCESS_KEY_ID": defaultAccessKeyID,
"AWS_SECRET_ACCESS_KEY": defaultSecretAccessKey,
"AWS_SESSION_TOKEN": defaultToken,
"DEFAULT_REGION": defaultRegion,
},
Env: map[string]string{},
}
// }

Expand Down
1 change: 0 additions & 1 deletion modules/localstack/localstack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ func TestStart(t *testing.T) {
ctx,
OverrideContainerRequest(testcontainers.ContainerRequest{
Image: fmt.Sprintf("localstack/localstack:%s", defaultVersion),
Env: map[string]string{"SERVICES": "s3,sqs,kinesis"},
}),
)
// }
Expand Down
13 changes: 1 addition & 12 deletions modules/localstack/v1/s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,7 @@ func TestS3(t *testing.T) {
ctx := context.Background()

// localStackCreateContainer {
container, err := localstack.StartContainer(
ctx,
localstack.OverrideContainerRequest(testcontainers.ContainerRequest{
Env: map[string]string{
"AWS_ACCESS_KEY_ID": accesskey,
"AWS_SECRET_ACCESS_KEY": secretkey,
"AWS_SESSION_TOKEN": token,
"AWS_DEFAULT_REGION": region,
"SERVICES": "s3,sqs,cloudwatchlogs,kms",
}},
),
)
container, err := localstack.StartContainer(ctx, localstack.NoopOverrideContainerRequest)
require.Nil(t, err)
// }

Expand Down
13 changes: 1 addition & 12 deletions modules/localstack/v2/s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,7 @@ func s3Client(ctx context.Context, l *localstack.LocalStackContainer) (*s3.Clien
func TestS3(t *testing.T) {
ctx := context.Background()

container, err := localstack.StartContainer(
ctx,
localstack.OverrideContainerRequest(testcontainers.ContainerRequest{
Env: map[string]string{
"AWS_ACCESS_KEY_ID": accesskey,
"AWS_SECRET_ACCESS_KEY": secretkey,
"AWS_SESSION_TOKEN": token,
"AWS_DEFAULT_REGION": region,
"SERVICES": "s3,sqs,cloudwatchlogs,kms",
}},
),
)
container, err := localstack.StartContainer(ctx, localstack.NoopOverrideContainerRequest)
require.Nil(t, err)

s3Client, err := s3Client(ctx, container)
Expand Down