MCPcopy Create free account
hub / github.com/apache/mesos / validate

Function validate

src/appc/spec.cpp:131–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129
130
131Option<Error> validate(const string& imagePath)
132{
133 Option<Error> validate = validateLayout(imagePath);
134 if (validate.isSome()) {
135 return Error(
136 "Image validation failed for image at '" + imagePath + "': " +
137 validate->message);
138 }
139
140 Try<ImageManifest> manifest = getManifest(imagePath);
141 if (manifest.isError()) {
142 return Error(
143 "Image validation failed for image at '" + imagePath + "': " +
144 manifest.error());
145 }
146
147 validate = validateManifest(manifest.get());
148 if (validate.isSome()) {
149 return Error(
150 "Image validation failed for image at '" + imagePath + "': " +
151 validate->message);
152 }
153
154 validate = validateImageID(Path(imagePath).basename());
155 if (validate.isSome()) {
156 return Error(
157 "Image validation failed for image at '" + imagePath + "': " +
158 validate->message);
159 }
160
161 return None();
162}
163
164} // namespace spec {
165} // namespace appc {

Callers 1

createMethod · 0.50

Calls 12

validateLayoutFunction · 0.85
getManifestFunction · 0.85
validateManifestFunction · 0.85
validateImageIDFunction · 0.85
PathClass · 0.85
NoneClass · 0.85
errorMethod · 0.65
ErrorFunction · 0.50
isSomeMethod · 0.45
isErrorMethod · 0.45
getMethod · 0.45
basenameMethod · 0.45

Tested by

no test coverage detected