Add machine level warning when privileged option is set for run

This commit is contained in:
Brian Cain 2018-04-02 13:23:37 -07:00
parent 3ad4f576c0
commit 693eb2fbbb
No known key found for this signature in database
GPG Key ID: 43D51080D357A001
2 changed files with 7 additions and 0 deletions

View File

@ -149,6 +149,11 @@ module VagrantPlugins
if @run if @run
errorz = @run.validate(machine) errorz = @run.validate(machine)
errors.concat errorz["shell provisioner"] if !errorz.empty? errors.concat errorz["shell provisioner"] if !errorz.empty?
if @run.privileged == true
machine.ui.warn(I18n.t("vagrant.config.triggers.privileged_ignored",
command: @command))
end
end end
if @run_remote if @run_remote

View File

@ -1717,6 +1717,8 @@ en:
only be `:halt` (default) or `:continue`. only be `:halt` (default) or `:continue`.
only_on_bad_type: |- only_on_bad_type: |-
Invalid type found for `only_on`. All values must be a `String` or `Regexp`. Invalid type found for `only_on`. All values must be a `String` or `Regexp`.
privileged_ignored: |-
The `privileged` setting for option `run` for trigger command '%{command}' will be ignored and set to false.
run: run:
bad_type: |- bad_type: |-
Invalid type set for `run` on trigger for command '%{cmd}'. `run` Invalid type set for `run` on trigger for command '%{cmd}'. `run`