lava commented on a change in pull request #326: MESOS-6874: Validate the match
between Type and *Infos in the ContainerInfo.
URL: https://github.com/apache/mesos/pull/326#discussion_r264618371
##########
File path: src/slave/containerizer/composing.cpp
##########
@@ -425,6 +425,28 @@ Future<Containerizer::LaunchResult>
ComposingContainerizerProcess::_launch(
}
+static Try<Nothing> validateContainerInfoType(const ContainerInfo& info)
+{
+ const auto* typeDescriptor = ContainerInfo::Type_descriptor();
+ const auto* infoDescriptor = ContainerInfo::descriptor();
+ for (int index = 0; index < typeDescriptor->value_count(); index++) {
+ const auto* typeValueDescriptor = typeDescriptor->value(index);
+ const auto* infoValueDescriptor = infoDescriptor->FindFieldByName(
+ strings::lower(typeValueDescriptor->name()));
Review comment:
In general, we use 2-space indent but for function continuation it's 4
spaces:
https://google.github.io/styleguide/cppguide.html#Function_Declarations_and_Definitions
(the same comment applies for all the other indentation below)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services