From 4bf9515566f261cc97929caa57e86ea0e25c8814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Thu, 15 Feb 2024 00:49:31 +0100 Subject: [PATCH 01/10] chore(ci): do not fail fast main tests in different Go versions (#2210) * chore(ci): do not fail fast main tests in different Go versions * chore: revert fail-fast condition for the main job --- .github/workflows/ci.yml | 4 ++-- modulegen/_template/ci.yml.tmpl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2302a66a4..2c7b90777c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: uses: ./.github/workflows/ci-test-go.yml with: go-version: ${{ matrix.go-version }} - fail-fast: true + fail-fast: false platform: "ubuntu-latest" project-directory: "." rootless-docker: false @@ -72,7 +72,7 @@ jobs: uses: ./.github/workflows/ci-test-go.yml with: go-version: ${{ matrix.go-version }} - fail-fast: true + fail-fast: false platform: "ubuntu-latest" project-directory: "." rootless-docker: true diff --git a/modulegen/_template/ci.yml.tmpl b/modulegen/_template/ci.yml.tmpl index 38162c4845..defba6beb8 100644 --- a/modulegen/_template/ci.yml.tmpl +++ b/modulegen/_template/ci.yml.tmpl @@ -52,7 +52,7 @@ jobs: uses: ./.github/workflows/ci-test-go.yml with: go-version: {{ "${{ matrix.go-version }}" }} - fail-fast: true + fail-fast: false platform: "ubuntu-latest" project-directory: "." rootless-docker: false @@ -72,7 +72,7 @@ jobs: uses: ./.github/workflows/ci-test-go.yml with: go-version: {{ "${{ matrix.go-version }}" }} - fail-fast: true + fail-fast: false platform: "ubuntu-latest" project-directory: "." rootless-docker: true From 1f628e25935b2d0adbc9b5344d6ff35000165f85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Thu, 15 Feb 2024 01:35:46 +0100 Subject: [PATCH 02/10] fix: wait more time in test (#2211) --- docker_files_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker_files_test.go b/docker_files_test.go index 065f87443f..d6eb15b804 100644 --- a/docker_files_test.go +++ b/docker_files_test.go @@ -81,7 +81,7 @@ func TestCopyFileToRunningContainer(t *testing.T) { require.NoError(t, err) // Give some time to the wait script to catch the hello script being created - err = wait.ForLog("done").WithStartupTimeout(200*time.Millisecond).WaitUntilReady(ctx, container) + err = wait.ForLog("done").WithStartupTimeout(2*time.Second).WaitUntilReady(ctx, container) require.NoError(t, err) require.NoError(t, container.Terminate(ctx)) From 50fc8e7e61664f1ad07389eda0c0da2d1b20cd90 Mon Sep 17 00:00:00 2001 From: Chris <8493773+Chris-AS1@users.noreply.github.com> Date: Thu, 15 Feb 2024 11:18:14 +0100 Subject: [PATCH 03/10] Added Consul module (#2194) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * added consul module * removed existing examples * added WithConfigFile and examples. swapped panics with fatalf * removed more references * chore: run make lint * chore: reverse assertion * chore: fix lint * docs: use pinned version in docs --------- Co-authored-by: Manuel de la Peña --- .github/dependabot.yml | 14 ++-- .github/workflows/ci.yml | 4 +- .vscode/.testcontainers-go.code-workspace | 10 +-- RELEASING.md | 2 - docs/examples/consul.md | 9 --- docs/modules/consul.md | 58 +++++++++++++++ examples/consul/consul.go | 44 ------------ examples/consul/consul_test.go | 48 ------------- mkdocs.yml | 2 +- {examples => modules}/consul/Makefile | 1 + modules/consul/consul.go | 88 +++++++++++++++++++++++ modules/consul/consul_test.go | 73 +++++++++++++++++++ modules/consul/examples_test.go | 83 +++++++++++++++++++++ {examples => modules}/consul/go.mod | 6 +- {examples => modules}/consul/go.sum | 6 ++ modules/consul/testdata/config.json | 3 + sonar-project.properties | 2 +- 17 files changed, 333 insertions(+), 120 deletions(-) delete mode 100644 docs/examples/consul.md create mode 100644 docs/modules/consul.md delete mode 100644 examples/consul/consul.go delete mode 100644 examples/consul/consul_test.go rename {examples => modules}/consul/Makefile (98%) create mode 100644 modules/consul/consul.go create mode 100644 modules/consul/consul_test.go create mode 100644 modules/consul/examples_test.go rename {examples => modules}/consul/go.mod (92%) rename {examples => modules}/consul/go.sum (98%) create mode 100644 modules/consul/testdata/config.json diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 25b9e9a0cb..31229f5111 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -23,13 +23,6 @@ updates: day: sunday open-pull-requests-limit: 3 rebase-strategy: disabled - - package-ecosystem: gomod - directory: /examples/consul - schedule: - interval: monthly - day: sunday - open-pull-requests-limit: 3 - rebase-strategy: disabled - package-ecosystem: gomod directory: /examples/nginx schedule: @@ -86,6 +79,13 @@ updates: day: sunday open-pull-requests-limit: 3 rebase-strategy: disabled + - package-ecosystem: gomod + directory: /modules/consul + schedule: + interval: monthly + day: sunday + open-pull-requests-limit: 3 + rebase-strategy: disabled - package-ecosystem: gomod directory: /modules/couchbase schedule: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c7b90777c..a40a43666e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,7 +104,7 @@ jobs: matrix: go-version: [1.20.x, 1.x] 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] + module: [artemis, cassandra, clickhouse, cockroachdb, compose, consul, 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 @@ -124,7 +124,7 @@ jobs: needs: test-modules strategy: matrix: - module: [consul, nginx, toxiproxy] + module: [nginx, toxiproxy] uses: ./.github/workflows/ci-test-go.yml with: go-version: "1.20.x" diff --git a/.vscode/.testcontainers-go.code-workspace b/.vscode/.testcontainers-go.code-workspace index 962dbe5886..a1bd38e6ed 100644 --- a/.vscode/.testcontainers-go.code-workspace +++ b/.vscode/.testcontainers-go.code-workspace @@ -5,10 +5,6 @@ "name": "testcontainers-go", "path": "../" }, - { - "name": "example / consul", - "path": "../examples/consul" - }, { "name": "example / nginx", "path": "../examples/nginx" @@ -37,6 +33,10 @@ "name": "module / compose", "path": "../modules/compose" }, + { + "name": "module / consul", + "path": "../modules/consul" + }, { "name": "module / couchbase", "path": "../modules/couchbase" @@ -134,4 +134,4 @@ "path": "../modulegen" } ] -} \ No newline at end of file +} diff --git a/RELEASING.md b/RELEASING.md index fb3727b9cc..31a9954933 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -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/consul/v0.20.1 git tag examples/datastore/v0.20.1 git tag examples/firestore/v0.20.1 git tag examples/mongodb/v0.20.1 @@ -178,7 +177,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/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 curl https://proxy.golang.org/github.com/testcontainers/testcontainers-go/examples/mongodb/@v/v0.20.1.info diff --git a/docs/examples/consul.md b/docs/examples/consul.md deleted file mode 100644 index 6f8cb8bc76..0000000000 --- a/docs/examples/consul.md +++ /dev/null @@ -1,9 +0,0 @@ -# Consul - - -[Creating a Consul container](../../examples/consul/consul.go) - - - -[Test for a Consul container](../../examples/consul/consul_test.go) - diff --git a/docs/modules/consul.md b/docs/modules/consul.md new file mode 100644 index 0000000000..ba21cc39b1 --- /dev/null +++ b/docs/modules/consul.md @@ -0,0 +1,58 @@ +# Consul + +Not available until the next release of testcontainers-go :material-tag: main + +## Introduction + +The Testcontainers module for Consul. + +## Adding this module to your project dependencies + +Please run the following command to add the Consul module to your Go dependencies: + +``` +go get github.com/testcontainers/testcontainers-go/modules/consul +``` + +## Usage example + + +[Creating a Consul container](../../modules/consul/examples_test.go) inside_block:runConsulContainer + + +## Module reference + +The Consul module exposes one entrypoint function to create the Consul container, and this function receives two parameters: + +```golang +func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*ConsulContainer, error) +``` + +- `context.Context`, the Go context. +- `testcontainers.ContainerCustomizer`, a variadic argument for passing options. + +### Container Options + +When starting the Consul container, you can pass options in a variadic way to configure it. + +#### Image + +If you need to set a different Consul Docker image, you can use `testcontainers.WithImage` with a valid Docker image +for Consul. E.g. `testcontainers.WithImage("docker.io/hashicorp/consul:1.15")`. + +{% include "../features/common_functional_options.md" %} + +#### Configuration File +If you need to customize the behavior for the deployed node you can use either `WithConfigString(config string)` or `WithConfigFile(configPath string)`. +The configuration has to be in JSON format and will be loaded at the node startup. + +### Container Methods + +The Consul container exposes the following method: + +#### ApiEndpoint +This method returns the connection string to connect to the Consul container API, using the default `8500` port. + + +[Using ApiEndpoint with the Consul client](../../modules/consul/examples_test.go) inside_block:connectConsul + diff --git a/examples/consul/consul.go b/examples/consul/consul.go deleted file mode 100644 index 46c1b62642..0000000000 --- a/examples/consul/consul.go +++ /dev/null @@ -1,44 +0,0 @@ -package consul - -import ( - "context" - "fmt" - - "github.com/testcontainers/testcontainers-go" - "github.com/testcontainers/testcontainers-go/wait" -) - -// consulContainer represents the consul container type used in the module -type consulContainer struct { - testcontainers.Container - endpoint string -} - -// startContainer creates an instance of the consul container type -func startContainer(ctx context.Context) (*consulContainer, error) { - req := testcontainers.ContainerRequest{ - Image: "hashicorp/consul:latest", - ExposedPorts: []string{"8500/tcp", "8600/udp"}, - Name: "badger", - Cmd: []string{"agent", "-server", "-ui", "-node=server-1", "-bootstrap-expect=1", "-client=0.0.0.0"}, - WaitingFor: wait.ForListeningPort("8500/tcp"), - } - container, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ - ContainerRequest: req, - Started: true, - }) - if err != nil { - return nil, err - } - mappedPort, err := container.MappedPort(ctx, "8500") - if err != nil { - return nil, err - } - - host, err := container.Host(ctx) - if err != nil { - return nil, err - } - - return &consulContainer{Container: container, endpoint: fmt.Sprintf("%s:%s", host, mappedPort.Port())}, nil -} diff --git a/examples/consul/consul_test.go b/examples/consul/consul_test.go deleted file mode 100644 index f22e89290c..0000000000 --- a/examples/consul/consul_test.go +++ /dev/null @@ -1,48 +0,0 @@ -package consul - -import ( - "bytes" - "context" - "testing" - - "github.com/hashicorp/consul/api" -) - -func TestConsul(t *testing.T) { - ctx := context.Background() - - container, err := startContainer(ctx) - if err != nil { - t.Fatal(err) - } - - // Clean up the container after the test is complete - t.Cleanup(func() { - if err := container.Terminate(ctx); err != nil { - t.Fatalf("failed to terminate container: %s", err) - } - }) - - // perform assertions - cfg := api.DefaultConfig() - cfg.Address = container.endpoint - client, err := api.NewClient(cfg) - if nil != err { - t.Fatal(err) - } - bs := []byte("apple") - _, err = client.KV().Put(&api.KVPair{ - Key: "fruit", - Value: bs, - }, nil) - if nil != err { - t.Fatal(err) - } - pair, _, err := client.KV().Get("fruit", nil) - if err != nil { - t.Fatal(err) - } - if pair.Key != "fruit" || !bytes.Equal(pair.Value, []byte("apple")) { - t.Errorf("get KV: %v %s,expect them to be: 'fruit' and 'apple'\n", pair.Key, pair.Value) - } -} diff --git a/mkdocs.yml b/mkdocs.yml index 6d6e7b75a5..cbee932874 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -67,6 +67,7 @@ nav: - modules/cassandra.md - modules/clickhouse.md - modules/cockroachdb.md + - modules/consul.md - modules/couchbase.md - modules/elasticsearch.md - modules/gcloud.md @@ -92,7 +93,6 @@ nav: - modules/vault.md - Examples: - examples/index.md - - examples/consul.md - examples/nginx.md - examples/toxiproxy.md - System Requirements: diff --git a/examples/consul/Makefile b/modules/consul/Makefile similarity index 98% rename from examples/consul/Makefile rename to modules/consul/Makefile index 4e67d96436..3e9bb56a17 100644 --- a/examples/consul/Makefile +++ b/modules/consul/Makefile @@ -3,3 +3,4 @@ include ../../commons-test.mk .PHONY: test test: $(MAKE) test-consul + diff --git a/modules/consul/consul.go b/modules/consul/consul.go new file mode 100644 index 0000000000..08a6e0ece2 --- /dev/null +++ b/modules/consul/consul.go @@ -0,0 +1,88 @@ +package consul + +import ( + "context" + "fmt" + + "github.com/testcontainers/testcontainers-go" + "github.com/testcontainers/testcontainers-go/wait" +) + +const ( + defaultHttpApiPort = "8500" + defaultBrokerPort = "8600" +) + +const ( + DefaultBaseImage = "docker.io/hashicorp/consul:1.15" +) + +// ConsulContainer represents the Consul container type used in the module. +type ConsulContainer struct { + testcontainers.Container +} + +// ApiEndpoint returns host:port for the HTTP API endpoint. +func (c *ConsulContainer) ApiEndpoint(ctx context.Context) (string, error) { + mappedPort, err := c.MappedPort(ctx, defaultHttpApiPort) + if err != nil { + return "", err + } + + hostIP, err := c.Host(ctx) + if err != nil { + return "", err + } + + uri := fmt.Sprintf("%s:%s", hostIP, mappedPort.Port()) + return uri, nil +} + +// WithConfigString takes in a JSON string of keys and values to define a configuration to be used by the instance. +func WithConfigString(config string) testcontainers.CustomizeRequestOption { + return func(req *testcontainers.GenericContainerRequest) { + req.Env["CONSUL_LOCAL_CONFIG"] = config + } +} + +// WithConfigFile takes in a path to a JSON file to define a configuration to be used by the instance. +func WithConfigFile(configPath string) testcontainers.CustomizeRequestOption { + return func(req *testcontainers.GenericContainerRequest) { + cf := testcontainers.ContainerFile{ + HostFilePath: configPath, + ContainerFilePath: "/consul/config/node.json", + FileMode: 0o755, + } + req.Files = append(req.Files, cf) + } +} + +// RunContainer creates an instance of the Consul container type +func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*ConsulContainer, error) { + containerReq := testcontainers.GenericContainerRequest{ + ContainerRequest: testcontainers.ContainerRequest{ + Image: DefaultBaseImage, + ExposedPorts: []string{ + defaultHttpApiPort + "/tcp", + defaultBrokerPort + "/tcp", + defaultBrokerPort + "/udp", + }, + Env: map[string]string{}, + WaitingFor: wait.ForAll( + wait.ForLog("Consul agent running!"), + ), + }, + Started: true, + } + + for _, opt := range opts { + opt.Customize(&containerReq) + } + + container, err := testcontainers.GenericContainer(ctx, containerReq) + if err != nil { + return nil, err + } + + return &ConsulContainer{Container: container}, nil +} diff --git a/modules/consul/consul_test.go b/modules/consul/consul_test.go new file mode 100644 index 0000000000..e9f6bfa860 --- /dev/null +++ b/modules/consul/consul_test.go @@ -0,0 +1,73 @@ +package consul_test + +import ( + "context" + "net/http" + "path/filepath" + "testing" + + capi "github.com/hashicorp/consul/api" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/testcontainers/testcontainers-go" + "github.com/testcontainers/testcontainers-go/modules/consul" +) + +func TestConsul(t *testing.T) { + ctx := context.Background() + tests := []struct { + name string + opts []testcontainers.ContainerCustomizer + }{ + { + name: "Default", + opts: []testcontainers.ContainerCustomizer{}, + }, + { + name: "WithConfigString", + opts: []testcontainers.ContainerCustomizer{ + consul.WithConfigString(`{ "server":true }`), + }, + }, + { + name: "WithConfigFile", + opts: []testcontainers.ContainerCustomizer{ + consul.WithConfigFile(filepath.Join("testdata", "config.json")), + }, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + container, err := consul.RunContainer(ctx, test.opts...) + require.NoError(t, err) + t.Cleanup(func() { require.NoError(t, container.Terminate(ctx), "failed to terminate container") }) + + // Check if API is up + host, err := container.ApiEndpoint(ctx) + require.NoError(t, err) + assert.NotEmpty(t, len(host)) + + res, err := http.Get("http://" + host) + require.NoError(t, err) + assert.Equal(t, http.StatusOK, res.StatusCode) + + cfg := capi.DefaultConfig() + cfg.Address = host + + reg := &capi.AgentServiceRegistration{ID: "abcd", Name: test.name} + + client, err := capi.NewClient(cfg) + require.NoError(t, err) + + // Register / Unregister service + s := client.Agent() + err = s.ServiceRegister(reg) + require.NoError(t, err) + + err = s.ServiceDeregister("abcd") + require.NoError(t, err) + }) + } +} diff --git a/modules/consul/examples_test.go b/modules/consul/examples_test.go new file mode 100644 index 0000000000..002c143c95 --- /dev/null +++ b/modules/consul/examples_test.go @@ -0,0 +1,83 @@ +package consul_test + +import ( + "context" + "fmt" + "log" + + capi "github.com/hashicorp/consul/api" + + "github.com/testcontainers/testcontainers-go" + "github.com/testcontainers/testcontainers-go/modules/consul" +) + +func ExampleRunContainer() { + // runConsulContainer { + ctx := context.Background() + + consulContainer, err := consul.RunContainer(ctx, + testcontainers.WithImage("docker.io/hashicorp/consul:1.15"), + ) + if err != nil { + log.Fatalf("failed to start container: %s", err) + } + + // Clean up the container + defer func() { + if err := consulContainer.Terminate(ctx); err != nil { + log.Fatalf("failed to terminate container: %s", err) + } + }() + // } + + state, err := consulContainer.State(ctx) + if err != nil { + log.Fatalf("failed to get container state: %s", err) // nolint:gocritic + } + + fmt.Println(state.Running) + + // Output: + // true +} + +func ExampleRunContainer_connect() { + // connectConsul { + ctx := context.Background() + + consulContainer, err := consul.RunContainer(ctx, + testcontainers.WithImage("docker.io/hashicorp/consul:1.15"), + ) + if err != nil { + log.Fatalf("failed to start container: %s", err) + } + + // Clean up the container + defer func() { + if err := consulContainer.Terminate(ctx); err != nil { + log.Fatalf("failed to terminate container: %s", err) + } + }() + + endpoint, err := consulContainer.ApiEndpoint(ctx) + if err != nil { + log.Fatalf("failed to get endpoint: %s", err) // nolint:gocritic + } + + config := capi.DefaultConfig() + config.Address = endpoint + client, err := capi.NewClient(config) + if err != nil { + log.Fatalf("failed to connect to Consul: %s", err) + } + // } + + node_name, err := client.Agent().NodeName() + if err != nil { + log.Fatalf("failed to get node name: %s", err) // nolint:gocritic + } + fmt.Println(len(node_name) > 0) + + // Output: + // true +} diff --git a/examples/consul/go.mod b/modules/consul/go.mod similarity index 92% rename from examples/consul/go.mod rename to modules/consul/go.mod index a177fe6244..f1adfded88 100644 --- a/examples/consul/go.mod +++ b/modules/consul/go.mod @@ -1,9 +1,10 @@ -module github.com/testcontainers/testcontainers-go/examples/consul +module github.com/testcontainers/testcontainers-go/modules/consul go 1.20 require ( github.com/hashicorp/consul/api v1.27.0 + github.com/stretchr/testify v1.8.4 github.com/testcontainers/testcontainers-go v0.27.0 ) @@ -17,6 +18,7 @@ require ( github.com/containerd/containerd v1.7.12 // indirect github.com/containerd/log v0.1.0 // indirect github.com/cpuguy83/dockercfg v0.3.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/distribution/reference v0.5.0 // indirect github.com/docker/docker v25.0.2+incompatible // indirect github.com/docker/go-connections v0.5.0 // indirect @@ -52,6 +54,7 @@ require ( github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc5 // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/shirou/gopsutil/v3 v3.23.12 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect @@ -70,6 +73,7 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect google.golang.org/grpc v1.58.3 // indirect google.golang.org/protobuf v1.31.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) replace github.com/testcontainers/testcontainers-go => ../.. diff --git a/examples/consul/go.sum b/modules/consul/go.sum similarity index 98% rename from examples/consul/go.sum rename to modules/consul/go.sum index 0cf02246a2..6a015d9eea 100644 --- a/examples/consul/go.sum +++ b/modules/consul/go.sum @@ -37,6 +37,7 @@ github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/docker v25.0.2+incompatible h1:/OaKeauroa10K4Nqavw4zlhcDq/WBcPMc5DbjOGgozY= @@ -135,8 +136,10 @@ github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQs github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -194,6 +197,7 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= @@ -209,6 +213,7 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= @@ -347,6 +352,7 @@ google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/modules/consul/testdata/config.json b/modules/consul/testdata/config.json new file mode 100644 index 0000000000..3e35005afb --- /dev/null +++ b/modules/consul/testdata/config.json @@ -0,0 +1,3 @@ +{ + "server": true +} diff --git a/sonar-project.properties b/sonar-project.properties index e332ab9c27..25d6e50b0d 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -18,4 +18,4 @@ sonar.test.inclusions=**/*_test.go sonar.test.exclusions=**/vendor/** sonar.go.coverage.reportPaths=**/coverage.out -sonar.go.tests.reportPaths=TEST-unit.xml,examples/consul/TEST-unit.xml,examples/nginx/TEST-unit.xml,examples/toxiproxy/TEST-unit.xml,modulegen/TEST-unit.xml,modules/artemis/TEST-unit.xml,modules/cassandra/TEST-unit.xml,modules/clickhouse/TEST-unit.xml,modules/cockroachdb/TEST-unit.xml,modules/compose/TEST-unit.xml,modules/couchbase/TEST-unit.xml,modules/elasticsearch/TEST-unit.xml,modules/gcloud/TEST-unit.xml,modules/inbucket/TEST-unit.xml,modules/k3s/TEST-unit.xml,modules/k6/TEST-unit.xml,modules/kafka/TEST-unit.xml,modules/localstack/TEST-unit.xml,modules/mariadb/TEST-unit.xml,modules/minio/TEST-unit.xml,modules/mockserver/TEST-unit.xml,modules/mongodb/TEST-unit.xml,modules/mssql/TEST-unit.xml,modules/mysql/TEST-unit.xml,modules/nats/TEST-unit.xml,modules/neo4j/TEST-unit.xml,modules/openldap/TEST-unit.xml,modules/postgres/TEST-unit.xml,modules/pulsar/TEST-unit.xml,modules/rabbitmq/TEST-unit.xml,modules/redis/TEST-unit.xml,modules/redpanda/TEST-unit.xml,modules/vault/TEST-unit.xml +sonar.go.tests.reportPaths=TEST-unit.xml,examples/nginx/TEST-unit.xml,examples/toxiproxy/TEST-unit.xml,modulegen/TEST-unit.xml,modules/artemis/TEST-unit.xml,modules/cassandra/TEST-unit.xml,modules/clickhouse/TEST-unit.xml,modules/cockroachdb/TEST-unit.xml,modules/compose/TEST-unit.xml,modules/consul/TEST-unit.xml,modules/couchbase/TEST-unit.xml,modules/elasticsearch/TEST-unit.xml,modules/gcloud/TEST-unit.xml,modules/inbucket/TEST-unit.xml,modules/k3s/TEST-unit.xml,modules/k6/TEST-unit.xml,modules/kafka/TEST-unit.xml,modules/localstack/TEST-unit.xml,modules/mariadb/TEST-unit.xml,modules/minio/TEST-unit.xml,modules/mockserver/TEST-unit.xml,modules/mongodb/TEST-unit.xml,modules/mssql/TEST-unit.xml,modules/mysql/TEST-unit.xml,modules/nats/TEST-unit.xml,modules/neo4j/TEST-unit.xml,modules/openldap/TEST-unit.xml,modules/postgres/TEST-unit.xml,modules/pulsar/TEST-unit.xml,modules/rabbitmq/TEST-unit.xml,modules/redis/TEST-unit.xml,modules/redpanda/TEST-unit.xml,modules/vault/TEST-unit.xml From c906e65a26478ec78463c378bbd37627ce279c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Thu, 15 Feb 2024 11:43:53 +0100 Subject: [PATCH 04/10] chore: define proper execution order for container lifecycle hooks (#1922) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: simplify test method * feat: define execution order for default hooks and user-defined hooks * chore: extract default hooks to variables * docs: include execution order in docs * docs: update docs for default logging hook * chore: use ✅ consistently in post hooks * fix: lint * feat: define Readiness hooks * fix: move cassandra's startup commands to the post-ready hook * feat: add a WithReadyCommand that happens after the container is ready * chore: move rabbitmq post-starts to post-ready * chore: move elasticsearch post-starts to post-ready * chore: simplify using new functional option * chore: remove PreRedies * chore: apply exec options to ready commands * chore: add unit test for ready command * fix: lint * chore: use WithAfterReadyCommand * docs: reword * docs: remove extra spaces * fix: lint * chore: update postreadies in openLDAP module * docs: refine --- docker.go | 90 ++-------- docs/features/common_functional_options.md | 13 ++ docs/features/creating_container.md | 24 ++- lifecycle.go | 186 +++++++++++++++++++- lifecycle_test.go | 191 ++++++++++++++++++--- modules/cassandra/cassandra.go | 5 +- modules/elasticsearch/elasticsearch.go | 5 +- modules/openldap/openldap.go | 7 +- modules/rabbitmq/examples_test.go | 2 +- modules/rabbitmq/rabbitmq_test.go | 46 ++--- options.go | 22 +++ options_test.go | 31 ++++ 12 files changed, 488 insertions(+), 134 deletions(-) diff --git a/docker.go b/docker.go index 9af552c3dd..a559b8d7ea 100644 --- a/docker.go +++ b/docker.go @@ -203,6 +203,13 @@ func (c *DockerContainer) Start(ctx context.Context) error { return err } + c.isRunning = true + + err = c.readiedHook(ctx) + if err != nil { + return err + } + return nil } @@ -1066,86 +1073,13 @@ func (p *DockerProvider) CreateContainer(ctx context.Context, req ContainerReque // default hooks include logger hook and pre-create hook defaultHooks := []ContainerLifecycleHooks{ DefaultLoggingHook(p.Logger), - { - PreCreates: []ContainerRequestHook{ - func(ctx context.Context, req ContainerRequest) error { - return p.preCreateContainerHook(ctx, req, dockerInput, hostConfig, networkingConfig) - }, - }, - PostCreates: []ContainerHook{ - // copy files to container after it's created - func(ctx context.Context, c Container) error { - for _, f := range req.Files { - err := c.CopyFileToContainer(ctx, f.HostFilePath, f.ContainerFilePath, f.FileMode) - if err != nil { - return fmt.Errorf("can't copy %s to container: %w", f.HostFilePath, err) - } - } - - return nil - }, - }, - PostStarts: []ContainerHook{ - // first post-start hook is to produce logs and start log consumers - func(ctx context.Context, c Container) error { - dockerContainer := c.(*DockerContainer) - - logConsumerConfig := req.LogConsumerCfg - if logConsumerConfig == nil { - return nil - } - - for _, consumer := range logConsumerConfig.Consumers { - dockerContainer.followOutput(consumer) - } - - if len(logConsumerConfig.Consumers) > 0 { - return dockerContainer.startLogProduction(ctx, logConsumerConfig.Opts...) - } - return nil - }, - // second post-start hook is to wait for the container to be ready - func(ctx context.Context, c Container) error { - dockerContainer := c.(*DockerContainer) - - // if a Wait Strategy has been specified, wait before returning - if dockerContainer.WaitingFor != nil { - dockerContainer.logger.Printf( - "🚧 Waiting for container id %s image: %s. Waiting for: %+v", - dockerContainer.ID[:12], dockerContainer.Image, dockerContainer.WaitingFor, - ) - if err := dockerContainer.WaitingFor.WaitUntilReady(ctx, c); err != nil { - return err - } - } - - dockerContainer.isRunning = true - - return nil - }, - }, - PreTerminates: []ContainerHook{ - // first pre-terminate hook is to stop the log production - func(ctx context.Context, c Container) error { - logConsumerConfig := req.LogConsumerCfg - - if logConsumerConfig == nil { - return nil - } - if len(logConsumerConfig.Consumers) == 0 { - return nil - } - - dockerContainer := c.(*DockerContainer) - - return dockerContainer.stopLogProduction() - }, - }, - }, + defaultPreCreateHook(ctx, p, req, dockerInput, hostConfig, networkingConfig), + defaultCopyFileToContainerHook(req.Files), + defaultLogConsumersHook(req.LogConsumerCfg), + defaultReadinessHook(), } - // always prepend default lifecycle hooks to user-defined hooks - req.LifecycleHooks = append(defaultHooks, req.LifecycleHooks...) + req.LifecycleHooks = []ContainerLifecycleHooks{combineContainerHooks(defaultHooks, req.LifecycleHooks)} err = req.creatingHook(ctx) if err != nil { diff --git a/docs/features/common_functional_options.md b/docs/features/common_functional_options.md index b60dbd288d..ad617ed814 100644 --- a/docs/features/common_functional_options.md +++ b/docs/features/common_functional_options.md @@ -58,6 +58,19 @@ It also exports an `Executable` interface, defining the following methods: You could use this feature to run a custom script, or to run a command that is not supported by the module right after the container is started. +#### Ready Commands + +- Not available until the next release of testcontainers-go :material-tag: main + +Testcontainers exposes the `WithAfterReadyCommand(e ...Executable)` option to run arbitrary commands in the container right after it's ready, which happens when the defined wait strategies have finished with success. + +!!!info + To better understand how this feature works, please read the [Create containers: Lifecycle Hooks](/features/creating_container/#lifecycle-hooks) documentation. + +It leverages the `Executable` interface to represent the command and positional arguments to be executed in the container. + +You could use this feature to run a custom script, or to run a command that is not supported by the module right after the container is ready. + #### WithNetwork - Since testcontainers-go :material-tag: v0.27.0 diff --git a/docs/features/creating_container.md b/docs/features/creating_container.md index 0bbfa27fbc..decabc2a35 100644 --- a/docs/features/creating_container.md +++ b/docs/features/creating_container.md @@ -91,19 +91,32 @@ func TestIntegrationNginxLatestReturn(t *testing.T) { _Testcontainers for Go_ allows you to define your own lifecycle hooks for better control over your containers. You just need to define functions that return an error and receive the Go context as first argument, and a `ContainerRequest` for the `Creating` hook, and a `Container` for the rest of them as second argument. -You'll be able to pass multiple lifecycle hooks at the `ContainerRequest` as an array of `testcontainers.ContainerLifecycleHooks`, which will be processed one by one in the order they are passed. - -The `testcontainers.ContainerLifecycleHooks` struct defines the following lifecycle hooks, each of them backed by an array of functions representing the hooks: +You'll be able to pass multiple lifecycle hooks at the `ContainerRequest` as an array of `testcontainers.ContainerLifecycleHooks`. The `testcontainers.ContainerLifecycleHooks` struct defines the following lifecycle hooks, each of them backed by an array of functions representing the hooks: * `PreCreates` - hooks that are executed before the container is created * `PostCreates` - hooks that are executed after the container is created * `PreStarts` - hooks that are executed before the container is started * `PostStarts` - hooks that are executed after the container is started +* `PostReadies` - hooks that are executed after the container is ready * `PreStops` - hooks that are executed before the container is stopped * `PostStops` - hooks that are executed after the container is stopped * `PreTerminates` - hooks that are executed before the container is terminated * `PostTerminates` - hooks that are executed after the container is terminated +_Testcontainers for Go_ defines some default lifecycle hooks that are always executed in a specific order with respect to the user-defined hooks. The order of execution is the following: + +1. default `pre` hooks. +2. user-defined `pre` hooks. +3. user-defined `post` hooks. +4. default `post` hooks. + +Inside each group, the hooks will be executed in the order they were defined. + +!!!info + The default hooks are for logging (applied to all hooks), customising the Docker config (applied to the pre-create hook), copying files in to the container (applied to the post-create hook), adding log consumers (applied to the post-start and pre-terminate hooks), and running the wait strategies as a readiness check (applied to the post-start hook). + +It's important to notice that the `Readiness` of a container is defined by the wait strategies defined for the container. **This hook will be executed right after the `PostStarts` hook**. If you want to add your own readiness checks, you can do it by adding a `PostReadies` hook to the container request, which will execute your own readiness check after the default ones. That said, the `PostStarts` hooks don't warrant that the container is ready, so you should not rely on that. + In the following example, we are going to create a container using all the lifecycle hooks, all of them printing a message when any of the lifecycle hooks is called: @@ -112,10 +125,11 @@ In the following example, we are going to create a container using all the lifec #### Default Logging Hook -_Testcontainers for Go_ comes with a default logging hook that will print a log message for each container lifecycle event. You can enable it by passing the `testcontainers.DefaultLoggingHook` option to the `ContainerRequest`, passing a reference to the container logger like this: +_Testcontainers for Go_ comes with a default logging hook that will print a log message for each container lifecycle event, using the default logger. You can add your own logger by passing the `testcontainers.DefaultLoggingHook` option to the `ContainerRequest`, passing a reference to your preferred logger: -[Extending container with life cycle hooks](../../lifecycle_test.go) inside_block:reqWithDefaultLogginHook +[Use a custom logger for container hooks](../../lifecycle_test.go) inside_block:reqWithDefaultLogginHook +[Custom Logger implementation](../../lifecycle_test.go) inside_block:customLoggerImplementation ### Advanced Settings diff --git a/lifecycle.go b/lifecycle.go index 7d4e4af78d..fc1b28e17e 100644 --- a/lifecycle.go +++ b/lifecycle.go @@ -2,6 +2,7 @@ package testcontainers import ( "context" + "fmt" "io" "strings" @@ -24,6 +25,7 @@ type ContainerRequestHook func(ctx context.Context, req ContainerRequest) error // - Created // - Starting // - Started +// - Readied // - Stopping // - Stopped // - Terminating @@ -39,12 +41,14 @@ type ContainerLifecycleHooks struct { PostCreates []ContainerHook PreStarts []ContainerHook PostStarts []ContainerHook + PostReadies []ContainerHook PreStops []ContainerHook PostStops []ContainerHook PreTerminates []ContainerHook PostTerminates []ContainerHook } +// DefaultLoggingHook is a hook that will log the container lifecycle events var DefaultLoggingHook = func(logger Logging) ContainerLifecycleHooks { shortContainerID := func(c Container) string { return c.GetContainerID()[:12] @@ -75,6 +79,12 @@ var DefaultLoggingHook = func(logger Logging) ContainerLifecycleHooks { return nil }, }, + PostReadies: []ContainerHook{ + func(ctx context.Context, c Container) error { + logger.Printf("🔔 Container is ready: %s", shortContainerID(c)) + return nil + }, + }, PreStops: []ContainerHook{ func(ctx context.Context, c Container) error { logger.Printf("🐳 Stopping container: %s", shortContainerID(c)) @@ -83,7 +93,7 @@ var DefaultLoggingHook = func(logger Logging) ContainerLifecycleHooks { }, PostStops: []ContainerHook{ func(ctx context.Context, c Container) error { - logger.Printf("✋ Container stopped: %s", shortContainerID(c)) + logger.Printf("✅ Container stopped: %s", shortContainerID(c)) return nil }, }, @@ -102,6 +112,101 @@ var DefaultLoggingHook = func(logger Logging) ContainerLifecycleHooks { } } +// defaultPreCreateHook is a hook that will apply the default configuration to the container +var defaultPreCreateHook = func(ctx context.Context, p *DockerProvider, req ContainerRequest, dockerInput *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig) ContainerLifecycleHooks { + return ContainerLifecycleHooks{ + PreCreates: []ContainerRequestHook{ + func(ctx context.Context, req ContainerRequest) error { + return p.preCreateContainerHook(ctx, req, dockerInput, hostConfig, networkingConfig) + }, + }, + } +} + +// defaultCopyFileToContainerHook is a hook that will copy files to the container after it's created +// but before it's started +var defaultCopyFileToContainerHook = func(files []ContainerFile) ContainerLifecycleHooks { + return ContainerLifecycleHooks{ + PostCreates: []ContainerHook{ + // copy files to container after it's created + func(ctx context.Context, c Container) error { + for _, f := range files { + err := c.CopyFileToContainer(ctx, f.HostFilePath, f.ContainerFilePath, f.FileMode) + if err != nil { + return fmt.Errorf("can't copy %s to container: %w", f.HostFilePath, err) + } + } + + return nil + }, + }, + } +} + +// defaultLogConsumersHook is a hook that will start log consumers after the container is started +var defaultLogConsumersHook = func(cfg *LogConsumerConfig) ContainerLifecycleHooks { + return ContainerLifecycleHooks{ + PostStarts: []ContainerHook{ + // first post-start hook is to produce logs and start log consumers + func(ctx context.Context, c Container) error { + dockerContainer := c.(*DockerContainer) + + if cfg == nil { + return nil + } + + for _, consumer := range cfg.Consumers { + dockerContainer.followOutput(consumer) + } + + if len(cfg.Consumers) > 0 { + return dockerContainer.startLogProduction(ctx, cfg.Opts...) + } + return nil + }, + }, + PreTerminates: []ContainerHook{ + // first pre-terminate hook is to stop the log production + func(ctx context.Context, c Container) error { + if cfg == nil || len(cfg.Consumers) == 0 { + return nil + } + + dockerContainer := c.(*DockerContainer) + + return dockerContainer.stopLogProduction() + }, + }, + } +} + +// defaultReadinessHook is a hook that will wait for the container to be ready +var defaultReadinessHook = func() ContainerLifecycleHooks { + return ContainerLifecycleHooks{ + PostStarts: []ContainerHook{ + // wait for the container to be ready + func(ctx context.Context, c Container) error { + dockerContainer := c.(*DockerContainer) + + // if a Wait Strategy has been specified, wait before returning + if dockerContainer.WaitingFor != nil { + dockerContainer.logger.Printf( + "🚧 Waiting for container id %s image: %s. Waiting for: %+v", + dockerContainer.ID[:12], dockerContainer.Image, dockerContainer.WaitingFor, + ) + if err := dockerContainer.WaitingFor.WaitUntilReady(ctx, c); err != nil { + return err + } + } + + dockerContainer.isRunning = true + + return nil + }, + }, + } +} + // creatingHook is a hook that will be called before a container is created. func (req ContainerRequest) creatingHook(ctx context.Context) error { for _, lifecycleHooks := range req.LifecycleHooks { @@ -152,6 +257,19 @@ func (c *DockerContainer) startedHook(ctx context.Context) error { return nil } +// readiedHook is a hook that will be called after a container is ready +func (c *DockerContainer) readiedHook(ctx context.Context) error { + for _, lifecycleHooks := range c.lifecycleHooks { + err := containerHookFn(ctx, lifecycleHooks.PostReadies)(c) + if err != nil { + c.printLogs(ctx, err) + return err + } + } + + return nil +} + // printLogs is a helper function that will print the logs of a Docker container // We are going to use this helper function to inform the user of the logs when an error occurs func (c *DockerContainer) printLogs(ctx context.Context, cause error) { @@ -260,6 +378,11 @@ func (c ContainerLifecycleHooks) Started(ctx context.Context) func(container Con return containerHookFn(ctx, c.PostStarts) } +// Readied is a hook that will be called after a container is ready +func (c ContainerLifecycleHooks) Readied(ctx context.Context) func(container Container) error { + return containerHookFn(ctx, c.PostReadies) +} + // Stopping is a hook that will be called before a container is stopped func (c ContainerLifecycleHooks) Stopping(ctx context.Context) func(container Container) error { return containerHookFn(ctx, c.PreStops) @@ -352,6 +475,67 @@ func (p *DockerProvider) preCreateContainerHook(ctx context.Context, req Contain return nil } +// combineContainerHooks it returns just one ContainerLifecycle hook, as the result of combining +// the default hooks with the user-defined hooks. The function will loop over all the default hooks, +// storing each of the hooks in a slice, and then it will loop over all the user-defined hooks, +// appending or prepending them to the slice of hooks. The order of hooks is the following: +// - for Pre-hooks, always run the default hooks first, then append the user-defined hooks +// - for Post-hooks, always run the user-defined hooks first, then the default hooks +func combineContainerHooks(defaultHooks, userDefinedHooks []ContainerLifecycleHooks) ContainerLifecycleHooks { + preCreates := []ContainerRequestHook{} + postCreates := []ContainerHook{} + preStarts := []ContainerHook{} + postStarts := []ContainerHook{} + postReadies := []ContainerHook{} + preStops := []ContainerHook{} + postStops := []ContainerHook{} + preTerminates := []ContainerHook{} + postTerminates := []ContainerHook{} + + for _, defaultHook := range defaultHooks { + preCreates = append(preCreates, defaultHook.PreCreates...) + preStarts = append(preStarts, defaultHook.PreStarts...) + preStops = append(preStops, defaultHook.PreStops...) + preTerminates = append(preTerminates, defaultHook.PreTerminates...) + } + + // append the user-defined hooks after the default pre-hooks + // and because the post hooks are still empty, the user-defined post-hooks + // will be the first ones to be executed + for _, userDefinedHook := range userDefinedHooks { + preCreates = append(preCreates, userDefinedHook.PreCreates...) + postCreates = append(postCreates, userDefinedHook.PostCreates...) + preStarts = append(preStarts, userDefinedHook.PreStarts...) + postStarts = append(postStarts, userDefinedHook.PostStarts...) + postReadies = append(postReadies, userDefinedHook.PostReadies...) + preStops = append(preStops, userDefinedHook.PreStops...) + postStops = append(postStops, userDefinedHook.PostStops...) + preTerminates = append(preTerminates, userDefinedHook.PreTerminates...) + postTerminates = append(postTerminates, userDefinedHook.PostTerminates...) + } + + // finally, append the default post-hooks + for _, defaultHook := range defaultHooks { + postCreates = append(postCreates, defaultHook.PostCreates...) + postStarts = append(postStarts, defaultHook.PostStarts...) + postReadies = append(postReadies, defaultHook.PostReadies...) + postStops = append(postStops, defaultHook.PostStops...) + postTerminates = append(postTerminates, defaultHook.PostTerminates...) + } + + return ContainerLifecycleHooks{ + PreCreates: preCreates, + PostCreates: postCreates, + PreStarts: preStarts, + PostStarts: postStarts, + PostReadies: postReadies, + PreStops: preStops, + PostStops: postStops, + PreTerminates: preTerminates, + PostTerminates: postTerminates, + } +} + func mergePortBindings(configPortMap, exposedPortMap nat.PortMap, exposedPorts []string) nat.PortMap { if exposedPortMap == nil { exposedPortMap = make(map[nat.Port][]nat.PortBinding) diff --git a/lifecycle_test.go b/lifecycle_test.go index ac8d8e1ee3..6316df739e 100644 --- a/lifecycle_test.go +++ b/lifecycle_test.go @@ -489,6 +489,16 @@ func TestLifecycleHooks(t *testing.T) { return nil }, }, + PostReadies: []ContainerHook{ + func(ctx context.Context, c Container) error { + prints = append(prints, fmt.Sprintf("post-ready hook 1: %#v", c)) + return nil + }, + func(ctx context.Context, c Container) error { + prints = append(prints, fmt.Sprintf("post-ready hook 2: %#v", c)) + return nil + }, + }, PreStops: []ContainerHook{ func(ctx context.Context, c Container) error { prints = append(prints, fmt.Sprintf("pre-stop hook 1: %#v", c)) @@ -556,11 +566,12 @@ func TestLifecycleHooks(t *testing.T) { err = c.Terminate(ctx) require.NoError(t, err) - lifecycleHooksIsHonouredFn(t, ctx, c, prints) + lifecycleHooksIsHonouredFn(t, ctx, prints) }) } } +// customLoggerImplementation { type inMemoryLogger struct { data []string } @@ -569,6 +580,8 @@ func (l *inMemoryLogger) Printf(format string, args ...interface{}) { l.data = append(l.data, fmt.Sprintf(format, args...)) } +// } + func TestLifecycleHooks_WithDefaultLogger(t *testing.T) { ctx := context.Background() @@ -600,7 +613,140 @@ func TestLifecycleHooks_WithDefaultLogger(t *testing.T) { err = c.Terminate(ctx) require.NoError(t, err) - require.Len(t, dl.data, 10) + require.Len(t, dl.data, 12) +} + +func TestCombineLifecycleHooks(t *testing.T) { + prints := []string{} + + preCreateFunc := func(prefix string, hook string, lifecycleID int, hookID int) func(ctx context.Context, req ContainerRequest) error { + return func(ctx context.Context, _ ContainerRequest) error { + prints = append(prints, fmt.Sprintf("[%s] pre-%s hook %d.%d", prefix, hook, lifecycleID, hookID)) + return nil + } + } + hookFunc := func(prefix string, hookType string, hook string, lifecycleID int, hookID int) func(ctx context.Context, c Container) error { + return func(ctx context.Context, _ Container) error { + prints = append(prints, fmt.Sprintf("[%s] %s-%s hook %d.%d", prefix, hookType, hook, lifecycleID, hookID)) + return nil + } + } + preFunc := func(prefix string, hook string, lifecycleID int, hookID int) func(ctx context.Context, c Container) error { + return hookFunc(prefix, "pre", hook, lifecycleID, hookID) + } + postFunc := func(prefix string, hook string, lifecycleID int, hookID int) func(ctx context.Context, c Container) error { + return hookFunc(prefix, "post", hook, lifecycleID, hookID) + } + + lifecycleHookFunc := func(prefix string, lifecycleID int) ContainerLifecycleHooks { + return ContainerLifecycleHooks{ + PreCreates: []ContainerRequestHook{preCreateFunc(prefix, "create", lifecycleID, 1), preCreateFunc(prefix, "create", lifecycleID, 2)}, + PostCreates: []ContainerHook{postFunc(prefix, "create", lifecycleID, 1), postFunc(prefix, "create", lifecycleID, 2)}, + PreStarts: []ContainerHook{preFunc(prefix, "start", lifecycleID, 1), preFunc(prefix, "start", lifecycleID, 2)}, + PostStarts: []ContainerHook{postFunc(prefix, "start", lifecycleID, 1), postFunc(prefix, "start", lifecycleID, 2)}, + PostReadies: []ContainerHook{postFunc(prefix, "ready", lifecycleID, 1), postFunc(prefix, "ready", lifecycleID, 2)}, + PreStops: []ContainerHook{preFunc(prefix, "stop", lifecycleID, 1), preFunc(prefix, "stop", lifecycleID, 2)}, + PostStops: []ContainerHook{postFunc(prefix, "stop", lifecycleID, 1), postFunc(prefix, "stop", lifecycleID, 2)}, + PreTerminates: []ContainerHook{preFunc(prefix, "terminate", lifecycleID, 1), preFunc(prefix, "terminate", lifecycleID, 2)}, + PostTerminates: []ContainerHook{postFunc(prefix, "terminate", lifecycleID, 1), postFunc(prefix, "terminate", lifecycleID, 2)}, + } + } + + defaultHooks := []ContainerLifecycleHooks{lifecycleHookFunc("default", 1), lifecycleHookFunc("default", 2)} + userDefinedHooks := []ContainerLifecycleHooks{lifecycleHookFunc("user-defined", 1), lifecycleHookFunc("user-defined", 2), lifecycleHookFunc("user-defined", 3)} + + hooks := combineContainerHooks(defaultHooks, userDefinedHooks) + + // call all the hooks in the right order, honouring the lifecycle + + req := ContainerRequest{} + err := hooks.Creating(context.Background())(req) + require.NoError(t, err) + + c := &DockerContainer{} + + err = hooks.Created(context.Background())(c) + require.NoError(t, err) + err = hooks.Starting(context.Background())(c) + require.NoError(t, err) + err = hooks.Started(context.Background())(c) + require.NoError(t, err) + err = hooks.Readied(context.Background())(c) + require.NoError(t, err) + err = hooks.Stopping(context.Background())(c) + require.NoError(t, err) + err = hooks.Stopped(context.Background())(c) + require.NoError(t, err) + err = hooks.Terminating(context.Background())(c) + require.NoError(t, err) + err = hooks.Terminated(context.Background())(c) + require.NoError(t, err) + + // assertions + + // There are 2 default container lifecycle hooks and 3 user-defined container lifecycle hooks. + // Each lifecycle hook has 2 pre-create hooks and 2 post-create hooks. + // That results in 16 hooks per lifecycle (8 defaults + 12 user-defined = 20) + + // There are 5 lifecycles (create, start, ready, stop, terminate), + // but ready has only half of the hooks (it only has post), so we have 90 hooks in total. + assert.Len(t, prints, 90) + + // The order of the hooks is: + // - pre-X hooks: first default (2*2), then user-defined (3*2) + // - post-X hooks: first user-defined (3*2), then default (2*2) + + for i := 0; i < 5; i++ { + var hookType string + // this is the particular order of execution for the hooks + switch i { + case 0: + hookType = "create" + case 1: + hookType = "start" + case 2: + hookType = "ready" + case 3: + hookType = "stop" + case 4: + hookType = "terminate" + } + + initialIndex := i * 20 + if i >= 2 { + initialIndex -= 10 + } + + if hookType != "ready" { + // default pre-hooks: 4 hooks + assert.Equal(t, fmt.Sprintf("[default] pre-%s hook 1.1", hookType), prints[initialIndex]) + assert.Equal(t, fmt.Sprintf("[default] pre-%s hook 1.2", hookType), prints[initialIndex+1]) + assert.Equal(t, fmt.Sprintf("[default] pre-%s hook 2.1", hookType), prints[initialIndex+2]) + assert.Equal(t, fmt.Sprintf("[default] pre-%s hook 2.2", hookType), prints[initialIndex+3]) + + // user-defined pre-hooks: 6 hooks + assert.Equal(t, fmt.Sprintf("[user-defined] pre-%s hook 1.1", hookType), prints[initialIndex+4]) + assert.Equal(t, fmt.Sprintf("[user-defined] pre-%s hook 1.2", hookType), prints[initialIndex+5]) + assert.Equal(t, fmt.Sprintf("[user-defined] pre-%s hook 2.1", hookType), prints[initialIndex+6]) + assert.Equal(t, fmt.Sprintf("[user-defined] pre-%s hook 2.2", hookType), prints[initialIndex+7]) + assert.Equal(t, fmt.Sprintf("[user-defined] pre-%s hook 3.1", hookType), prints[initialIndex+8]) + assert.Equal(t, fmt.Sprintf("[user-defined] pre-%s hook 3.2", hookType), prints[initialIndex+9]) + } + + // user-defined post-hooks: 6 hooks + assert.Equal(t, fmt.Sprintf("[user-defined] post-%s hook 1.1", hookType), prints[initialIndex+10]) + assert.Equal(t, fmt.Sprintf("[user-defined] post-%s hook 1.2", hookType), prints[initialIndex+11]) + assert.Equal(t, fmt.Sprintf("[user-defined] post-%s hook 2.1", hookType), prints[initialIndex+12]) + assert.Equal(t, fmt.Sprintf("[user-defined] post-%s hook 2.2", hookType), prints[initialIndex+13]) + assert.Equal(t, fmt.Sprintf("[user-defined] post-%s hook 3.1", hookType), prints[initialIndex+14]) + assert.Equal(t, fmt.Sprintf("[user-defined] post-%s hook 3.2", hookType), prints[initialIndex+15]) + + // default post-hooks: 4 hooks + assert.Equal(t, fmt.Sprintf("[default] post-%s hook 1.1", hookType), prints[initialIndex+16]) + assert.Equal(t, fmt.Sprintf("[default] post-%s hook 1.2", hookType), prints[initialIndex+17]) + assert.Equal(t, fmt.Sprintf("[default] post-%s hook 2.1", hookType), prints[initialIndex+18]) + assert.Equal(t, fmt.Sprintf("[default] post-%s hook 2.2", hookType), prints[initialIndex+19]) + } } func TestLifecycleHooks_WithMultipleHooks(t *testing.T) { @@ -633,7 +779,7 @@ func TestLifecycleHooks_WithMultipleHooks(t *testing.T) { err = c.Terminate(ctx) require.NoError(t, err) - require.Len(t, dl.data, 20) + require.Len(t, dl.data, 24) } type linesTestLogger struct { @@ -646,11 +792,6 @@ func (l *linesTestLogger) Printf(format string, args ...interface{}) { func TestPrintContainerLogsOnError(t *testing.T) { ctx := context.Background() - client, err := NewDockerClientWithOpts(ctx) - if err != nil { - t.Fatal(err) - } - defer client.Close() req := ContainerRequest{ Image: "docker.io/alpine", @@ -705,8 +846,8 @@ func TestPrintContainerLogsOnError(t *testing.T) { } } -func lifecycleHooksIsHonouredFn(t *testing.T, ctx context.Context, container Container, prints []string) { - require.Len(t, prints, 20) +func lifecycleHooksIsHonouredFn(t *testing.T, ctx context.Context, prints []string) { + require.Len(t, prints, 24) assert.True(t, strings.HasPrefix(prints[0], "pre-create hook 1: ")) assert.True(t, strings.HasPrefix(prints[1], "pre-create hook 2: ")) @@ -720,21 +861,27 @@ func lifecycleHooksIsHonouredFn(t *testing.T, ctx context.Context, container Con assert.True(t, strings.HasPrefix(prints[6], "post-start hook 1: ")) assert.True(t, strings.HasPrefix(prints[7], "post-start hook 2: ")) - assert.True(t, strings.HasPrefix(prints[8], "pre-stop hook 1: ")) - assert.True(t, strings.HasPrefix(prints[9], "pre-stop hook 2: ")) + assert.True(t, strings.HasPrefix(prints[8], "post-ready hook 1: ")) + assert.True(t, strings.HasPrefix(prints[9], "post-ready hook 2: ")) + + assert.True(t, strings.HasPrefix(prints[10], "pre-stop hook 1: ")) + assert.True(t, strings.HasPrefix(prints[11], "pre-stop hook 2: ")) + + assert.True(t, strings.HasPrefix(prints[12], "post-stop hook 1: ")) + assert.True(t, strings.HasPrefix(prints[13], "post-stop hook 2: ")) - assert.True(t, strings.HasPrefix(prints[10], "post-stop hook 1: ")) - assert.True(t, strings.HasPrefix(prints[11], "post-stop hook 2: ")) + assert.True(t, strings.HasPrefix(prints[14], "pre-start hook 1: ")) + assert.True(t, strings.HasPrefix(prints[15], "pre-start hook 2: ")) - assert.True(t, strings.HasPrefix(prints[12], "pre-start hook 1: ")) - assert.True(t, strings.HasPrefix(prints[13], "pre-start hook 2: ")) + assert.True(t, strings.HasPrefix(prints[16], "post-start hook 1: ")) + assert.True(t, strings.HasPrefix(prints[17], "post-start hook 2: ")) - assert.True(t, strings.HasPrefix(prints[14], "post-start hook 1: ")) - assert.True(t, strings.HasPrefix(prints[15], "post-start hook 2: ")) + assert.True(t, strings.HasPrefix(prints[18], "post-ready hook 1: ")) + assert.True(t, strings.HasPrefix(prints[19], "post-ready hook 2: ")) - assert.True(t, strings.HasPrefix(prints[16], "pre-terminate hook 1: ")) - assert.True(t, strings.HasPrefix(prints[17], "pre-terminate hook 2: ")) + assert.True(t, strings.HasPrefix(prints[20], "pre-terminate hook 1: ")) + assert.True(t, strings.HasPrefix(prints[21], "pre-terminate hook 2: ")) - assert.True(t, strings.HasPrefix(prints[18], "post-terminate hook 1: ")) - assert.True(t, strings.HasPrefix(prints[19], "post-terminate hook 2: ")) + assert.True(t, strings.HasPrefix(prints[22], "post-terminate hook 1: ")) + assert.True(t, strings.HasPrefix(prints[23], "post-terminate hook 2: ")) } diff --git a/modules/cassandra/cassandra.go b/modules/cassandra/cassandra.go index 8956927ae5..c37c10d90d 100644 --- a/modules/cassandra/cassandra.go +++ b/modules/cassandra/cassandra.go @@ -55,6 +55,7 @@ func WithConfigFile(configFile string) testcontainers.CustomizeRequestOption { func WithInitScripts(scripts ...string) testcontainers.CustomizeRequestOption { return func(req *testcontainers.GenericContainerRequest) { var initScripts []testcontainers.ContainerFile + var execs []testcontainers.Executable for _, script := range scripts { cf := testcontainers.ContainerFile{ HostFilePath: script, @@ -63,9 +64,11 @@ func WithInitScripts(scripts ...string) testcontainers.CustomizeRequestOption { } initScripts = append(initScripts, cf) - testcontainers.WithStartupCommand(initScript{File: cf.ContainerFilePath})(req) + execs = append(execs, initScript{File: cf.ContainerFilePath}) } + req.Files = append(req.Files, initScripts...) + testcontainers.WithAfterReadyCommand(execs...)(req) } } diff --git a/modules/elasticsearch/elasticsearch.go b/modules/elasticsearch/elasticsearch.go index 9dfd95904b..79a364fd01 100644 --- a/modules/elasticsearch/elasticsearch.go +++ b/modules/elasticsearch/elasticsearch.go @@ -52,6 +52,7 @@ func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomize { // the container needs a post create hook to set the default JVM options in a file PostCreates: []testcontainers.ContainerHook{}, + PostReadies: []testcontainers.ContainerHook{}, }, }, }, @@ -126,9 +127,9 @@ func configureAddress(ctx context.Context, c *ElasticsearchContainer) (string, e // The certificate is only available since version 8, and will be located in a well-known location. func configureCertificate(settings *Options, req *testcontainers.GenericContainerRequest) error { if isAtLeastVersion(req.Image, 8) { - // The container needs a post start hook to copy the certificate from the container to the host. + // The container needs a post ready hook to copy the certificate from the container to the host. // This certificate is only available since version 8 - req.LifecycleHooks[0].PostStarts = append(req.LifecycleHooks[0].PostStarts, + req.LifecycleHooks[0].PostReadies = append(req.LifecycleHooks[0].PostReadies, func(ctx context.Context, container testcontainers.Container) error { const defaultCaCertPath = "/usr/share/elasticsearch/config/certs/http_ca.crt" diff --git a/modules/openldap/openldap.go b/modules/openldap/openldap.go index 03d8b4e379..e29658c639 100644 --- a/modules/openldap/openldap.go +++ b/modules/openldap/openldap.go @@ -94,7 +94,7 @@ func WithInitialLdif(ldif string) testcontainers.CustomizeRequestOption { }) req.LifecycleHooks = append(req.LifecycleHooks, testcontainers.ContainerLifecycleHooks{ - PostStarts: []testcontainers.ContainerHook{ + PostReadies: []testcontainers.ContainerHook{ func(ctx context.Context, container testcontainers.Container) error { username := req.Env["LDAP_ADMIN_USERNAME"] rootDn := req.Env["LDAP_ROOT"] @@ -128,6 +128,11 @@ func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomize wait.ForLog("** Starting slapd **"), wait.ForListeningPort("1389/tcp"), ), + LifecycleHooks: []testcontainers.ContainerLifecycleHooks{ + { + PostReadies: []testcontainers.ContainerHook{}, + }, + }, } genericContainerReq := testcontainers.GenericContainerRequest{ diff --git a/modules/rabbitmq/examples_test.go b/modules/rabbitmq/examples_test.go index f24bae0169..a6fc829424 100644 --- a/modules/rabbitmq/examples_test.go +++ b/modules/rabbitmq/examples_test.go @@ -131,7 +131,7 @@ func ExampleRunContainer_withPlugins() { testcontainers.WithImage("rabbitmq:3.7.25-management-alpine"), // Multiple test implementations of the Executable interface, specific to RabbitMQ, exist in the types_test.go file. // Please refer to them for more examples. - testcontainers.WithStartupCommand( + testcontainers.WithAfterReadyCommand( testcontainers.NewRawCommand([]string{"rabbitmq_shovel"}), testcontainers.NewRawCommand([]string{"rabbitmq_random_exchange"}), ), diff --git a/modules/rabbitmq/rabbitmq_test.go b/modules/rabbitmq/rabbitmq_test.go index 6636da3061..0c85c66607 100644 --- a/modules/rabbitmq/rabbitmq_test.go +++ b/modules/rabbitmq/rabbitmq_test.go @@ -48,17 +48,17 @@ func TestRunContainer_withAllSettings(t *testing.T) { rabbitmqContainer, err := rabbitmq.RunContainer(ctx, testcontainers.WithImage("rabbitmq:3.12.11-management-alpine"), // addVirtualHosts { - testcontainers.WithStartupCommand(VirtualHost{Name: "vhost1"}), - testcontainers.WithStartupCommand(VirtualHostLimit{VHost: "vhost1", Name: "max-connections", Value: 1}), - testcontainers.WithStartupCommand(VirtualHost{Name: "vhost2", Tracing: true}), + testcontainers.WithAfterReadyCommand(VirtualHost{Name: "vhost1"}), + testcontainers.WithAfterReadyCommand(VirtualHostLimit{VHost: "vhost1", Name: "max-connections", Value: 1}), + testcontainers.WithAfterReadyCommand(VirtualHost{Name: "vhost2", Tracing: true}), // } // addExchanges { - testcontainers.WithStartupCommand(Exchange{Name: "direct-exchange", Type: "direct"}), - testcontainers.WithStartupCommand(Exchange{ + testcontainers.WithAfterReadyCommand(Exchange{Name: "direct-exchange", Type: "direct"}), + testcontainers.WithAfterReadyCommand(Exchange{ Name: "topic-exchange", Type: "topic", }), - testcontainers.WithStartupCommand(Exchange{ + testcontainers.WithAfterReadyCommand(Exchange{ VHost: "vhost1", Name: "topic-exchange-2", Type: "topic", @@ -67,12 +67,12 @@ func TestRunContainer_withAllSettings(t *testing.T) { Durable: true, Args: map[string]interface{}{}, }), - testcontainers.WithStartupCommand(Exchange{ + testcontainers.WithAfterReadyCommand(Exchange{ VHost: "vhost2", Name: "topic-exchange-3", Type: "topic", }), - testcontainers.WithStartupCommand(Exchange{ + testcontainers.WithAfterReadyCommand(Exchange{ Name: "topic-exchange-4", Type: "topic", AutoDelete: false, @@ -82,26 +82,26 @@ func TestRunContainer_withAllSettings(t *testing.T) { }), // } // addQueues { - testcontainers.WithStartupCommand(Queue{Name: "queue1"}), - testcontainers.WithStartupCommand(Queue{ + testcontainers.WithAfterReadyCommand(Queue{Name: "queue1"}), + testcontainers.WithAfterReadyCommand(Queue{ Name: "queue2", AutoDelete: true, Durable: false, Args: map[string]interface{}{"x-message-ttl": 1000}, }), - testcontainers.WithStartupCommand(Queue{ + testcontainers.WithAfterReadyCommand(Queue{ VHost: "vhost1", Name: "queue3", AutoDelete: true, Durable: false, Args: map[string]interface{}{"x-message-ttl": 1000}, }), - testcontainers.WithStartupCommand(Queue{VHost: "vhost2", Name: "queue4"}), + testcontainers.WithAfterReadyCommand(Queue{VHost: "vhost2", Name: "queue4"}), // } // addBindings { - testcontainers.WithStartupCommand(NewBinding("direct-exchange", "queue1")), - testcontainers.WithStartupCommand(NewBindingWithVHost("vhost1", "topic-exchange-2", "queue3")), - testcontainers.WithStartupCommand(Binding{ + testcontainers.WithAfterReadyCommand(NewBinding("direct-exchange", "queue1")), + testcontainers.WithAfterReadyCommand(NewBindingWithVHost("vhost1", "topic-exchange-2", "queue3")), + testcontainers.WithAfterReadyCommand(Binding{ VHost: "vhost2", Source: "topic-exchange-3", Destination: "queue4", @@ -111,33 +111,33 @@ func TestRunContainer_withAllSettings(t *testing.T) { }), // } // addUsers { - testcontainers.WithStartupCommand(User{ + testcontainers.WithAfterReadyCommand(User{ Name: "user1", Password: "password1", }), - testcontainers.WithStartupCommand(User{ + testcontainers.WithAfterReadyCommand(User{ Name: "user2", Password: "password2", Tags: []string{"administrator"}, }), // } // addPermissions { - testcontainers.WithStartupCommand(NewPermission("vhost1", "user1", ".*", ".*", ".*")), + testcontainers.WithAfterReadyCommand(NewPermission("vhost1", "user1", ".*", ".*", ".*")), // } // addPolicies { - testcontainers.WithStartupCommand(Policy{ + testcontainers.WithAfterReadyCommand(Policy{ Name: "max length policy", Pattern: "^dog", Definition: map[string]interface{}{"max-length": 1}, Priority: 1, ApplyTo: "queues", }), - testcontainers.WithStartupCommand(Policy{ + testcontainers.WithAfterReadyCommand(Policy{ Name: "alternate exchange policy", Pattern: "^direct-exchange", Definition: map[string]interface{}{"alternate-exchange": "amq.direct"}, }), - testcontainers.WithStartupCommand(Policy{ + testcontainers.WithAfterReadyCommand(Policy{ VHost: "vhost2", Name: "ha-all", Pattern: ".*", @@ -146,7 +146,7 @@ func TestRunContainer_withAllSettings(t *testing.T) { "ha-sync-mode": "automatic", }, }), - testcontainers.WithStartupCommand(OperatorPolicy{ + testcontainers.WithAfterReadyCommand(OperatorPolicy{ Name: "operator policy 1", Pattern: "^queue1", Definition: map[string]interface{}{"message-ttl": 1000}, @@ -155,7 +155,7 @@ func TestRunContainer_withAllSettings(t *testing.T) { }), // } // enablePlugins { - testcontainers.WithStartupCommand(Plugin{Name: "rabbitmq_shovel"}, Plugin{Name: "rabbitmq_random_exchange"}), + testcontainers.WithAfterReadyCommand(Plugin{Name: "rabbitmq_shovel"}, Plugin{Name: "rabbitmq_random_exchange"}), // } ) if err != nil { diff --git a/options.go b/options.go index 40bf671bcc..13711e8b56 100644 --- a/options.go +++ b/options.go @@ -201,6 +201,28 @@ func WithStartupCommand(execs ...Executable) CustomizeRequestOption { } } +// WithAfterReadyCommand will execute the command representation of each Executable into the container. +// It will leverage the container lifecycle hooks to call the command right after the container +// is ready. +func WithAfterReadyCommand(execs ...Executable) CustomizeRequestOption { + return func(req *GenericContainerRequest) { + postReadiesHook := []ContainerHook{} + + for _, exec := range execs { + execFn := func(ctx context.Context, c Container) error { + _, _, err := c.Exec(ctx, exec.AsCommand(), exec.Options()...) + return err + } + + postReadiesHook = append(postReadiesHook, execFn) + } + + req.LifecycleHooks = append(req.LifecycleHooks, ContainerLifecycleHooks{ + PostReadies: postReadiesHook, + }) + } +} + // WithWaitStrategy sets the wait strategy for a container, using 60 seconds as deadline func WithWaitStrategy(strategies ...wait.Strategy) CustomizeRequestOption { return WithWaitStrategyAndDeadline(60*time.Second, strategies...) diff --git a/options_test.go b/options_test.go index f402d42b7c..e13642ac09 100644 --- a/options_test.go +++ b/options_test.go @@ -131,3 +131,34 @@ func TestWithStartupCommand(t *testing.T) { require.NoError(t, err) assert.Equal(t, "/tmp/.testcontainers\n", string(content)) } + +func TestWithAfterReadyCommand(t *testing.T) { + req := testcontainers.GenericContainerRequest{ + ContainerRequest: testcontainers.ContainerRequest{ + Image: "alpine", + Entrypoint: []string{"tail", "-f", "/dev/null"}, + }, + Started: true, + } + + testExec := testcontainers.NewRawCommand([]string{"touch", "/tmp/.testcontainers"}) + + testcontainers.WithAfterReadyCommand(testExec)(&req) + + assert.Len(t, req.LifecycleHooks, 1) + assert.Len(t, req.LifecycleHooks[0].PostReadies, 1) + + c, err := testcontainers.GenericContainer(context.Background(), req) + require.NoError(t, err) + defer func() { + err = c.Terminate(context.Background()) + require.NoError(t, err) + }() + + _, reader, err := c.Exec(context.Background(), []string{"ls", "/tmp/.testcontainers"}, exec.Multiplexed()) + require.NoError(t, err) + + content, err := io.ReadAll(reader) + require.NoError(t, err) + assert.Equal(t, "/tmp/.testcontainers\n", string(content)) +} From 357cff81c2e44ce1c27112244dce4d40229be347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Thu, 15 Feb 2024 11:54:11 +0100 Subject: [PATCH 05/10] chore: use new version (v0.28.0) in modules and examples --- docs/features/common_functional_options.md | 4 ++-- docs/modules/cockroachdb.md | 2 +- docs/modules/consul.md | 2 +- docs/modules/inbucket.md | 2 +- docs/modules/minio.md | 2 +- docs/modules/mockserver.md | 2 +- docs/modules/openldap.md | 2 +- examples/nginx/go.mod | 2 +- examples/toxiproxy/go.mod | 2 +- mkdocs.yml | 2 +- modules/artemis/go.mod | 2 +- modules/cassandra/go.mod | 2 +- modules/clickhouse/go.mod | 2 +- modules/cockroachdb/go.mod | 2 +- modules/compose/go.mod | 2 +- modules/consul/go.mod | 2 +- modules/couchbase/go.mod | 2 +- modules/elasticsearch/go.mod | 2 +- modules/gcloud/go.mod | 2 +- modules/inbucket/go.mod | 2 +- modules/k3s/go.mod | 2 +- modules/k6/go.mod | 2 +- modules/kafka/go.mod | 2 +- modules/localstack/go.mod | 2 +- modules/mariadb/go.mod | 2 +- modules/minio/go.mod | 2 +- modules/mockserver/go.mod | 2 +- modules/mongodb/go.mod | 2 +- modules/mssql/go.mod | 2 +- modules/mysql/go.mod | 2 +- modules/nats/go.mod | 2 +- modules/neo4j/go.mod | 2 +- modules/openldap/go.mod | 2 +- modules/postgres/go.mod | 2 +- modules/pulsar/go.mod | 2 +- modules/rabbitmq/go.mod | 2 +- modules/redis/go.mod | 2 +- modules/redpanda/go.mod | 2 +- modules/vault/go.mod | 2 +- sonar-project.properties | 2 +- 40 files changed, 41 insertions(+), 41 deletions(-) diff --git a/docs/features/common_functional_options.md b/docs/features/common_functional_options.md index ad617ed814..e9f35bcaff 100644 --- a/docs/features/common_functional_options.md +++ b/docs/features/common_functional_options.md @@ -17,7 +17,7 @@ Using the `WithImageSubstitutors` options, you could define your own substitutio #### WithLogConsumers -- Not available until the next release of testcontainers-go :material-tag: main +- Since testcontainers-go :material-tag: v0.28.0 If you need to consume the logs of the container, you can use `testcontainers.WithLogConsumers` with a valid log consumer. An example of a log consumer is the following: @@ -60,7 +60,7 @@ You could use this feature to run a custom script, or to run a command that is n #### Ready Commands -- Not available until the next release of testcontainers-go :material-tag: main +- Since testcontainers-go :material-tag: v0.28.0 Testcontainers exposes the `WithAfterReadyCommand(e ...Executable)` option to run arbitrary commands in the container right after it's ready, which happens when the defined wait strategies have finished with success. diff --git a/docs/modules/cockroachdb.md b/docs/modules/cockroachdb.md index a3dd3d84bb..51c845b9f4 100644 --- a/docs/modules/cockroachdb.md +++ b/docs/modules/cockroachdb.md @@ -1,6 +1,6 @@ # CockroachDB -Not available until the next release of testcontainers-go :material-tag: main +Since testcontainers-go :material-tag: v0.28.0 ## Introduction diff --git a/docs/modules/consul.md b/docs/modules/consul.md index ba21cc39b1..e094efed9e 100644 --- a/docs/modules/consul.md +++ b/docs/modules/consul.md @@ -1,6 +1,6 @@ # Consul -Not available until the next release of testcontainers-go :material-tag: main +Since testcontainers-go :material-tag: v0.28.0 ## Introduction diff --git a/docs/modules/inbucket.md b/docs/modules/inbucket.md index 729538d831..eb94a0b918 100644 --- a/docs/modules/inbucket.md +++ b/docs/modules/inbucket.md @@ -1,6 +1,6 @@ # Inbucket -Not available until the next release of testcontainers-go :material-tag: main +Since testcontainers-go :material-tag: v0.28.0 ## Introduction diff --git a/docs/modules/minio.md b/docs/modules/minio.md index 6205aa7725..141aae23fe 100644 --- a/docs/modules/minio.md +++ b/docs/modules/minio.md @@ -1,6 +1,6 @@ # Minio -Not available until the next release of testcontainers-go :material-tag: main +Since testcontainers-go :material-tag: v0.28.0 ## Introduction diff --git a/docs/modules/mockserver.md b/docs/modules/mockserver.md index 30c8520ecc..4ebc2bd732 100644 --- a/docs/modules/mockserver.md +++ b/docs/modules/mockserver.md @@ -1,6 +1,6 @@ # MockServer -Not available until the next release of testcontainers-go :material-tag: main +Since testcontainers-go :material-tag: v0.28.0 ## Introduction diff --git a/docs/modules/openldap.md b/docs/modules/openldap.md index 48b545c8c1..b7311a61d0 100644 --- a/docs/modules/openldap.md +++ b/docs/modules/openldap.md @@ -1,6 +1,6 @@ # OpenLDAP -Not available until the next release of testcontainers-go :material-tag: main +Since testcontainers-go :material-tag: v0.28.0 ## Introduction diff --git a/examples/nginx/go.mod b/examples/nginx/go.mod index 985bea4009..d649e5329a 100644 --- a/examples/nginx/go.mod +++ b/examples/nginx/go.mod @@ -2,7 +2,7 @@ module github.com/testcontainers/testcontainers-go/examples/nginx go 1.20 -require github.com/testcontainers/testcontainers-go v0.27.0 +require github.com/testcontainers/testcontainers-go v0.28.0 replace github.com/testcontainers/testcontainers-go => ../.. diff --git a/examples/toxiproxy/go.mod b/examples/toxiproxy/go.mod index 14558bc876..aeb6dc5e17 100644 --- a/examples/toxiproxy/go.mod +++ b/examples/toxiproxy/go.mod @@ -6,7 +6,7 @@ require ( github.com/Shopify/toxiproxy/v2 v2.7.0 github.com/go-redis/redis/v8 v8.11.5 github.com/google/uuid v1.6.0 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 ) require ( diff --git a/mkdocs.yml b/mkdocs.yml index cbee932874..a4138d35f8 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -117,4 +117,4 @@ nav: - Getting help: getting_help.md edit_uri: edit/main/docs/ extra: - latest_version: v0.27.0 + latest_version: v0.28.0 diff --git a/modules/artemis/go.mod b/modules/artemis/go.mod index 0cf10e3fbf..764401ece1 100644 --- a/modules/artemis/go.mod +++ b/modules/artemis/go.mod @@ -6,7 +6,7 @@ require ( github.com/docker/go-connections v0.5.0 github.com/go-stomp/stomp/v3 v3.0.5 github.com/stretchr/testify v1.8.4 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 ) require ( diff --git a/modules/cassandra/go.mod b/modules/cassandra/go.mod index 8185e610da..94c4f628f2 100644 --- a/modules/cassandra/go.mod +++ b/modules/cassandra/go.mod @@ -6,7 +6,7 @@ require ( github.com/docker/go-connections v0.5.0 github.com/gocql/gocql v1.6.0 github.com/stretchr/testify v1.8.4 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 ) require ( diff --git a/modules/clickhouse/go.mod b/modules/clickhouse/go.mod index d245446c49..ef8015b146 100644 --- a/modules/clickhouse/go.mod +++ b/modules/clickhouse/go.mod @@ -7,7 +7,7 @@ require ( github.com/cenkalti/backoff/v4 v4.2.1 github.com/docker/go-connections v0.5.0 github.com/stretchr/testify v1.8.4 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 ) require ( diff --git a/modules/cockroachdb/go.mod b/modules/cockroachdb/go.mod index 5f59c47288..ae5217a7b4 100644 --- a/modules/cockroachdb/go.mod +++ b/modules/cockroachdb/go.mod @@ -6,7 +6,7 @@ require ( github.com/docker/go-connections v0.5.0 github.com/jackc/pgx/v5 v5.5.2 github.com/stretchr/testify v1.8.4 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 ) require ( diff --git a/modules/compose/go.mod b/modules/compose/go.mod index 04542ac1f3..2832604328 100644 --- a/modules/compose/go.mod +++ b/modules/compose/go.mod @@ -13,7 +13,7 @@ require ( github.com/docker/docker v25.0.2+incompatible github.com/google/uuid v1.6.0 github.com/stretchr/testify v1.8.4 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 golang.org/x/sync v0.6.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/modules/consul/go.mod b/modules/consul/go.mod index f1adfded88..921057679d 100644 --- a/modules/consul/go.mod +++ b/modules/consul/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/hashicorp/consul/api v1.27.0 github.com/stretchr/testify v1.8.4 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 ) require ( diff --git a/modules/couchbase/go.mod b/modules/couchbase/go.mod index 5804302c72..a3000d29d3 100644 --- a/modules/couchbase/go.mod +++ b/modules/couchbase/go.mod @@ -6,7 +6,7 @@ require ( github.com/cenkalti/backoff/v4 v4.2.1 github.com/couchbase/gocb/v2 v2.7.1 github.com/docker/go-connections v0.5.0 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 github.com/tidwall/gjson v1.17.0 ) diff --git a/modules/elasticsearch/go.mod b/modules/elasticsearch/go.mod index 55a7eeb95e..e9067f2e03 100644 --- a/modules/elasticsearch/go.mod +++ b/modules/elasticsearch/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/elastic/go-elasticsearch/v8 v8.11.1 github.com/stretchr/testify v1.8.4 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 golang.org/x/mod v0.14.0 ) diff --git a/modules/gcloud/go.mod b/modules/gcloud/go.mod index 6e5a145b5c..849bef64e9 100644 --- a/modules/gcloud/go.mod +++ b/modules/gcloud/go.mod @@ -10,7 +10,7 @@ require ( cloud.google.com/go/pubsub v1.36.1 cloud.google.com/go/spanner v1.56.0 github.com/docker/go-connections v0.5.0 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 google.golang.org/api v0.160.0 google.golang.org/grpc v1.61.0 ) diff --git a/modules/inbucket/go.mod b/modules/inbucket/go.mod index 47de310026..8013c7b60b 100644 --- a/modules/inbucket/go.mod +++ b/modules/inbucket/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/inbucket/inbucket v2.0.0+incompatible - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 ) require ( diff --git a/modules/k3s/go.mod b/modules/k3s/go.mod index c1fa18d823..937bc83a2a 100644 --- a/modules/k3s/go.mod +++ b/modules/k3s/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/docker/docker v25.0.2+incompatible github.com/docker/go-connections v0.5.0 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 gopkg.in/yaml.v3 v3.0.1 k8s.io/api v0.29.1 k8s.io/apimachinery v0.29.1 diff --git a/modules/k6/go.mod b/modules/k6/go.mod index c78526c823..eb809d5122 100644 --- a/modules/k6/go.mod +++ b/modules/k6/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/docker/docker v25.0.2+incompatible - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 ) require ( diff --git a/modules/kafka/go.mod b/modules/kafka/go.mod index 9c0b79ea4a..900f11ef65 100644 --- a/modules/kafka/go.mod +++ b/modules/kafka/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/IBM/sarama v1.42.1 github.com/docker/go-connections v0.5.0 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 golang.org/x/mod v0.14.0 ) diff --git a/modules/localstack/go.mod b/modules/localstack/go.mod index 08ccd695b2..5f0d9e6c70 100644 --- a/modules/localstack/go.mod +++ b/modules/localstack/go.mod @@ -11,7 +11,7 @@ require ( github.com/docker/docker v25.0.2+incompatible github.com/docker/go-connections v0.5.0 github.com/stretchr/testify v1.8.4 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 golang.org/x/mod v0.12.0 ) diff --git a/modules/mariadb/go.mod b/modules/mariadb/go.mod index 2bf48e19a3..159d435700 100644 --- a/modules/mariadb/go.mod +++ b/modules/mariadb/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/go-sql-driver/mysql v1.7.1 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 ) require ( diff --git a/modules/minio/go.mod b/modules/minio/go.mod index bef817a8d7..6c5dfb5369 100644 --- a/modules/minio/go.mod +++ b/modules/minio/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/minio/minio-go/v7 v7.0.66 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 ) require ( diff --git a/modules/mockserver/go.mod b/modules/mockserver/go.mod index 61eb09cd43..c7abe31c04 100644 --- a/modules/mockserver/go.mod +++ b/modules/mockserver/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/BraspagDevelopers/mock-server-client v0.2.2 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 ) require ( diff --git a/modules/mongodb/go.mod b/modules/mongodb/go.mod index 6ba600da5c..37d1059c5e 100644 --- a/modules/mongodb/go.mod +++ b/modules/mongodb/go.mod @@ -3,7 +3,7 @@ module github.com/testcontainers/testcontainers-go/modules/mongodb go 1.20 require ( - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 go.mongodb.org/mongo-driver v1.13.1 ) diff --git a/modules/mssql/go.mod b/modules/mssql/go.mod index d8c962d13a..45b3041a34 100644 --- a/modules/mssql/go.mod +++ b/modules/mssql/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/microsoft/go-mssqldb v1.6.0 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 ) require ( diff --git a/modules/mysql/go.mod b/modules/mysql/go.mod index 700536008d..086a3774cc 100644 --- a/modules/mysql/go.mod +++ b/modules/mysql/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/go-sql-driver/mysql v1.7.1 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 ) diff --git a/modules/nats/go.mod b/modules/nats/go.mod index b32bf15f13..375dc648ab 100644 --- a/modules/nats/go.mod +++ b/modules/nats/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/nats-io/nats.go v1.32.0 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 ) require ( diff --git a/modules/neo4j/go.mod b/modules/neo4j/go.mod index f36ddf50b5..b7bd5c681b 100644 --- a/modules/neo4j/go.mod +++ b/modules/neo4j/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/docker/go-connections v0.5.0 github.com/neo4j/neo4j-go-driver/v5 v5.16.0 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 ) require ( diff --git a/modules/openldap/go.mod b/modules/openldap/go.mod index ad7d5e90f0..e320ee4ab1 100644 --- a/modules/openldap/go.mod +++ b/modules/openldap/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/go-ldap/ldap/v3 v3.4.6 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 ) require ( diff --git a/modules/postgres/go.mod b/modules/postgres/go.mod index f2e28fd416..16ab32cb19 100644 --- a/modules/postgres/go.mod +++ b/modules/postgres/go.mod @@ -7,7 +7,7 @@ require ( github.com/jackc/pgx/v5 v5.5.3 github.com/lib/pq v1.10.9 github.com/stretchr/testify v1.8.4 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 ) diff --git a/modules/pulsar/go.mod b/modules/pulsar/go.mod index 5569b4915a..36195ceedb 100644 --- a/modules/pulsar/go.mod +++ b/modules/pulsar/go.mod @@ -7,7 +7,7 @@ require ( github.com/docker/docker v25.0.2+incompatible github.com/docker/go-connections v0.5.0 github.com/stretchr/testify v1.8.4 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 ) replace github.com/testcontainers/testcontainers-go => ../.. diff --git a/modules/rabbitmq/go.mod b/modules/rabbitmq/go.mod index d5355ecd5d..a6df65925f 100644 --- a/modules/rabbitmq/go.mod +++ b/modules/rabbitmq/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/docker/go-connections v0.5.0 github.com/rabbitmq/amqp091-go v1.9.0 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 ) require ( diff --git a/modules/redis/go.mod b/modules/redis/go.mod index 072d482246..2c777fba77 100644 --- a/modules/redis/go.mod +++ b/modules/redis/go.mod @@ -6,7 +6,7 @@ require ( github.com/go-redis/redis/v8 v8.11.5 github.com/google/uuid v1.6.0 github.com/stretchr/testify v1.8.4 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 ) diff --git a/modules/redpanda/go.mod b/modules/redpanda/go.mod index dbb03f42aa..1e30aa58c9 100644 --- a/modules/redpanda/go.mod +++ b/modules/redpanda/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/docker/go-connections v0.5.0 github.com/stretchr/testify v1.8.4 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 github.com/twmb/franz-go v1.15.4 github.com/twmb/franz-go/pkg/kadm v1.10.0 golang.org/x/mod v0.14.0 diff --git a/modules/vault/go.mod b/modules/vault/go.mod index 5a76aea19f..46653e043f 100644 --- a/modules/vault/go.mod +++ b/modules/vault/go.mod @@ -6,7 +6,7 @@ require ( github.com/docker/docker v25.0.2+incompatible github.com/hashicorp/vault-client-go v0.3.3 github.com/stretchr/testify v1.8.4 - github.com/testcontainers/testcontainers-go v0.27.0 + github.com/testcontainers/testcontainers-go v0.28.0 github.com/tidwall/gjson v1.17.0 ) diff --git a/sonar-project.properties b/sonar-project.properties index 25d6e50b0d..588a152626 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -7,7 +7,7 @@ sonar.projectKey=testcontainers_testcontainers-go sonar.projectName=testcontainers-go -sonar.projectVersion=v0.27.0 +sonar.projectVersion=v0.28.0 sonar.sources=. From b9aecfbfc1501cfc6278306ba550e17bae324e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Thu, 15 Feb 2024 11:54:12 +0100 Subject: [PATCH 06/10] chore: prepare for next minor development cycle (0.29.0) --- internal/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/version.go b/internal/version.go index 6f3488fdbf..79a44f09fb 100644 --- a/internal/version.go +++ b/internal/version.go @@ -1,4 +1,4 @@ package internal // Version is the next development version of the application -const Version = "0.28.0" +const Version = "0.29.0" From 44014477ff52f264ff158799cf1bc6b871634017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Thu, 15 Feb 2024 12:50:29 +0100 Subject: [PATCH 07/10] chore(deps): bump golang.org/x/mod from 0.14.0 to 0.15.0 in /modules/kafka, golang.org/x/mod from 0.14.0 to 0.15.0 in /modulegen (#2237) * chore(deps): bump golang.org/x/mod from 0.14.0 to 0.15.0 in /modulegen Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.14.0 to 0.15.0. - [Commits](https://github.com/golang/mod/compare/v0.14.0...v0.15.0) --- updated-dependencies: - dependency-name: golang.org/x/mod dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * chore(deps): bump golang.org/x/mod in /modules/kafka Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.14.0 to 0.15.0. - [Commits](https://github.com/golang/mod/compare/v0.14.0...v0.15.0) --- updated-dependencies: - dependency-name: golang.org/x/mod dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- modulegen/go.mod | 2 +- modulegen/go.sum | 4 ++-- modules/kafka/go.mod | 2 +- modules/kafka/go.sum | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modulegen/go.mod b/modulegen/go.mod index f6b58d063e..def55e15b9 100644 --- a/modulegen/go.mod +++ b/modulegen/go.mod @@ -6,7 +6,7 @@ require ( github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.8.4 golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb - golang.org/x/mod v0.14.0 + golang.org/x/mod v0.15.0 golang.org/x/text v0.14.0 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/modulegen/go.sum b/modulegen/go.sum index 43ee5b0f8b..7642f19f1d 100644 --- a/modulegen/go.sum +++ b/modulegen/go.sum @@ -14,8 +14,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb h1:mIKbk8weKhSeLH2GmUTrvx8CjkyJmnU1wFmg59CUjFA= golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/modules/kafka/go.mod b/modules/kafka/go.mod index 900f11ef65..2c238e6125 100644 --- a/modules/kafka/go.mod +++ b/modules/kafka/go.mod @@ -6,7 +6,7 @@ require ( github.com/IBM/sarama v1.42.1 github.com/docker/go-connections v0.5.0 github.com/testcontainers/testcontainers-go v0.28.0 - golang.org/x/mod v0.14.0 + golang.org/x/mod v0.15.0 ) require ( diff --git a/modules/kafka/go.sum b/modules/kafka/go.sum index 8f41374ff5..b97ce996f1 100644 --- a/modules/kafka/go.sum +++ b/modules/kafka/go.sum @@ -165,8 +165,8 @@ golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea/go.mod h1:V1LtkGg67GoY2N1AnL golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= From e27aaeb3bc2abf0a3d250b974e749b5a17988850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Thu, 15 Feb 2024 12:50:40 +0100 Subject: [PATCH 08/10] chore(deps): bump cloud.google.com/go/spanner from 1.56.0 to 1.57.0 in /modules/gcloud, cloud.google.com/go/bigquery from 1.58.0 to 1.59.1 in /modules/gcloud, google.golang.org/api from 0.160.0 to 0.165.0 in /modules/gcloud (#2238) * chore(deps): bump google.golang.org/api in /modules/gcloud Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.160.0 to 0.165.0. - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.160.0...v0.165.0) --- updated-dependencies: - dependency-name: google.golang.org/api dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * chore(deps): bump cloud.google.com/go/bigquery in /modules/gcloud Bumps [cloud.google.com/go/bigquery](https://github.com/googleapis/google-cloud-go) from 1.58.0 to 1.59.1. - [Release notes](https://github.com/googleapis/google-cloud-go/releases) - [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-cloud-go/compare/bigquery/v1.58.0...bigquery/v1.59.1) --- updated-dependencies: - dependency-name: cloud.google.com/go/bigquery dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * chore(deps): bump cloud.google.com/go/spanner in /modules/gcloud Bumps [cloud.google.com/go/spanner](https://github.com/googleapis/google-cloud-go) from 1.56.0 to 1.57.0. - [Release notes](https://github.com/googleapis/google-cloud-go/releases) - [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.56.0...spanner/v1.57.0) --- updated-dependencies: - dependency-name: cloud.google.com/go/spanner dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- modules/gcloud/go.mod | 60 +++++++++------------ modules/gcloud/go.sum | 123 ++++++++++++++++++------------------------ 2 files changed, 76 insertions(+), 107 deletions(-) diff --git a/modules/gcloud/go.mod b/modules/gcloud/go.mod index 849bef64e9..fbee737e29 100644 --- a/modules/gcloud/go.mod +++ b/modules/gcloud/go.mod @@ -3,15 +3,15 @@ module github.com/testcontainers/testcontainers-go/modules/gcloud go 1.20 require ( - cloud.google.com/go/bigquery v1.58.0 + cloud.google.com/go/bigquery v1.59.1 cloud.google.com/go/bigtable v1.21.0 cloud.google.com/go/datastore v1.15.0 cloud.google.com/go/firestore v1.14.0 cloud.google.com/go/pubsub v1.36.1 - cloud.google.com/go/spanner v1.56.0 + cloud.google.com/go/spanner v1.57.0 github.com/docker/go-connections v0.5.0 github.com/testcontainers/testcontainers-go v0.28.0 - google.golang.org/api v0.160.0 + google.golang.org/api v0.165.0 google.golang.org/grpc v1.61.0 ) @@ -19,15 +19,13 @@ require ( cloud.google.com/go v0.112.0 // indirect cloud.google.com/go/compute v1.23.3 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.1.5 // indirect - cloud.google.com/go/longrunning v0.5.4 // indirect + cloud.google.com/go/iam v1.1.6 // indirect + cloud.google.com/go/longrunning v0.5.5 // indirect dario.cat/mergo v1.0.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/Microsoft/hcsshim v0.11.4 // indirect - github.com/andybalholm/brotli v1.0.4 // indirect - github.com/apache/arrow/go/v12 v12.0.1 // indirect - github.com/apache/thrift v0.16.0 // indirect + github.com/apache/arrow/go/v14 v14.0.2 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect @@ -36,7 +34,6 @@ require ( github.com/containerd/containerd v1.7.12 // indirect github.com/containerd/log v0.1.0 // indirect github.com/cpuguy83/dockercfg v0.3.1 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect github.com/distribution/reference v0.5.0 // indirect github.com/docker/docker v25.0.2+incompatible // indirect github.com/docker/go-units v0.5.0 // indirect @@ -46,25 +43,20 @@ require ( github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/goccy/go-json v0.9.11 // indirect + github.com/goccy/go-json v0.10.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/google/flatbuffers v2.0.8+incompatible // indirect + github.com/google/flatbuffers v23.5.26+incompatible // indirect github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.12.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/asmfmt v1.3.2 // indirect - github.com/klauspost/compress v1.16.0 // indirect - github.com/klauspost/cpuid/v2 v2.0.9 // indirect - github.com/kr/text v0.2.0 // indirect + github.com/klauspost/compress v1.16.7 // indirect + github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 // indirect - github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 // indirect github.com/moby/patternmatcher v0.6.0 // indirect github.com/moby/sys/sequential v0.5.0 // indirect github.com/moby/sys/user v0.1.0 // indirect @@ -74,15 +66,12 @@ require ( github.com/morikuni/aec v1.0.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc5 // indirect - github.com/pierrec/lz4/v4 v4.1.15 // indirect + github.com/pierrec/lz4/v4 v4.1.18 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/shirou/gopsutil/v3 v3.23.12 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/sirupsen/logrus v1.9.3 // indirect - github.com/stretchr/objx v0.5.0 // indirect - github.com/stretchr/testify v1.8.4 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect @@ -90,26 +79,25 @@ require ( go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect - go.opentelemetry.io/otel v1.22.0 // indirect - go.opentelemetry.io/otel/metric v1.22.0 // indirect - go.opentelemetry.io/otel/trace v1.22.0 // indirect - golang.org/x/crypto v0.18.0 // indirect - golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea // indirect - golang.org/x/mod v0.11.0 // indirect - golang.org/x/net v0.20.0 // indirect - golang.org/x/oauth2 v0.16.0 // indirect + go.opentelemetry.io/otel v1.23.0 // indirect + go.opentelemetry.io/otel/metric v1.23.0 // indirect + go.opentelemetry.io/otel/trace v1.23.0 // indirect + golang.org/x/crypto v0.19.0 // indirect + golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect + golang.org/x/mod v0.13.0 // indirect + golang.org/x/net v0.21.0 // indirect + golang.org/x/oauth2 v0.17.0 // indirect golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.16.0 // indirect + golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.10.0 // indirect + golang.org/x/tools v0.14.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240122161410-6c6643bf1457 // indirect + google.golang.org/genproto v0.0.0-20240125205218-1f4bbc51befe // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 // indirect google.golang.org/protobuf v1.32.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect ) replace github.com/testcontainers/testcontainers-go => ../.. diff --git a/modules/gcloud/go.sum b/modules/gcloud/go.sum index 0bb91074bd..b0ebf2b685 100644 --- a/modules/gcloud/go.sum +++ b/modules/gcloud/go.sum @@ -1,46 +1,41 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4= -cloud.google.com/go/bigquery v1.58.0 h1:drSd9RcPVLJP2iFMimvOB9SCSIrcl+9HD4II03Oy7A0= -cloud.google.com/go/bigquery v1.58.0/go.mod h1:0eh4mWNY0KrBTjUzLjoYImapGORq9gEPT7MWjCy9lik= +cloud.google.com/go/bigquery v1.59.1 h1:CpT+/njKuKT3CEmswm6IbhNu9u35zt5dO4yPDLW+nG4= +cloud.google.com/go/bigquery v1.59.1/go.mod h1:VP1UJYgevyTwsV7desjzNzDND5p6hZB+Z8gZJN1GQUc= cloud.google.com/go/bigtable v1.21.0 h1:BFN4jhkA9ULYYV2Ug7AeOtetVLnN2jKuIq5TcRc5C38= cloud.google.com/go/bigtable v1.21.0/go.mod h1:V0sYNRtk0dgAKjyRr/MyBpHpSXqh+9P39euf820EZ74= cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -cloud.google.com/go/datacatalog v1.19.0 h1:rbYNmHwvAOOwnW2FPXYkaK3Mf1MmGqRzK0mMiIEyLdo= +cloud.google.com/go/datacatalog v1.19.3 h1:A0vKYCQdxQuV4Pi0LL9p39Vwvg4jH5yYveMv50gU5Tw= cloud.google.com/go/datastore v1.15.0 h1:0P9WcsQeTWjuD1H14JIY7XQscIPQ4Laje8ti96IC5vg= cloud.google.com/go/datastore v1.15.0/go.mod h1:GAeStMBIt9bPS7jMJA85kgkpsMkvseWWXiaHya9Jes8= cloud.google.com/go/firestore v1.14.0 h1:8aLcKnMPoldYU3YHgu4t2exrKhLQkqaXAGqT0ljrFVw= cloud.google.com/go/firestore v1.14.0/go.mod h1:96MVaHLsEhbvkBEdZgfN+AS/GIkco1LRpH9Xp9YZfzQ= -cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI= -cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= +cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= +cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= cloud.google.com/go/kms v1.15.5 h1:pj1sRfut2eRbD9pFRjNnPNg/CzJPuQAzUujMIM1vVeM= -cloud.google.com/go/longrunning v0.5.4 h1:w8xEcbZodnA2BbW6sVirkkoC+1gP8wS57EUUgGS0GVg= -cloud.google.com/go/longrunning v0.5.4/go.mod h1:zqNVncI0BOP8ST6XQD1+VcvuShMmq7+xFSzOL++V0dI= +cloud.google.com/go/longrunning v0.5.5 h1:GOE6pZFdSrTb4KAiKnXsJBtlE6mEyaW44oKyMILWnOg= +cloud.google.com/go/longrunning v0.5.5/go.mod h1:WV2LAxD8/rg5Z1cNW6FJ/ZpX4E4VnDnoTk0yawPBB7s= cloud.google.com/go/pubsub v1.36.1 h1:dfEPuGCHGbWUhaMCTHUFjfroILEkx55iUmKBZTP5f+Y= cloud.google.com/go/pubsub v1.36.1/go.mod h1:iYjCa9EzWOoBiTdd4ps7QoMtMln5NwaZQpK1hbRfBDE= -cloud.google.com/go/spanner v1.56.0 h1:o/Cv7/zZ1WgRXVCd5g3Nc23ZI39p/1pWFqFwvg6Wcu8= -cloud.google.com/go/spanner v1.56.0/go.mod h1:DndqtUKQAt3VLuV2Le+9Y3WTnq5cNKrnLb/Piqcj+h0= -cloud.google.com/go/storage v1.36.0 h1:P0mOkAcaJxhCTvAkMhxMfrTKiNcub4YmmPBtlhAyTr8= +cloud.google.com/go/spanner v1.57.0 h1:fJq+ZfQUDHE+cy1li0bJA8+sy2oiSGhuGqN5nqVaZdU= +cloud.google.com/go/spanner v1.57.0/go.mod h1:aXQ5QDdhPRIqVhYmnkAdwPYvj/DRN0FguclhEWw+jOo= +cloud.google.com/go/storage v1.37.0 h1:WI8CsaFO8Q9KjPVtsZ5Cmi0dXV25zMoX0FklT7c3Jm4= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c h1:RGWPOewvKIROun94nF7v2cua9qP+thov/7M50KEoeSU= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w= -github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= -github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/apache/arrow/go/v12 v12.0.1 h1:JsR2+hzYYjgSUkBSaahpqCetqZMr76djX80fF/DiJbg= -github.com/apache/arrow/go/v12 v12.0.1/go.mod h1:weuTY7JvTG/HDPtMQxEUp7pU73vkLWMLpY67QwZ/WWw= -github.com/apache/thrift v0.16.0 h1:qEy6UW60iVOlUy+b9ZR0d5WzUWYGOo4HfopoyBaNmoY= -github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= +github.com/apache/arrow/go/v14 v14.0.2 h1:N8OkaJEOfI3mEZt07BIkvo4sC6XDbL+48MBPWO5IONw= +github.com/apache/arrow/go/v14 v14.0.2/go.mod h1:u3fgh3EdgN/YQ8cVQRguVW3R+seMybFg8QBQ5LU+eBY= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -61,7 +56,6 @@ github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E= github.com/cpuguy83/dockercfg v0.3.1/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -91,8 +85,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= -github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -100,7 +94,6 @@ github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4er github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= @@ -114,11 +107,9 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= -github.com/google/flatbuffers v2.0.8+incompatible h1:ivUb1cGomAB101ZM1T0nOiWz9pSrTMoa9+EiY7igmkM= -github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/flatbuffers v23.5.26+incompatible h1:M9dgRyhJemaM4Sw8+66GHBu8ioaQmyPLg1b8VwK5WJg= +github.com/google/flatbuffers v23.5.26+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -146,23 +137,14 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/asmfmt v1.3.2 h1:4Ri7ox3EwapiOjCki+hw14RyKk201CN4rzyCJRFLpK4= -github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= -github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= -github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= +github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= +github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 h1:AMFGa4R4MiIpspGNG7Z948v4n35fFGB3RR3G/ry4FWs= -github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= -github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 h1:+n/aFZefKZp7spd8DFdX7uMikMLXX4oubIzJF4kv/wI= -github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc= @@ -182,8 +164,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8 github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= -github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0= -github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ= +github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -191,7 +173,6 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4= github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= @@ -230,33 +211,33 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.4 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0/go.mod h1:r9vWsPS/3AQItv3OSlEJ/E4mbrhUbbw18meOjArPtKQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= -go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= -go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= +go.opentelemetry.io/otel v1.23.0 h1:Df0pqjqExIywbMCMTxkAwzjLZtRf+bBKLbUcpxO2C9E= +go.opentelemetry.io/otel v1.23.0/go.mod h1:YCycw9ZeKhcJFrb34iVSkyT0iczq/zYDtZYFufObyB0= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg= -go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= -go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= +go.opentelemetry.io/otel/metric v1.23.0 h1:pazkx7ss4LFVVYSxYew7L5I6qvLXHA0Ap2pwV+9Cnpo= +go.opentelemetry.io/otel/metric v1.23.0/go.mod h1:MqUW2X2a6Q8RN96E2/nqNoT+z9BSms20Jb7Bbp+HiTo= go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= -go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= -go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= +go.opentelemetry.io/otel/trace v1.23.0 h1:37Ik5Ib7xfYVb4V1UtnT97T1jI+AoIYkJyPkuL4iJgI= +go.opentelemetry.io/otel/trace v1.23.0/go.mod h1:GSGTbIClEsuZrGIzoEHqsVfxgn5UkggkflQwDScNUsk= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= -golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea h1:vLCWI/yYrdEHyN2JzIzPO3aaQJHQdp89IZBA/+azVC4= -golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= +golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -268,11 +249,11 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= -golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/oauth2 v0.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ= +golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -293,11 +274,12 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -317,17 +299,17 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg= -golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= +golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -gonum.org/v1/gonum v0.11.0 h1:f1IJhK4Km5tBJmaiJXtk/PkL4cdVX6J+tGiM187uT5E= -google.golang.org/api v0.160.0 h1:SEspjXHVqE1m5a1fRy8JFB+5jSu+V0GEDKDghF3ttO4= -google.golang.org/api v0.160.0/go.mod h1:0mu0TpK33qnydLvWqbImq2b1eQ5FHRSDCBzAxX9ZHyw= +gonum.org/v1/gonum v0.12.0 h1:xKuo6hzt+gMav00meVPUlXwSdoEJP46BR+wdxQEFK2o= +google.golang.org/api v0.165.0 h1:zd5d4JIIIaYYsfVy1HzoXYZ9rWCSBxxAglbczzo7Bgc= +google.golang.org/api v0.165.0/go.mod h1:2OatzO7ZDQsoS7IFf3rvsE17/TldiU3F/zxFHeqUB5o= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= @@ -335,12 +317,12 @@ google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac h1:ZL/Teoy/ZGnzyrqK/Optxxp2pmVh+fmJ97slxSRyzUg= -google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:+Rvu7ElI+aLzyDQhpHMFMMltsD6m7nqpuWDd2CwJw3k= -google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe h1:0poefMBYvYbs7g5UkjS6HcxBPaTRAmznle9jnxYoAI8= -google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240122161410-6c6643bf1457 h1:6Bi3wdn5Ed9baJn7P0gOhjwA98wOr6uSPjKagPHOVsE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240122161410-6c6643bf1457/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= +google.golang.org/genproto v0.0.0-20240125205218-1f4bbc51befe h1:USL2DhxfgRchafRvt/wYyyQNzwgL7ZiURcozOE/Pkvo= +google.golang.org/genproto v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= +google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= +google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 h1:FSL3lRCkhaPFxqi0s9o+V4UI2WTzAVOvkgbd4kVV4Wg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014/go.mod h1:SaPjaZGWb0lPqs6Ittu0spdfrOArqji4ZdeP5IC/9N4= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -362,7 +344,6 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From ca7d66878f647a4ecb2294ad83f11a46484d355d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Thu, 15 Feb 2024 16:08:33 +0100 Subject: [PATCH 09/10] docs: improve module creation section (#2239) --- docs/modules/index.md | 44 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/docs/modules/index.md b/docs/modules/index.md index a5eb772083..6c0e9ceb94 100644 --- a/docs/modules/index.md +++ b/docs/modules/index.md @@ -1,8 +1,45 @@ # Testcontainers for Go modules -In this section you'll discover how to create Go modules for _Testcontainers for Go_. +In this section you'll discover how to create Go modules for _Testcontainers for Go_, including the steps to follow, the best practices, and the guidelines to consider before creating a new module. -## Interested in adding a new module? +## Before creating a new module + +First, you have to consider the following things before creating a new module to the project: + +1. Please check if the module you are interested in is already present in the [Modules Catalog](https://testcontainers.com/modules/?language=go). +If it's already there, you can use it as a dependency in your project, and you can also contribute to the module if you want to improve it! +2. If it is not present there, please consider where you are going to host the module: under your own GitHub account as a **Community module**, or under the `testcontainers-go` repository. +3. If you're a vendor interested in creating an **Official module** for your project/product, please contact us, see below. + +In any case, we will be happy to assist you in the process of creating the module. Please feel free to ask for assistance in our [Slack](https://slack.testcontainers.org/) or in the [GitHub Discussions](https://github.com/testcontainers/testcontainers-go/discussions). + +### Community modules + +If you are going to host the module under your own GitHub account, please consider the following: + +- you'll have to follow the same guidelines as the ones for the modules hosted under the `testcontainers-go` repository, +including the naming conventions, the documentation, the tests and the testable examples, and defining a proper CI workflow. +You'll find more information in the sections below. +- you'll be more autonomous in the development and release of the module, not having to wait for the maintainers to review and merge your PRs. +As a direct consequence, you'll be responsible for the maintenance, documentation and support of the module, +including updating the module to the latest version of _Testcontainers for Go_ if/when needed. +- once created, you'll need to add the module to the [Modules Catalog](https://testcontainers.com/modules/?language=go) in order to be listed there. +You can do this by submitting a PR to the [community repository](https://github.com/testcontainers/community-module-registry). +An example can be found [here](https://github.com/testcontainers/community-module-registry/pull/21/files). +- you'll need to add the module to the [Go documentation](https://pkg.go.dev) in order to be listed there. Please check our [Releasing docs](https://github.com/testcontainers/testcontainers-go/blob/main/RELEASING.md) for more information about triggering the Golang Proxy. + +### Modules hosted under the `testcontainers-go` repository + +If you still want to host the module under the `testcontainers-go` repository, please consider the following: + +- we are not experts in all the technologies out there, so we are open to contributions from the community. +We are happy to review and merge your PRs, and we are also happy to help you with the development of the module. +But this is a shared responsibility, so we expect you to be involved in the maintenance, documentation and support of the module. +- the module will be part of the CI/CD pipeline of the `testcontainers-go` repository, so it will be tested and released with the rest of the modules. +Think of Github workflows, Dependabot, release notes, etc. Although it sounds great, which it is, it also means that it will increase the build time in our CI/CD pipeline on Github, including flaky tests, number of dependabot updates, etc. So in the end it's more work for us. +- once created, we'll add the module to the [Modules Catalog](https://testcontainers.com/modules/?language=go) and to the [Go documentation](https://pkg.go.dev/github.com/testcontainers/testcontainers-go). + +## Creating a new module We have provided a command line tool to generate the scaffolding for the code of the example you are interested in. This tool will generate: @@ -28,6 +65,9 @@ We have provided a command line tool to generate the scaffolding for the code of - an entry in Dependabot's configuration file, in order to receive dependency updates. - an entry in the VSCode workspace file, in order to include the new module in the project's workspace. +!!!info + If you are hosting the module under your own Github account, please move the generated files to the new repository. Discard the following files and directories: `mkdocs.yml`, `dependabot.yml`, VSCode workspace, Sonarqube properties, and the `.github/workflows` directory, as they are specific to the `testcontainers-go` repository. You can use them as reference to create your own CI/CD pipeline. + ### Command line flags | Flag | Short | Type | Required | Description | From 5054ae1f868c50ac92c0022a51ffa53a31028126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Thu, 15 Feb 2024 16:09:13 +0100 Subject: [PATCH 10/10] chore(deps): bump k8s.io/client-go from 0.29.1 to 0.29.2 in /modules/k3s, k8s.io/apimachinery from 0.29.1 to 0.29.2 in /modules/k3s, k8s.io/api from 0.29.1 to 0.29.2 in /modules/k3s (#2236) * chore(deps): bump k8s.io/api from 0.29.1 to 0.29.2 in /modules/k3s Bumps [k8s.io/api](https://github.com/kubernetes/api) from 0.29.1 to 0.29.2. - [Commits](https://github.com/kubernetes/api/compare/v0.29.1...v0.29.2) --- updated-dependencies: - dependency-name: k8s.io/api dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * chore(deps): bump k8s.io/apimachinery in /modules/k3s Bumps [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) from 0.29.1 to 0.29.2. - [Commits](https://github.com/kubernetes/apimachinery/compare/v0.29.1...v0.29.2) --- updated-dependencies: - dependency-name: k8s.io/apimachinery dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * chore(deps): bump k8s.io/client-go from 0.29.1 to 0.29.2 in /modules/k3s Bumps [k8s.io/client-go](https://github.com/kubernetes/client-go) from 0.29.1 to 0.29.2. - [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/kubernetes/client-go/compare/v0.29.1...v0.29.2) --- updated-dependencies: - dependency-name: k8s.io/client-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- modules/k3s/go.mod | 6 +++--- modules/k3s/go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/k3s/go.mod b/modules/k3s/go.mod index 937bc83a2a..3004584883 100644 --- a/modules/k3s/go.mod +++ b/modules/k3s/go.mod @@ -7,9 +7,9 @@ require ( github.com/docker/go-connections v0.5.0 github.com/testcontainers/testcontainers-go v0.28.0 gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.29.1 - k8s.io/apimachinery v0.29.1 - k8s.io/client-go v0.29.1 + k8s.io/api v0.29.2 + k8s.io/apimachinery v0.29.2 + k8s.io/client-go v0.29.2 ) require ( diff --git a/modules/k3s/go.sum b/modules/k3s/go.sum index 73c7987e14..2eca8d356a 100644 --- a/modules/k3s/go.sum +++ b/modules/k3s/go.sum @@ -236,12 +236,12 @@ gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= -k8s.io/api v0.29.1 h1:DAjwWX/9YT7NQD4INu49ROJuZAAAP/Ijki48GUPzxqw= -k8s.io/api v0.29.1/go.mod h1:7Kl10vBRUXhnQQI8YR/R327zXC8eJ7887/+Ybta+RoQ= -k8s.io/apimachinery v0.29.1 h1:KY4/E6km/wLBguvCZv8cKTeOwwOBqFNjwJIdMkMbbRc= -k8s.io/apimachinery v0.29.1/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU= -k8s.io/client-go v0.29.1 h1:19B/+2NGEwnFLzt0uB5kNJnfTsbV8w6TgQRz9l7ti7A= -k8s.io/client-go v0.29.1/go.mod h1:TDG/psL9hdet0TI9mGyHJSgRkW3H9JZk2dNEUS7bRks= +k8s.io/api v0.29.2 h1:hBC7B9+MU+ptchxEqTNW2DkUosJpp1P+Wn6YncZ474A= +k8s.io/api v0.29.2/go.mod h1:sdIaaKuU7P44aoyyLlikSLayT6Vb7bvJNCX105xZXY0= +k8s.io/apimachinery v0.29.2 h1:EWGpfJ856oj11C52NRCHuU7rFDwxev48z+6DSlGNsV8= +k8s.io/apimachinery v0.29.2/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU= +k8s.io/client-go v0.29.2 h1:FEg85el1TeZp+/vYJM7hkDlSTFZ+c5nnK44DJ4FyoRg= +k8s.io/client-go v0.29.2/go.mod h1:knlvFZE58VpqbQpJNbCbctTVXcd35mMyAAwBdpt4jrA= k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780=