Skip to content
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
8 changes: 2 additions & 6 deletions pkg/services/localstack_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,9 @@ func (s *LocalstackService) GetComposeConfig() (*types.Config, error) {
},
}

// If the localstack auth token is set, add it to the secrets
// If the localstack auth token is set, add it to the environment
if localstackAuthToken != "" {
services[0].Secrets = []types.ServiceSecretConfig{
{
Source: "LOCALSTACK_AUTH_TOKEN",
},
}
services[0].Environment["LOCALSTACK_AUTH_TOKEN"] = ptrString("${LOCALSTACK_AUTH_TOKEN}")
}

return &types.Config{Services: services}, nil
Expand Down
4 changes: 2 additions & 2 deletions pkg/services/localstack_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ func TestLocalstackService_GetComposeConfig(t *testing.T) {
}

service := composeConfig.Services[0]
if len(service.Secrets) == 0 || service.Secrets[0].Source != "LOCALSTACK_AUTH_TOKEN" {
t.Errorf("expected service to have LOCALSTACK_AUTH_TOKEN secret, got %v", service.Secrets)
if service.Environment["LOCALSTACK_AUTH_TOKEN"] == nil || *service.Environment["LOCALSTACK_AUTH_TOKEN"] != "${LOCALSTACK_AUTH_TOKEN}" {
t.Errorf("expected service to have LOCALSTACK_AUTH_TOKEN environment variable, got %v", service.Environment["LOCALSTACK_AUTH_TOKEN"])
}
})
}
Loading