Merge pull request #4250 from thaJeztah/tininits

tini nits
This commit is contained in:
Sebastiaan van Stijn 2023-05-16 18:13:24 +01:00 committed by GitHub
commit 8794455dc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -87,7 +87,7 @@ func (h *hijackedIOStreamer) setupInput() (restore func(), err error) {
var restoreOnce sync.Once
restore = func() {
restoreOnce.Do(func() {
restoreTerminal(h.streams, h.inputStream)
_ = restoreTerminal(h.streams, h.inputStream)
})
}

View File

@ -161,13 +161,13 @@ func GetContextFromReader(rc io.ReadCloser, dockerfileName string) (out io.ReadC
return nil, "", err
}
tar, err := archive.Tar(dockerfileDir, archive.Uncompressed)
tarArchive, err := archive.Tar(dockerfileDir, archive.Uncompressed)
if err != nil {
return nil, "", err
}
return ioutils.NewReadCloserWrapper(tar, func() error {
err := tar.Close()
return ioutils.NewReadCloserWrapper(tarArchive, func() error {
err := tarArchive.Close()
os.RemoveAll(dockerfileDir)
return err
}), DefaultDockerfileName, nil
@ -432,8 +432,7 @@ func Compress(buildCtx io.ReadCloser) (io.ReadCloser, error) {
defer buildCtx.Close()
if _, err := pools.Copy(compressWriter, buildCtx); err != nil {
pipeWriter.CloseWithError(
errors.Wrap(err, "failed to compress context"))
pipeWriter.CloseWithError(errors.Wrap(err, "failed to compress context"))
compressWriter.Close()
return
}