diff --git a/src/Testcontainers.Pulsar/PulsarBuilder.cs b/src/Testcontainers.Pulsar/PulsarBuilder.cs index 51f2c75b5..b494713c9 100644 --- a/src/Testcontainers.Pulsar/PulsarBuilder.cs +++ b/src/Testcontainers.Pulsar/PulsarBuilder.cs @@ -4,7 +4,7 @@ namespace Testcontainers.Pulsar; [PublicAPI] public sealed class PulsarBuilder : ContainerBuilder { - public const string PulsarImage = "apachepulsar/pulsar:3.0.6"; + public const string PulsarImage = "apachepulsar/pulsar:4.0.0"; public const ushort PulsarBrokerDataPort = 6650; @@ -87,6 +87,7 @@ protected override PulsarBuilder Init() .WithPortBinding(PulsarBrokerDataPort, true) .WithPortBinding(PulsarWebServicePort, true) .WithFunctionsWorker(false) + .WithCreateParameterModifier(parameterModifier => parameterModifier.User = "root") .WithEntrypoint("/bin/sh", "-c") .WithCommand("while [ ! -f " + StartupScriptFilePath + " ]; do sleep 0.1; done; " + StartupScriptFilePath) .WithStartupCallback((container, ct) => container.CopyStartupScriptAsync(ct)); diff --git a/src/Testcontainers.Pulsar/PulsarContainer.cs b/src/Testcontainers.Pulsar/PulsarContainer.cs index 3989fe7f4..3c7d18a15 100644 --- a/src/Testcontainers.Pulsar/PulsarContainer.cs +++ b/src/Testcontainers.Pulsar/PulsarContainer.cs @@ -101,11 +101,10 @@ internal Task CopyStartupScriptAsync(CancellationToken ct = default) if (_configuration.AuthenticationEnabled.HasValue && _configuration.AuthenticationEnabled.Value) { - startupScript.WriteLine("bin/pulsar tokens create-secret-key --output " + PulsarBuilder.SecretKeyFilePath); + startupScript.WriteLine("bin/pulsar tokens create-secret-key --output secret.key"); startupScript.WriteLine("export brokerClientAuthenticationParameters=token:$(bin/pulsar tokens create --secret-key $PULSAR_PREFIX_tokenSecretKey --subject $superUserRoles)"); startupScript.WriteLine("export CLIENT_PREFIX_authParams=$brokerClientAuthenticationParameters"); startupScript.WriteLine("bin/apply-config-from-env.py conf/standalone.conf"); - startupScript.WriteLine("bin/apply-config-from-env-with-prefix.py CLIENT_PREFIX_ conf/client.conf"); } startupScript.Write("bin/pulsar standalone");