You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since commit 58c17f6 (“addr.Suggest should lock a file instead of memory”), pkg/internal/testing/addr/manager.go’s init() function tries to create a directory using either os.UserCacheDir() or os.TempDir(), whichever succeeds first. In many build environments, $HOME is non-empty but points to an unusable directory; in such cases, os.UserCacheDir() returns an unusable directory, which causes init() to panic.
It could instead try os.TempDir(), which is usable in many more scenarios than os.UserCacheDir().
The text was updated successfully, but these errors were encountered:
skitt
added a commit
to skitt/controller-runtime
that referenced
this issue
Feb 10, 2022
Since commit 58c17f6 ("addr.Suggest should lock a file instead of
memory"), pkg/internal/testing/addr/manager.go’s init() function tries
to create a directory using either os.UserCacheDir() or os.TempDir(),
whichever succeeds first. In many build environments, $HOME is
non-empty but points to an unusable directory; in such cases,
os.UserCacheDir() returns an unusable directory, which causes init()
to panic.
This changes init() to first try os.UserCacheDir(), including creating
the desired directory; if that fails, the whole operation is tried
again with os.TempDir().
Fixes: kubernetes-sigs#1799
Signed-off-by: Stephen Kitt <[email protected]>
Since commit 58c17f6 (“addr.Suggest should lock a file instead of memory”),
pkg/internal/testing/addr/manager.go
’sinit()
function tries to create a directory using eitheros.UserCacheDir()
oros.TempDir()
, whichever succeeds first. In many build environments,$HOME
is non-empty but points to an unusable directory; in such cases,os.UserCacheDir()
returns an unusable directory, which causesinit()
to panic.It could instead try
os.TempDir()
, which is usable in many more scenarios thanos.UserCacheDir()
.The text was updated successfully, but these errors were encountered: