Skip to content

Commit 11fcb6b

Browse files
committed
Do not obtain task info when it is not necessary in commit command
Signed-off-by: Kebe <[email protected]>
1 parent 88cb67b commit 11fcb6b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/imgutil/commit/commit.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ func Commit(ctx context.Context, client *containerd.Client, container containerd
9494
return emptyDigest, err
9595
}
9696

97-
task, err := container.Task(ctx, cio.Load)
98-
if err != nil {
99-
return emptyDigest, err
100-
}
101-
10297
if opts.Pause {
98+
task, err := container.Task(ctx, cio.Load)
99+
if err != nil {
100+
return emptyDigest, err
101+
}
102+
103103
status, err := task.Status(ctx)
104104
if err != nil {
105105
return emptyDigest, err

0 commit comments

Comments
 (0)