> On March 23, 2017, 12:51 a.m., Adam B wrote: > > src/slave/containerizer/mesos/launch.cpp > > Line 669 (original), 667 (patched) > > <https://reviews.apache.org/r/57763/diff/1/?file=1668097#file1668097line669> > > > > Also, it seems unnecessary to (re)assign `value` to `environment[name]` > > if it already has that value. So far, you have only changed the conditions > > under which we log. Perhaps something more like: > > ``` > > if (!environment.contains(name) { > > environment[name] = value; > > } else if (environment[name] != value) { > > cout << "Overwriting..."; // TODO: Make this an error? > > environment[name] = value; > > } // else silently ignore the dupe. > > ```
The problem is, what consider a duplicate: same name or same name and type? Until after we figure out how to merge envs with secrets, it is defensive not to change the behaviour now and continue overriding. - Alexander ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/57763/#review169816 ----------------------------------------------------------- On March 20, 2017, 2:51 a.m., Till Toenshoff wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/57763/ > ----------------------------------------------------------- > > (Updated March 20, 2017, 2:51 a.m.) > > > Review request for mesos, Adam B, Alexander Rukletsov, Benjamin Bannier, Jie > Yu, and Joseph Wu. > > > Bugs: MESOS-7264 > https://issues.apache.org/jira/browse/MESOS-7264 > > > Repository: mesos > > > Description > ------- > > See summary. > > > Diffs > ----- > > src/slave/containerizer/mesos/launch.cpp > 8658525b00e78bed9227d6d400eccccae2cf25dd > > > Diff: https://reviews.apache.org/r/57763/diff/2/ > > > Testing > ------- > > make check & functional testing... > > ``` > ./src/mesos-execute --name="test" --env='{"key1":"value1"}' --command='sleep > 1000' --master=127.0.0.1:5050 > ``` > > Within the contents of `stdout` before applying this: > ``` > Overwriting environment variable 'key1', original: 'value1', new: 'value1' > ``` > > After applying this there is no mention of the actually duplicate but equally > valued variable anymore. Note, this is before applying > https://reviews.apache.org/r/57762. > > > Thanks, > > Till Toenshoff > >
