daemon/containerd/image_import.go
Method ImageService.ImportImage
has 108 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (i *ImageService) ImportImage(ctx context.Context, ref reference.Named, platform *ocispec.Platform, msg string, layerReader io.Reader, changes []string) (image.ID, error) {
refString := ""
if ref != nil {
refString = ref.String()
}
Method ImageService.ImportImage
has 8 return statements (exceeds 4 allowed). Open
Open
func (i *ImageService) ImportImage(ctx context.Context, ref reference.Named, platform *ocispec.Platform, msg string, layerReader io.Reader, changes []string) (image.ID, error) {
refString := ""
if ref != nil {
refString = ref.String()
}
Function saveArchive
has 7 return statements (exceeds 4 allowed). Open
Open
func saveArchive(ctx context.Context, cs content.Store, layerReader io.Reader) (digest.Digest, digest.Digest, string, error) {
// Wrap the reader in buffered reader to allow peeks.
p := pools.BufioReader32KPool
bufRd := p.Get(layerReader)
defer p.Put(bufRd)
Method ImageService.ImportImage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (i *ImageService) ImportImage(ctx context.Context, ref reference.Named, platform *ocispec.Platform, msg string, layerReader io.Reader, changes []string) (image.ID, error) {
Function compressAndWriteBlob
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func compressAndWriteBlob(ctx context.Context, cs content.Store, compression archive.Compression, mediaType string, uncompressedLayerReader io.Reader) (digest.Digest, digest.Digest, error) {
Function storeJson
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func storeJson(ctx context.Context, cs content.Ingester, mt string, obj interface{}, labels map[string]string) (ocispec.Descriptor, error) {