-
-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "chore: use new container request customisation in localstack"
This reverts commit 376dc26.
- Loading branch information
1 parent
717bc09
commit b871fe7
Showing
6 changed files
with
54 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,40 @@ | ||
package localstack | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/imdario/mergo" | ||
"github.com/testcontainers/testcontainers-go" | ||
) | ||
|
||
// Container represents the LocalStack container type used in the module | ||
type Container struct { | ||
testcontainers.Container | ||
} | ||
|
||
// Deprecated: use Container instead | ||
// LocalStackContainer represents the LocalStack container type used in the module | ||
type LocalStackContainer struct { | ||
Container | ||
testcontainers.Container | ||
} | ||
|
||
// ContainerRequest represents the LocalStack container request type used in the module | ||
// LocalStackContainerRequest represents the LocalStack container request type used in the module | ||
// to configure the container | ||
type ContainerRequest struct { | ||
testcontainers.ContainerRequest | ||
} | ||
|
||
// Deprecated: use ContainerRequest instead | ||
type LocalStackContainerRequest struct { | ||
ContainerRequest | ||
testcontainers.ContainerRequest | ||
} | ||
|
||
// OverrideContainerRequestOption is a type that can be used to configure the Testcontainers container request. | ||
// The passed request will be merged with the default one. | ||
// Deprecated: use testcontainers.CustomizeContainerRequestOption instead | ||
type OverrideContainerRequestOption func(req testcontainers.ContainerRequest) testcontainers.ContainerRequest | ||
|
||
// NoopOverrideContainerRequest returns a helper function that does not override the container request | ||
// Deprecated | ||
var NoopOverrideContainerRequest = func(req testcontainers.ContainerRequest) testcontainers.ContainerRequest { | ||
return req | ||
} | ||
|
||
// OverrideContainerRequest returns a function that can be used to merge the passed container request with one that is created by the LocalStack container | ||
// Deprecated: use testcontainers.CustomizeContainerRequestOption instead | ||
func OverrideContainerRequest(r testcontainers.ContainerRequest) func(req testcontainers.ContainerRequest) testcontainers.ContainerRequest { | ||
return testcontainers.CustomizeContainerRequest(r) | ||
return func(req testcontainers.ContainerRequest) testcontainers.ContainerRequest { | ||
if err := mergo.Merge(&req, r, mergo.WithOverride); err != nil { | ||
fmt.Printf("error merging container request %v. Keeping the default one: %v", err, req) | ||
return req | ||
} | ||
|
||
return req | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters