mirror of
https://github.com/status-im/consul.git
synced 2025-01-11 22:34:55 +00:00
d59efd390c
- remove dep on consul main module - use 'consul tls' subcommands instead of tlsutil - use direct json config construction instead of agent/config structs - merge libcluster and libagent packages together - more widely use BuildContext - get the OSS/ENT runner stuff working properly - reduce some flakiness - fix some correctness related to http/https API
27 lines
612 B
Go
27 lines
612 B
Go
package cluster
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/pkg/errors"
|
|
"github.com/testcontainers/testcontainers-go"
|
|
)
|
|
|
|
func createNetwork(t TestingT, name string) (testcontainers.Network, error) {
|
|
req := testcontainers.GenericNetworkRequest{
|
|
NetworkRequest: testcontainers.NetworkRequest{
|
|
Name: name,
|
|
Attachable: true,
|
|
CheckDuplicate: true,
|
|
},
|
|
}
|
|
network, err := testcontainers.GenericNetwork(context.Background(), req)
|
|
if err != nil {
|
|
return nil, errors.Wrap(err, "could not create network")
|
|
}
|
|
t.Cleanup(func() {
|
|
_ = network.Remove(context.Background())
|
|
})
|
|
return network, nil
|
|
}
|