Skip to content

Commit

Permalink
Try saving image tarball to system temp directory
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjm committed Jul 28, 2024
1 parent 608336f commit d15a1c5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ loadImage minikubeBinary clusterName minikubeFlags image = do
-- Formerly we would execute a shell with a pipe to direct the tar output directly into "minikube image load".
-- But then "minikube image load" would just write its own tarball in /tmp, like /tmp/build.12345.tar, and
-- leave it there!
withTempDirectory dir "image-tarball" $ \tempDir -> do
withSystemTempDirectory "image-tarball" $ \tempDir -> do
let tarFile = tempDir </> "image.tar"
-- TODO: don't depend on external tar file
createProcessWithLogging (shell [i|tar -C "#{image}" --dereference --hard-dereference --xform s:'^./':: -c . > "#{tarFile}"|])
Expand All @@ -52,7 +52,7 @@ loadImage minikubeBinary clusterName minikubeFlags image = do
imageLoad (toString image)
readImageName (toString image)
".gz" -> do
withTempDirectory dir "image-tarball" $ \tempDir -> do
withSystemTempDirectory "image-tarball" $ \tempDir -> do
let tarFile = tempDir </> "image.tar"
-- TODO: don't depend on external gzip file
createProcessWithLogging (shell [i|cat "#{image}" | gzip -d > "#{tarFile}"|])
Expand Down

0 comments on commit d15a1c5

Please sign in to comment.