You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[MANDATORY] Describe the bug [MANDATORY]
When a template is applied to a jail and the template contains mandatory args the system just warns and continues. Rendering the process useless.
[MANDATORY] Bastille and FreeBSD version (paste bastille -v && freebsd-version -kru output)
0.8.20210115
12.2-STABLE
12.2-STABLE
12.2-STABLE
[MANDATORY] How did you install bastille? (port/pkg/git)
ports
[optional] Steps to reproduce?
Create a sample Bastillefile
Apply with bastille template mumu lda/root-config and see it fail:
[mumu]:
Applying template: lda/root-config...
No value provided for arg: ROOT_FULLNAME
No value provided for arg: AUTHORIZED_KEYS
No value provided for arg: K5LOGIN
No value provided for arg: FORWARD
[mumu]:
[mumu]:
[mumu]:
/usr/local/bastille/templates/lda/root-config/ -> /usr/local/bastille/jails/mumu/root/root/.ssh
/usr/local/bastille/templates/lda/root-config/Bastillefile -> /usr/local/bastille/jails/mumu/root/root/.ssh/Bastillefile
[mumu]:
cp: /usr/local/bastille/jails/mumu/root/root/.k5login: Not a directory
Failed to execute command: cp
[optional] Expected behavior
I would expect that Bastille for fail if the arg has not been provided and not default value has been set. Since I don't have any IF constructs in this file it does not make sense to continue here.
The text was updated successfully, but these errors were encountered:
michael-o
changed the title
[BUG] Template processing continue although arguments are empty
[BUG] Template processing continue although arguments were not provided
Jun 14, 2021
michael-o
changed the title
[BUG] Template processing continue although arguments were not provided
[BUG] Template processing continues although arguments were not provided
Jun 14, 2021
Just as additional context: we talked about this when the arguments where implemented: #255 (comment).
The reason why it is a warning only is because the feature is inspired by Docker and their documentation says:
If a user specifies a build argument that was not defined in the Dockerfile, the build outputs a warning.
That said, I agree that things could go wrong if the wrong argument is missing…
I see the purpose of consistency, but this inspiration is counterproductive. If your template runs for 30 min and your forget an argument and notice after 28 min, that's a pity. I would appreciate to reconsider arguments to be mandatory. They are arguments, not options after all.
Maybe there is a way to stop the template from further running by failing a CMD?
I tried to realize it with something like this but the template still ran all other commands: CMD [ "${MYARG}" = "" ] && exit 1
Edit: Just checked and Docker seems to be failing a build if a given command returns > 1. So failing a template with this condition would be even more like Docker 😀
[MANDATORY] Describe the bug [MANDATORY]
When a template is applied to a jail and the template contains mandatory args the system just warns and continues. Rendering the process useless.
[MANDATORY] Bastille and FreeBSD version (paste
bastille -v && freebsd-version -kru
output)0.8.20210115
12.2-STABLE
12.2-STABLE
12.2-STABLE
[MANDATORY] How did you install bastille? (port/pkg/git)
ports
[optional] Steps to reproduce?
Create a sample
Bastillefile
Apply with
bastille template mumu lda/root-config
and see it fail:[optional] Expected behavior
I would expect that Bastille for fail if the arg has not been provided and not default value has been set. Since I don't have any IF constructs in this file it does not make sense to continue here.
The text was updated successfully, but these errors were encountered: