Skip to content

Commit 84b4d94

Browse files
committed
Change compose lock to use DataStore()
Signed-off-by: apostasie <[email protected]>
1 parent 26a2297 commit 84b4d94

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/cmd/compose/compose.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030
"github.com/containerd/platforms"
3131

3232
"github.com/containerd/nerdctl/v2/pkg/api/types"
33+
"github.com/containerd/nerdctl/v2/pkg/clientutil"
3334
"github.com/containerd/nerdctl/v2/pkg/cmd/volume"
3435
"github.com/containerd/nerdctl/v2/pkg/composer"
3536
"github.com/containerd/nerdctl/v2/pkg/composer/serviceparser"
@@ -55,7 +56,11 @@ func New(client *containerd.Client, globalOptions types.GlobalCommandOptions, op
5556
// Note that we do not close the lock explicitly. Instead, the lock will get released when the `locked` global
5657
// variable will get collected and the file descriptor closed (eg: when the binary exits).
5758
var err error
58-
locked, err = lockutil.Lock(globalOptions.DataRoot)
59+
dataStore, err := clientutil.DataStore(globalOptions.DataRoot, globalOptions.Address)
60+
if err != nil {
61+
return nil, err
62+
}
63+
locked, err = lockutil.Lock(dataStore)
5964
if err != nil {
6065
return nil, err
6166
}

0 commit comments

Comments
 (0)