> On May 10, 2016, 5:50 p.m., Kevin Klues wrote: > > src/docker/spec.cpp, line 164 > > <https://reviews.apache.org/r/47199/diff/1/?file=1378944#file1378944line164> > > > > Is there always a "config" and a "container_config" (below) in every > > image? If not, won't we error out unnecessarily here? > > Gilbert Song wrote: > I would say yes here, depending on docker image v1 spec. > > And actually in our code base, this assumption has been there for a while: > > https://github.com/apache/mesos/blob/c5bbd5af061a663ba4488a180fede3549e8082fa/src/docker/docker.cpp#L359~#L401 > > Please note that inside config or container_config, some fields should > always have their sections, they can be `JSON::Null` or just `{}` or `[]`, > but some fields are added after v1.0 spec so they may not be included in some > old images.
I step back to think about it. Even though I am sure they should exist, it might be safe to do a check instead of returning an error. Thanks! - Gilbert ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/47199/#review132576 ----------------------------------------------------------- On May 10, 2016, 4:21 p.m., Gilbert Song wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/47199/ > ----------------------------------------------------------- > > (Updated May 10, 2016, 4:21 p.m.) > > > Review request for mesos, Ben Mahler, Artem Harutyunyan, Jie Yu, and Kevin > Klues. > > > Bugs: MESOS-5272 > https://issues.apache.org/jira/browse/MESOS-5272 > > > Repository: mesos > > > Description > ------- > > Implemented parsing docker labels in v1 spec. > > > Diffs > ----- > > src/docker/spec.cpp ac28331a17edb8c2ff81d5a2f79a794f869a3e5d > > Diff: https://reviews.apache.org/r/47199/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Gilbert Song > >
