[
https://issues.apache.org/jira/browse/MESOS-3340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14741915#comment-14741915
]
Michael Park commented on MESOS-3340:
-------------------------------------
[~marco-mesos] I think it does make sense to prioritize command-line flags over
environment variables.
[~klaus1982] mentioned in the description of his review request that he
implemented it that way since he thinks overwriting may cause confusion for the
user.
I would imagine people typically have {{export MESOS_IP=127.0.0.1}} in their
{{bashrc}} which they use in most cases by default, and provide the
{{--ip=127.168.1.2}} on occasions (e.g. testing) when they want to override it.
Having to change it or having to unset it in order to provide the command line
flag I think would make it more difficult to use.
A similar situation exists in SSL, where flags {{verify_cert}} and
{{require_cert}} can conflict. If {{require_cert = true}} and {{verify_cert =
false}}, rather than causing an error, we simply override the {{verify_cert}}
flag to {{true}} and proceed.
[~klaus1982]: What do you think?
> Command-line flags should take precedence over OS Env variables
> ---------------------------------------------------------------
>
> Key: MESOS-3340
> URL: https://issues.apache.org/jira/browse/MESOS-3340
> Project: Mesos
> Issue Type: Improvement
> Components: stout
> Affects Versions: 0.24.0
> Reporter: Marco Massenzio
> Assignee: Klaus Ma
> Labels: mesosphere, tech-debt
>
> Currently, it appears that re-defining a flag on the command-line that was
> already defined via a OS Env var ({{MESOS_*}}) causes the Master to fail with
> a not very helpful message.
> For example, if one has {{MESOS_QUORUM}} defined, this happens:
> {noformat}
> $ ./mesos-master --zk=zk://192.168.1.4/mesos --quorum=1
> --hostname=192.168.1.4 --ip=192.168.1.4
> Duplicate flag 'quorum' on command line
> {noformat}
> which is not very helpful.
> Ideally, we would parse the flags with a "well-known" priority (command-line
> first, environment last) - but at the very least, the error message should be
> more helpful in explaining what the issue is.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)