Ver código fonte

Merge pull request #26186 from ywk253100/master

Fixes #25654, a bug in implements of loading image
Brian Goff 8 anos atrás
pai
commit
7776a0ebd7
1 arquivos alterados com 2 adições e 5 exclusões
  1. 2 5
      image/tarexport/load.go

+ 2 - 5
image/tarexport/load.go

@@ -52,7 +52,7 @@ func (l *tarexporter) Load(inTar io.ReadCloser, outStream io.Writer, quiet bool)
 		if os.IsNotExist(err) {
 			return l.legacyLoad(tmpDir, outStream, progressOutput)
 		}
-		return manifestFile.Close()
+		return err
 	}
 	defer manifestFile.Close()
 
@@ -230,10 +230,7 @@ func (l *tarexporter) legacyLoad(tmpDir string, outStream io.Writer, progressOut
 	}
 	repositoriesFile, err := os.Open(repositoriesPath)
 	if err != nil {
-		if !os.IsNotExist(err) {
-			return err
-		}
-		return repositoriesFile.Close()
+		return err
 	}
 	defer repositoriesFile.Close()