Skip to content

Commit

Permalink
Fix pebble Containerd path (#874)
Browse files Browse the repository at this point in the history
  • Loading branch information
HomayoonAlimohammadi authored Dec 6, 2024
1 parent 9536f34 commit a181d4c
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/k8s/pkg/snap/pebble.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import (
)

type PebbleOpts struct {
SnapDir string
SnapCommonDir string
RunCommand func(ctx context.Context, command []string, opts ...func(c *exec.Cmd)) error
SnapDir string
SnapCommonDir string
RunCommand func(ctx context.Context, command []string, opts ...func(c *exec.Cmd)) error
ContainerdBaseDir string
}

// pebble implements the Snap interface.
Expand All @@ -38,6 +39,15 @@ func NewPebble(opts PebbleOpts) *pebble {
},
}

containerdBaseDir := opts.ContainerdBaseDir
if containerdBaseDir == "" {
containerdBaseDir = "/"
if s.Strict() {
containerdBaseDir = opts.SnapCommonDir
}
}
s.containerdBaseDir = containerdBaseDir

return s
}

Expand Down

0 comments on commit a181d4c

Please sign in to comment.