Skip to content

Commit

Permalink
Merge branch 'main' into sr/redpanda/sasl+tls
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya authored Jan 31, 2024
2 parents ef07e64 + 83ae8bf commit 871b363
Show file tree
Hide file tree
Showing 125 changed files with 4,912 additions and 2,561 deletions.
35 changes: 28 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ updates:
day: sunday
open-pull-requests-limit: 3
rebase-strategy: disabled
- package-ecosystem: gomod
directory: /examples/cockroachdb
schedule:
interval: monthly
day: sunday
open-pull-requests-limit: 3
rebase-strategy: disabled
- package-ecosystem: gomod
directory: /examples/consul
schedule:
Expand Down Expand Up @@ -79,6 +72,13 @@ updates:
day: sunday
open-pull-requests-limit: 3
rebase-strategy: disabled
- package-ecosystem: gomod
directory: /modules/cockroachdb
schedule:
interval: monthly
day: sunday
open-pull-requests-limit: 3
rebase-strategy: disabled
- package-ecosystem: gomod
directory: /modules/compose
schedule:
Expand Down Expand Up @@ -107,6 +107,13 @@ updates:
day: sunday
open-pull-requests-limit: 3
rebase-strategy: disabled
- package-ecosystem: gomod
directory: /modules/inbucket
schedule:
interval: monthly
day: sunday
open-pull-requests-limit: 3
rebase-strategy: disabled
- package-ecosystem: gomod
directory: /modules/k3s
schedule:
Expand Down Expand Up @@ -142,6 +149,13 @@ updates:
day: sunday
open-pull-requests-limit: 3
rebase-strategy: disabled
- package-ecosystem: gomod
directory: /modules/minio
schedule:
interval: monthly
day: sunday
open-pull-requests-limit: 3
rebase-strategy: disabled
- package-ecosystem: gomod
directory: /modules/mockserver
schedule:
Expand Down Expand Up @@ -184,6 +198,13 @@ updates:
day: sunday
open-pull-requests-limit: 3
rebase-strategy: disabled
- package-ecosystem: gomod
directory: /modules/openldap
schedule:
interval: monthly
day: sunday
open-pull-requests-limit: 3
rebase-strategy: disabled
- package-ecosystem: gomod
directory: /modules/postgres
schedule:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:

- name: golangci-lint
# TODO: Remove each example/module once it passes the golangci-lint
if: ${{ inputs.platform == 'ubuntu-latest' && inputs.go-version == '1.20.x' && !contains(fromJSON('["modules/compose"]'), inputs.project-directory) }}
if: ${{ inputs.platform == 'ubuntu-latest' && inputs.go-version == '1.20.x' }}
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ jobs:
strategy:
matrix:
go-version: [1.20.x, 1.x]
platform: [ubuntu-latest, macos-latest]
module: [artemis, cassandra, clickhouse, compose, couchbase, elasticsearch, gcloud, k3s, k6, kafka, localstack, mariadb, mockserver, mongodb, mssql, mysql, nats, neo4j, postgres, pulsar, rabbitmq, redis, redpanda, vault]
platform: [ubuntu-latest]
module: [artemis, cassandra, clickhouse, cockroachdb, compose, couchbase, elasticsearch, gcloud, inbucket, k3s, k6, kafka, localstack, mariadb, minio, mockserver, mongodb, mssql, mysql, nats, neo4j, openldap, postgres, pulsar, rabbitmq, redis, redpanda, vault]
exclude:
- go-version: 1.20.x
module: compose
Expand All @@ -124,7 +124,7 @@ jobs:
needs: test-modules
strategy:
matrix:
module: [cockroachdb, consul, nginx, toxiproxy]
module: [consul, nginx, toxiproxy]
uses: ./.github/workflows/ci-test-go.yml
with:
go-version: "1.20.x"
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ linters-settings:
- prefix(github.com/testcontainers)
testifylint:
disable:
- compares
- float-compare
- go-require
enable:
- bool-compare
- compares
- empty
- error-is-as
- error-nil
Expand Down
20 changes: 16 additions & 4 deletions .vscode/.testcontainers-go.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
"name": "testcontainers-go",
"path": "../"
},
{
"name": "example / cockroachdb",
"path": "../examples/cockroachdb"
},
{
"name": "example / consul",
"path": "../examples/consul"
Expand All @@ -33,6 +29,10 @@
"name": "module / clickhouse",
"path": "../modules/clickhouse"
},
{
"name": "module / cockroachdb",
"path": "../modules/cockroachdb"
},
{
"name": "module / compose",
"path": "../modules/compose"
Expand All @@ -49,6 +49,10 @@
"name": "module / gcloud",
"path": "../modules/gcloud"
},
{
"name": "module / inbucket",
"path": "../modules/inbucket"
},
{
"name": "module / k3s",
"path": "../modules/k3s"
Expand All @@ -69,6 +73,10 @@
"name": "module / mariadb",
"path": "../modules/mariadb"
},
{
"name": "module / minio",
"path": "../modules/minio"
},
{
"name": "module / mockserver",
"path": "../modules/mockserver"
Expand All @@ -93,6 +101,10 @@
"name": "module / neo4j",
"path": "../modules/neo4j"
},
{
"name": "module / openldap",
"path": "../modules/openldap"
},
{
"name": "module / postgres",
"path": "../modules/postgres"
Expand Down
4 changes: 2 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ git add modules/**/go.*
git commit -m chore: use new version (v0.20.1) in modules and examples
git tag v0.20.1
git tag examples/bigtable/v0.20.1
git tag examples/cockroachdb/v0.20.1
git tag examples/consul/v0.20.1
git tag examples/datastore/v0.20.1
git tag examples/firestore/v0.20.1
Expand All @@ -159,6 +158,7 @@ git tag examples/nginx/v0.20.1
git tag examples/pubsub/v0.20.1
git tag examples/spanner/v0.20.1
git tag examples/toxiproxy/v0.20.1
git tag modules/cockroachdb/v0.20.1
git tag modules/compose/v0.20.1
git tag modules/couchbase/v0.20.1
git tag modules/localstack/v0.20.1
Expand All @@ -178,7 +178,6 @@ git commit -m chore: prepare for next minor development cycle (0.21.0)
git push origin main --tags
curl https://proxy.golang.org/github.com/testcontainers/testcontainers-go/@v/v0.20.1.info
curl https://proxy.golang.org/github.com/testcontainers/testcontainers-go/examples/bigtable/@v/v0.20.1.info
curl https://proxy.golang.org/github.com/testcontainers/testcontainers-go/examples/cockroachdb/@v/v0.20.1.info
curl https://proxy.golang.org/github.com/testcontainers/testcontainers-go/examples/consul/@v/v0.20.1.info
curl https://proxy.golang.org/github.com/testcontainers/testcontainers-go/examples/datastore/@v/v0.20.1.info
curl https://proxy.golang.org/github.com/testcontainers/testcontainers-go/examples/firestore/@v/v0.20.1.info
Expand All @@ -187,6 +186,7 @@ curl https://proxy.golang.org/github.com/testcontainers/testcontainers-go/exampl
curl https://proxy.golang.org/github.com/testcontainers/testcontainers-go/examples/pubsub/@v/v0.20.1.info
curl https://proxy.golang.org/github.com/testcontainers/testcontainers-go/examples/spanner/@v/v0.20.1.info
curl https://proxy.golang.org/github.com/testcontainers/testcontainers-go/examples/toxiproxy/@v/v0.20.1.info
curl https://proxy.golang.org/github.com/testcontainers/testcontainers-go/modules/cockroachdb/@v/v0.20.1.info
curl https://proxy.golang.org/github.com/testcontainers/testcontainers-go/modules/compose/@v/v0.20.1.info
curl https://proxy.golang.org/github.com/testcontainers/testcontainers-go/modules/couchbase/@v/v0.20.1.info
curl https://proxy.golang.org/github.com/testcontainers/testcontainers-go/modules/localstack/@v/v0.20.1.info
Expand Down
25 changes: 13 additions & 12 deletions container.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,25 @@ type Container interface {
Ports(context.Context) (nat.PortMap, error) // get all exposed ports
SessionID() string // get session id
IsRunning() bool
Start(context.Context) error // start the container
Stop(context.Context, *time.Duration) error // stop the container
Terminate(context.Context) error // terminate the container
Logs(context.Context) (io.ReadCloser, error) // Get logs of the container
FollowOutput(LogConsumer)
StartLogProducer(context.Context, ...LogProducerOption) error
StopLogProducer() error
Name(context.Context) (string, error) // get container name
State(context.Context) (*types.ContainerState, error) // returns container's running state
Networks(context.Context) ([]string, error) // get container networks
NetworkAliases(context.Context) (map[string][]string, error) // get container network aliases for a network
Start(context.Context) error // start the container
Stop(context.Context, *time.Duration) error // stop the container
Terminate(context.Context) error // terminate the container
Logs(context.Context) (io.ReadCloser, error) // Get logs of the container
FollowOutput(LogConsumer) // Deprecated: it will be removed in the next major release
StartLogProducer(context.Context, ...LogProductionOption) error // Deprecated: Use the ContainerRequest instead
StopLogProducer() error // Deprecated: it will be removed in the next major release
Name(context.Context) (string, error) // get container name
State(context.Context) (*types.ContainerState, error) // returns container's running state
Networks(context.Context) ([]string, error) // get container networks
NetworkAliases(context.Context) (map[string][]string, error) // get container network aliases for a network
Exec(ctx context.Context, cmd []string, options ...tcexec.ProcessOption) (int, io.Reader, error)
ContainerIP(context.Context) (string, error) // get container ip
ContainerIPs(context.Context) ([]string, error) // get all container IPs
CopyToContainer(ctx context.Context, fileContent []byte, containerFilePath string, fileMode int64) error
CopyDirToContainer(ctx context.Context, hostDirPath string, containerParentPath string, fileMode int64) error
CopyFileToContainer(ctx context.Context, hostFilePath string, containerFilePath string, fileMode int64) error
CopyFileFromContainer(ctx context.Context, filePath string) (io.ReadCloser, error)
GetLogProducerErrorChannel() <-chan error
GetLogProductionErrorChannel() <-chan error
}

// ImageBuildInfo defines what is needed to build an image
Expand Down Expand Up @@ -143,6 +143,7 @@ type ContainerRequest struct {
HostConfigModifier func(*container.HostConfig) // Modifier for the host config before container creation
EnpointSettingsModifier func(map[string]*network.EndpointSettings) // Modifier for the network settings before container creation
LifecycleHooks []ContainerLifecycleHooks // define hooks to be executed during container lifecycle
LogConsumerCfg *LogConsumerConfig // define the configuration for the log producer and its log consumers to follow the logs
}

// containerOptions functional options for a container
Expand Down
Loading

0 comments on commit 871b363

Please sign in to comment.