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

[BUG] ARGs with spaces in default values not passed down to INLCUDEs #692

Open
michael-o opened this issue Apr 3, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@michael-o
Copy link

[MANDATORY] Describe the bug [MANDATORY]
When a default value with a space is passed along to includes the value is truncated from the first space char.

[MANDATORY] Bastille and FreeBSD version (paste bastille -v && freebsd-version -kru output)
0.10.20231125
13.3-STABLE
13.3-STABLE
13.3-STABLE

[MANDATORY] How did you install bastille? (port/pkg/git)
pkg

[optional] Steps to reproduce?
(reduced from a larger setup)
Consider the following templates:

root@deblndw013x:/usr/local/bastille/templates
# cat sample/top/Bastillefile
ARG FIRST_DOMAIN="foo"
ARG SECOND_DOMAIN="bar"
ARG SEARCH_DOMAINS="${FIRST_DOMAIN} ${SECOND_DOMAIN}"

CMD echo "${SEARCH_DOMAINS}"
INCLUDE sample/bottom --arg SEARCH_DOMAINS="${SEARCH_DOMAINS}"
# cat sample/bottom/Bastillefile
ARG FIRST_DOMAIN="foo"
ARG SECOND_DOMAIN="bar"
ARG SEARCH_DOMAINS="${FIRST_DOMAIN} ${SECOND_DOMAIN}"

CMD echo "${SEARCH_DOMAINS}"

now let's run it:

# bastille template deblndw013x3j sample/top
[deblndw013x3j]:
Applying template: sample/top...
[deblndw013x3j]:
foo bar
[deblndw013x3j]: 0

[deblndw013x3j]:
Applying template: sample/bottom...
[deblndw013x3j]:
foo
[deblndw013x3j]: 0

Template applied: sample/bottom

Template applied: sample/top

# bastille template deblndw013x3j sample/top --arg FIRST_DOMAIN=baz --arg SECOND_DOMAIN="boo"
[deblndw013x3j]:
Applying template: sample/top...
[deblndw013x3j]:
baz boo
[deblndw013x3j]: 0

[deblndw013x3j]:
Applying template: sample/bottom...
[deblndw013x3j]:
baz
[deblndw013x3j]: 0

Template applied: sample/bottom

Template applied: sample/top

# bastille template deblndw013x3j sample/top --arg FIRST_DOMAIN=baz --arg SECOND_DOMAIN="boo" --arg SEARCH_DOMAINS="shmoo boo doo"
[deblndw013x3j]:
Applying template: sample/top...
[deblndw013x3j]:
shmoo boo doo
[deblndw013x3j]: 0

[deblndw013x3j]:
Applying template: sample/bottom...
[deblndw013x3j]:
shmoo boo doo
[deblndw013x3j]: 0

Template applied: sample/bottom

Template applied: sample/top

# bastille template deblndw013x3j sample/top --arg FIRST_DOMAIN=baz --arg SECOND_DOMAIN="boo" --arg SEARCH_DOMAINS2="shmoo boo doo"
[deblndw013x3j]:
Applying template: sample/top...
[deblndw013x3j]:
baz boo
[deblndw013x3j]: 0

[deblndw013x3j]:
Applying template: sample/bottom...
[deblndw013x3j]:
baz
[deblndw013x3j]: 0

Template applied: sample/bottom

Template applied: sample/top

As one can see if no SEARCH_DOMAINS is passed the default value has to kick in, but it is incorrectly processed. The passed value is passed through correctly.

[optional] Expected behavior
Pass down default ARG value with spaces

@michael-o michael-o added the bug Something isn't working label Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant