Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions cmd/ateom-gvisor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,18 @@ func do(ctx context.Context) error {

// Create ateom dir
ateomDir := ateompath.AteomPath(*podUID)
if err := resources.ValidateAteomUID(*podUID); err != nil {
return fmt.Errorf("in resources.ValidateAteomUID: %w", err)
}
if err := os.MkdirAll(ateomDir, 0o700); err != nil {
return fmt.Errorf("in os.MkdirAll(%q): %w", ateomDir, err)
}
Comment thread
baizhenyu marked this conversation as resolved.
// Clean up the ateom directory during graceful shutdown (#1677).
defer func() {
if err := os.RemoveAll(ateomDir); err != nil {
slog.ErrorContext(ctx, "Failed to remove the ateom directory on shutdown", slog.Any("err", err))
}
}()
Comment thread
BenTheElder marked this conversation as resolved.

// Prepare the pod cgroup so runsc can create per-actor-container leaves under
// it with real accounting.
Expand Down Expand Up @@ -259,8 +268,7 @@ func do(ctx context.Context) error {
go serverboot.StartReadinessServer(ctx, *readinessListenAddress, readiness)

if err := svr.Serve(lis); err != nil {
slog.ErrorContext(ctx, "Failed to serve", slog.Any("err", err))
os.Exit(1)
return fmt.Errorf("while serving: %w", err)
}

return nil
Expand Down
9 changes: 9 additions & 0 deletions cmd/ateom-microvm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,18 @@ func do(ctx context.Context) error {

// Create ateom dir.
ateomDir := ateompath.AteomPath(*podUID)
if err := resources.ValidateAteomUID(*podUID); err != nil {
return fmt.Errorf("in resources.ValidateAteomUID: %w", err)
}
if err := os.MkdirAll(ateomDir, 0o700); err != nil {
return fmt.Errorf("in os.MkdirAll(%q): %w", ateomDir, err)
}
// Clean up the ateom directory during graceful shutdown (#1677).
defer func() {
if err := os.RemoveAll(ateomDir); err != nil {
slog.ErrorContext(ctx, "Failed to remove the ateom directory on shutdown", slog.Any("err", err))
}
}()

// Reap children reparented to us: the detached cloud-hypervisor VMM and
// virtiofsd. Synchronous subprocesses (mount, umount, cp, ...) instead go
Expand Down
Loading