mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2025-12-23 22:29:59 -05:00
build(deps): bump github.com/testcontainers/testcontainers-go/modules/opensearch
Bumps [github.com/testcontainers/testcontainers-go/modules/opensearch](https://github.com/testcontainers/testcontainers-go) from 0.39.0 to 0.40.0. - [Release notes](https://github.com/testcontainers/testcontainers-go/releases) - [Commits](https://github.com/testcontainers/testcontainers-go/compare/v0.39.0...v0.40.0) --- updated-dependencies: - dependency-name: github.com/testcontainers/testcontainers-go/modules/opensearch dependency-version: 0.40.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
committed by
Ralf Haferkamp
parent
9fb773891f
commit
4132d79ea6
2
go.mod
2
go.mod
@@ -83,7 +83,7 @@ require (
|
||||
github.com/stretchr/testify v1.11.1
|
||||
github.com/test-go/testify v1.1.4
|
||||
github.com/testcontainers/testcontainers-go v0.40.0
|
||||
github.com/testcontainers/testcontainers-go/modules/opensearch v0.39.0
|
||||
github.com/testcontainers/testcontainers-go/modules/opensearch v0.40.0
|
||||
github.com/theckman/yacspin v0.13.12
|
||||
github.com/thejerf/suture/v4 v4.0.6
|
||||
github.com/tidwall/gjson v1.18.0
|
||||
|
||||
4
go.sum
4
go.sum
@@ -1206,8 +1206,8 @@ github.com/test-go/testify v1.1.4 h1:Tf9lntrKUMHiXQ07qBScBTSA0dhYQlu83hswqelv1iE
|
||||
github.com/test-go/testify v1.1.4/go.mod h1:rH7cfJo/47vWGdi4GPj16x3/t1xGOj2YxzmNQzk2ghU=
|
||||
github.com/testcontainers/testcontainers-go v0.40.0 h1:pSdJYLOVgLE8YdUY2FHQ1Fxu+aMnb6JfVz1mxk7OeMU=
|
||||
github.com/testcontainers/testcontainers-go v0.40.0/go.mod h1:FSXV5KQtX2HAMlm7U3APNyLkkap35zNLxukw9oBi/MY=
|
||||
github.com/testcontainers/testcontainers-go/modules/opensearch v0.39.0 h1:IkJUhR8AigQxv7qHZho/OtTU6JtiSdBGVh76o175JGo=
|
||||
github.com/testcontainers/testcontainers-go/modules/opensearch v0.39.0/go.mod h1:B7AhrDmQ4QbpzA0BeWvqzaJ8vbwcdEQDzybr35sBRfw=
|
||||
github.com/testcontainers/testcontainers-go/modules/opensearch v0.40.0 h1:3TIrGk0zXyO9CG2N6APo7auwWIwAvhkwE1reISif8LM=
|
||||
github.com/testcontainers/testcontainers-go/modules/opensearch v0.40.0/go.mod h1:VA0UCTPu+Gcs7MzdzBnSl0qDnxquuphv3ngSGdX97Xs=
|
||||
github.com/thanhpk/randstr v1.0.6 h1:psAOktJFD4vV9NEVb3qkhRSMvYh4ORRaj1+w/hn4B+o=
|
||||
github.com/thanhpk/randstr v1.0.6/go.mod h1:M/H2P1eNLZzlDwAzpkkkUvoyNNMbzRGhESZuEQk3r0U=
|
||||
github.com/theckman/yacspin v0.13.12 h1:CdZ57+n0U6JMuh2xqjnjRq5Haj6v1ner2djtLQRzJr4=
|
||||
|
||||
76
vendor/github.com/testcontainers/testcontainers-go/modules/opensearch/opensearch.go
generated
vendored
76
vendor/github.com/testcontainers/testcontainers-go/modules/opensearch/opensearch.go
generated
vendored
@@ -35,17 +35,29 @@ func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomize
|
||||
|
||||
// Run creates an instance of the OpenSearch container type
|
||||
func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustomizer) (*OpenSearchContainer, error) {
|
||||
req := testcontainers.ContainerRequest{
|
||||
Image: img,
|
||||
ExposedPorts: []string{defaultHTTPPort, "9600/tcp"},
|
||||
Env: map[string]string{
|
||||
// Gather all config options (defaults and then apply provided options)
|
||||
settings := defaultOptions()
|
||||
for _, opt := range opts {
|
||||
if apply, ok := opt.(Option); ok {
|
||||
if err := apply(settings); err != nil {
|
||||
return nil, fmt.Errorf("apply option: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
username := settings.Username
|
||||
password := settings.Password
|
||||
|
||||
moduleOpts := []testcontainers.ContainerCustomizer{
|
||||
testcontainers.WithEnv(map[string]string{
|
||||
"discovery.type": "single-node",
|
||||
"DISABLE_INSTALL_DEMO_CONFIG": "true",
|
||||
"DISABLE_SECURITY_PLUGIN": "true",
|
||||
"OPENSEARCH_USERNAME": defaultUsername,
|
||||
"OPENSEARCH_PASSWORD": defaultPassword,
|
||||
},
|
||||
HostConfigModifier: func(hc *container.HostConfig) {
|
||||
"OPENSEARCH_USERNAME": username,
|
||||
"OPENSEARCH_PASSWORD": password,
|
||||
}),
|
||||
testcontainers.WithExposedPorts(defaultHTTPPort, "9600/tcp"),
|
||||
testcontainers.WithHostConfigModifier(func(hc *container.HostConfig) {
|
||||
hc.Ulimits = []*units.Ulimit{
|
||||
{
|
||||
Name: "memlock",
|
||||
@@ -58,39 +70,10 @@ func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustom
|
||||
Hard: 65536,
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
genericContainerReq := testcontainers.GenericContainerRequest{
|
||||
ContainerRequest: req,
|
||||
Started: true,
|
||||
}
|
||||
|
||||
// Gather all config options (defaults and then apply provided options)
|
||||
settings := defaultOptions()
|
||||
for _, opt := range opts {
|
||||
if apply, ok := opt.(Option); ok {
|
||||
apply(settings)
|
||||
}
|
||||
if err := opt.Customize(&genericContainerReq); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
// set credentials if they are provided, otherwise use the defaults
|
||||
if settings.Username != "" {
|
||||
genericContainerReq.Env["OPENSEARCH_USERNAME"] = settings.Username
|
||||
}
|
||||
if settings.Password != "" {
|
||||
genericContainerReq.Env["OPENSEARCH_PASSWORD"] = settings.Password
|
||||
}
|
||||
|
||||
username := genericContainerReq.Env["OPENSEARCH_USERNAME"]
|
||||
password := genericContainerReq.Env["OPENSEARCH_PASSWORD"]
|
||||
|
||||
// the wat strategy does not support TLS at the moment,
|
||||
}),
|
||||
// the wait strategy does not support TLS at the moment,
|
||||
// so we need to disable it in the strategy for now.
|
||||
genericContainerReq.WaitingFor = wait.ForHTTP("/").
|
||||
testcontainers.WithWaitStrategy(wait.ForHTTP("/").
|
||||
WithPort("9200").
|
||||
WithTLS(false).
|
||||
WithStartupTimeout(120*time.Second).
|
||||
@@ -115,16 +98,19 @@ func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustom
|
||||
}
|
||||
|
||||
return r.Tagline == "The OpenSearch Project: https://opensearch.org/"
|
||||
})
|
||||
})),
|
||||
}
|
||||
|
||||
container, err := testcontainers.GenericContainer(ctx, genericContainerReq)
|
||||
moduleOpts = append(moduleOpts, opts...)
|
||||
|
||||
ctr, err := testcontainers.Run(ctx, img, moduleOpts...)
|
||||
var c *OpenSearchContainer
|
||||
if container != nil {
|
||||
c = &OpenSearchContainer{Container: container, User: username, Password: password}
|
||||
if ctr != nil {
|
||||
c = &OpenSearchContainer{Container: ctr, User: username, Password: password}
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return c, fmt.Errorf("generic container: %w", err)
|
||||
return c, fmt.Errorf("run opensearch: %w", err)
|
||||
}
|
||||
|
||||
return c, nil
|
||||
|
||||
8
vendor/github.com/testcontainers/testcontainers-go/modules/opensearch/options.go
generated
vendored
8
vendor/github.com/testcontainers/testcontainers-go/modules/opensearch/options.go
generated
vendored
@@ -19,7 +19,7 @@ func defaultOptions() *Options {
|
||||
var _ testcontainers.ContainerCustomizer = (*Option)(nil)
|
||||
|
||||
// Option is an option for the OpenSearch container.
|
||||
type Option func(*Options)
|
||||
type Option func(*Options) error
|
||||
|
||||
// Customize is a NOOP. It's defined to satisfy the testcontainers.ContainerCustomizer interface.
|
||||
func (o Option) Customize(*testcontainers.GenericContainerRequest) error {
|
||||
@@ -29,14 +29,16 @@ func (o Option) Customize(*testcontainers.GenericContainerRequest) error {
|
||||
|
||||
// WithPassword sets the password for the OpenSearch container.
|
||||
func WithPassword(password string) Option {
|
||||
return func(o *Options) {
|
||||
return func(o *Options) error {
|
||||
o.Password = password
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithUsername sets the username for the OpenSearch container.
|
||||
func WithUsername(username string) Option {
|
||||
return func(o *Options) {
|
||||
return func(o *Options) error {
|
||||
o.Username = username
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@@ -2099,7 +2099,7 @@ github.com/testcontainers/testcontainers-go/internal/core
|
||||
github.com/testcontainers/testcontainers-go/internal/core/network
|
||||
github.com/testcontainers/testcontainers-go/log
|
||||
github.com/testcontainers/testcontainers-go/wait
|
||||
# github.com/testcontainers/testcontainers-go/modules/opensearch v0.39.0
|
||||
# github.com/testcontainers/testcontainers-go/modules/opensearch v0.40.0
|
||||
## explicit; go 1.24.0
|
||||
github.com/testcontainers/testcontainers-go/modules/opensearch
|
||||
# github.com/theckman/yacspin v0.13.12
|
||||
|
||||
Reference in New Issue
Block a user