mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Added MkdirAll capabilities for Checkpoint's image-path.
Now able to save the state file (checkpoint.img) at an image-path that had previously not existed. This is important because there can only be one checkpoint.img file per directory so this will enable users to create as many directories as needed for proper organization. PiperOrigin-RevId: 202360414 Change-Id: If5dd2b72e08ab52834a2b605571186d107b64526
This commit is contained in:
committed by
Shentubot
parent
c186e408cc
commit
f93043615f
@@ -81,6 +81,10 @@ func (c *Checkpoint) Execute(_ context.Context, f *flag.FlagSet, args ...interfa
|
||||
Fatalf("image-path flag must be provided")
|
||||
}
|
||||
|
||||
if err := os.MkdirAll(c.imagePath, 0755); err != nil {
|
||||
Fatalf("error making directories at path provided: %v", err)
|
||||
}
|
||||
|
||||
fullImagePath := filepath.Join(c.imagePath, checkpointFileName)
|
||||
|
||||
// Create the image file and open for writing.
|
||||
|
||||
Reference in New Issue
Block a user