Skip to content

[Enhancement]: setCommand should allow space escaping #9530

@ylemoigne

Description

@ylemoigne

Module

Core

Proposal

Currently, GenericContainer.setCommand(String) do a command.split(" ").
This doesn't allow escaping the space. It can be an issue for command lines like postgres -c max_connections=100 -c default_transaction_isolation=repeatable read

The alternative method setCommand(String... commandParts) is not always available, for example, when using testcontainers through quarkus dev-service which doesn't expose a way to set command through array/list of parameters.

As command.split() take a regexp, changing the implementation to command.split("[^\\]? ") should allow user to write postgres -c max_connections=100 -c default_transaction_isolation=repeatable\ read and get correct interpretation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions