Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for escaped spaces in values #965

Closed
wants to merge 1 commit into from

Conversation

cbosdo
Copy link

@cbosdo cbosdo commented Nov 17, 2023

This change allows to use \ in BuildFlags values. For instance the following configuration will set KEY1 with value SPLIT VALUE and KEY2 with value VALUE2 to docker build.

BuildFlags: dockerargs:KEY1=SPLIT\ VALUE dockerargs:KEY2=VALUE2

This change allows to use `\ ` in BuildFlags values. For instance the
following configuration will set `KEY1` with value `SPLIT VALUE` and
`KEY2` with value `VALUE2` to docker build.

    BuildFlags: dockerargs:KEY1=SPLIT\ VALUE dockerargs:KEY2=VALUE2
@mlschroe
Copy link
Member

Hmm, I'm not really in favor of doing it this way. First, the commit changes all commands and not just the dockerarg build flag, so it may break existing configs. Second, it's too simple: the split can't just check for a \ character, as that might be the last character from an arg.

I prefer to keep the simple split() as is and just to standard url type de-escaping when generating the docker arguments. I.e.:

BuildFlags: dockerargs:KEY1=SPLIT%20VALUE dockerargs:KEY2=VALUE2

Would that also work for you?

@cbosdo
Copy link
Author

cbosdo commented Apr 17, 2024

Closing as an alternative has been merged

@cbosdo cbosdo closed this Apr 17, 2024
@cbosdo cbosdo deleted the escaped-spaces branch April 17, 2024 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants