Skip to content

Commit

Permalink
Change compose lock to use DataStore()
Browse files Browse the repository at this point in the history
Signed-off-by: apostasie <[email protected]>
  • Loading branch information
apostasie committed Oct 17, 2024
1 parent 26a2297 commit 84b4d94
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/cmd/compose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/containerd/platforms"

"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/cmd/volume"
"github.com/containerd/nerdctl/v2/pkg/composer"
"github.com/containerd/nerdctl/v2/pkg/composer/serviceparser"
Expand All @@ -55,7 +56,11 @@ func New(client *containerd.Client, globalOptions types.GlobalCommandOptions, op
// Note that we do not close the lock explicitly. Instead, the lock will get released when the `locked` global
// variable will get collected and the file descriptor closed (eg: when the binary exits).
var err error
locked, err = lockutil.Lock(globalOptions.DataRoot)
dataStore, err := clientutil.DataStore(globalOptions.DataRoot, globalOptions.Address)
if err != nil {
return nil, err
}
locked, err = lockutil.Lock(dataStore)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 84b4d94

Please sign in to comment.