we validate the actual fields of the FileDescriptorProtos as part of newImageFile
(protoImage *imagev1.Image)
| 23 | |
| 24 | // we validate the actual fields of the FileDescriptorProtos as part of newImageFile |
| 25 | func validateProtoImage(protoImage *imagev1.Image) error { |
| 26 | if protoImage == nil { |
| 27 | return errors.New("nil Image") |
| 28 | } |
| 29 | if len(protoImage.GetFile()) == 0 { |
| 30 | return errors.New("image contains no files") |
| 31 | } |
| 32 | for _, protoImageFile := range protoImage.GetFile() { |
| 33 | if err := validateProtoImageFile(protoImageFile); err != nil { |
| 34 | return err |
| 35 | } |
| 36 | } |
| 37 | return nil |
| 38 | } |
| 39 | |
| 40 | func validateProtoImageFile(protoImageFile *imagev1.ImageFile) error { |
| 41 | if protoImageFileExtension := protoImageFile.GetBufExtension(); protoImageFileExtension != nil { |
no test coverage detected
searching dependent graphs…