Skip to content

Commit 78f591c

Browse files
committed
simplify to errors.Is
1 parent b415312 commit 78f591c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pkg/controllers/secrets.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,7 @@ func MountSecrets(secrets []byte, mountPath string, maxReads int) (string, func(
236236
break
237237
}
238238
// broken pipe occurs when reader closes pipe before writing completes (eg. with vite dev server)
239-
var errno syscall.Errno
240-
if errors.As(err, &errno) && errno == syscall.EPIPE {
239+
if errors.Is(err, syscall.EPIPE) {
241240
utils.LogDebug("Reader closed pipe before write completed")
242241
_ = f.Close()
243242
continue
@@ -253,8 +252,7 @@ func MountSecrets(secrets []byte, mountPath string, maxReads int) (string, func(
253252
break
254253
}
255254
// broken pipe on close is safe to ignore - the reader has already disconnected
256-
var errno syscall.Errno
257-
if errors.As(err, &errno) && errno == syscall.EPIPE {
255+
if errors.Is(err, syscall.EPIPE) {
258256
utils.LogDebug("Pipe closed by reader")
259257
continue
260258
}

0 commit comments

Comments
 (0)