diff --git a/docs/modules/pulsar.md b/docs/modules/pulsar.md index 9791554619..b63647897d 100644 --- a/docs/modules/pulsar.md +++ b/docs/modules/pulsar.md @@ -48,7 +48,7 @@ func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustom #### Image Use the second argument in the `Run` function to set a valid Docker image. -In example: `Run(context.Background(), "apachepulsar/pulsar:2.10.2")`. +In example: `Run(context.Background(), "apachepulsar/pulsar:4.0.9")`. ### Container Options diff --git a/modules/pulsar/examples_test.go b/modules/pulsar/examples_test.go index 9561914207..c88fc9b8a3 100644 --- a/modules/pulsar/examples_test.go +++ b/modules/pulsar/examples_test.go @@ -13,7 +13,7 @@ func ExampleRun() { // runPulsarContainer { ctx := context.Background() - pulsarContainer, err := pulsar.Run(ctx, "apachepulsar/pulsar:2.10.2") + pulsarContainer, err := pulsar.Run(ctx, "apachepulsar/pulsar:4.0.9") defer func() { if err := testcontainers.TerminateContainer(pulsarContainer); err != nil { log.Printf("failed to terminate container: %s", err) diff --git a/modules/pulsar/pulsar.go b/modules/pulsar/pulsar.go index d169e64574..4a735573b1 100644 --- a/modules/pulsar/pulsar.go +++ b/modules/pulsar/pulsar.go @@ -27,7 +27,7 @@ var defaultWaitStrategies = []wait.Strategy{ resp := string(respBytes) return resp == `["standalone"]` }), - wait.ForLog("Successfully updated the policies on namespace public/default"), + wait.ForListeningPort(defaultPulsarPort), } type Container struct { @@ -129,16 +129,16 @@ func WithTransactions() testcontainers.CustomizeRequestOption { // Deprecated: use Run instead // RunContainer creates an instance of the Pulsar container type func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*Container, error) { - return Run(ctx, "apachepulsar/pulsar:2.10.2", opts...) + return Run(ctx, "apachepulsar/pulsar:4.0.9", opts...) } // Run creates an instance of the Pulsar container type, being possible to pass a custom request and options // The created container will use the following defaults: -// - image: apachepulsar/pulsar:2.10.2 +// - image: apachepulsar/pulsar:4.0.9 // - exposed ports: 6650/tcp, 8080/tcp // - waiting strategy: wait for all the following strategies: // - the Pulsar admin API ("/admin/v2/clusters") to be ready on port 8080/tcp and return the response `["standalone"]` -// - the log message "Successfully updated the policies on namespace public/default" +// - the Pulsar port (6650/tcp) to be listening // // - command: "/bin/bash -c /pulsar/bin/apply-config-from-env.py /pulsar/conf/standalone.conf && bin/pulsar standalone --no-functions-worker -nss" func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustomizer) (*Container, error) { diff --git a/modules/pulsar/pulsar_test.go b/modules/pulsar/pulsar_test.go index 1fa07923d0..3d39c6bd07 100644 --- a/modules/pulsar/pulsar_test.go +++ b/modules/pulsar/pulsar_test.go @@ -98,7 +98,7 @@ func TestPulsar(t *testing.T) { t.Run(tt.name, func(t *testing.T) { c, err := testcontainerspulsar.Run( ctx, - "apachepulsar/pulsar:2.10.2", + "apachepulsar/pulsar:4.0.9", tt.opts..., ) testcontainers.CleanupContainer(t, c)