| 129 | |
| 130 | |
| 131 | Option<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 { |
no test coverage detected