@@ -22,7 +22,6 @@ import (
22
22
"fmt"
23
23
gb "go/build"
24
24
"io"
25
- "io/ioutil"
26
25
"log"
27
26
"os"
28
27
"os/exec"
@@ -288,7 +287,7 @@ func build(ctx context.Context, ip string, dir string, platform v1.Platform, con
288
287
return "" , fmt .Errorf ("creating KOCACHE bin dir: %w" , err )
289
288
}
290
289
} else {
291
- tmpDir , err = ioutil . TempDir ("" , "ko" )
290
+ tmpDir , err = os . MkdirTemp ("" , "ko" )
292
291
if err != nil {
293
292
return "" , err
294
293
}
@@ -846,7 +845,7 @@ func (g *gobuild) buildOne(ctx context.Context, refStr string, base v1.Image, pl
846
845
}
847
846
dataLayerBytes := dataLayerBuf .Bytes ()
848
847
dataLayer , err := tarball .LayerFromOpener (func () (io.ReadCloser , error ) {
849
- return ioutil .NopCloser (bytes .NewBuffer (dataLayerBytes )), nil
848
+ return io .NopCloser (bytes .NewBuffer (dataLayerBytes )), nil
850
849
}, tarball .WithCompressedCaching , tarball .WithMediaType (layerMediaType ))
851
850
if err != nil {
852
851
return nil , err
@@ -957,7 +956,7 @@ func buildLayer(appPath, file string, platform *v1.Platform, layerMediaType type
957
956
}
958
957
binaryLayerBytes := binaryLayerBuf .Bytes ()
959
958
return tarball .LayerFromOpener (func () (io.ReadCloser , error ) {
960
- return ioutil .NopCloser (bytes .NewBuffer (binaryLayerBytes )), nil
959
+ return io .NopCloser (bytes .NewBuffer (binaryLayerBytes )), nil
961
960
}, tarball .WithCompressedCaching , tarball .WithEstargzOptions (estargz .WithPrioritizedFiles ([]string {
962
961
// When using estargz, prioritize downloading the binary entrypoint.
963
962
appPath ,
0 commit comments