Skip to content

Commit f8e47e8

Browse files
authored
Merge pull request containerd#3836 from apostasie/fix-idiot
Fix wrong error comparison
2 parents 01c15a7 + a6fe6c1 commit f8e47e8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg/logging/json_logger.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
"github.com/fsnotify/fsnotify"
3232

3333
"github.com/containerd/containerd/v2/core/runtime/v2/logging"
34-
"github.com/containerd/errdefs"
3534
"github.com/containerd/log"
3635

3736
"github.com/containerd/nerdctl/v2/pkg/logging/jsonfile"
@@ -135,7 +134,7 @@ func viewLogsJSONFile(lvopts LogViewOptions, stdout, stderr io.Writer, stopChann
135134
if _, err := os.Stat(logFilePath); err != nil {
136135
// FIXME: this is a workaround for the actual issue, not a real solution
137136
// https://github.com/containerd/nerdctl/issues/3187
138-
if errors.Is(err, errdefs.ErrNotFound) {
137+
if errors.Is(err, os.ErrNotExist) {
139138
log.L.Warnf("Racing log file creation. Pausing briefly.")
140139
time.Sleep(200 * time.Millisecond)
141140
_, err = os.Stat(logFilePath)

0 commit comments

Comments
 (0)