We are using siegfried as library in other go projects.
Since a recent update there is an error on miminalistic docker files (no home directory etc.) on kubernetes.
2024/03/28 10:25:26 stat /dev/null/siegfried: not a directory
Last version which was tested ok is v1.10.1.
From our point of view, this error occurs within an init() function.
We think, it could be
|
if _, err := os.Stat(siegfried.home); err != nil { |
If homedirectory points to /dev/null, this line tries to os.Stat("/dev/null/siegfried").
After that, the error is not known and log.Fatal(err) in
happens.
This error occurs even if we do not use any functionality from siegfried. Using a library which uses siegfried is enough.
Is there a way to make sure, that init() function cannot result in a fatal() or panic()?
It's quite hard to debug the minimalistic docker image, since it has no delve on it.
We are using siegfried as library in other go projects.
Since a recent update there is an error on miminalistic docker files (no home directory etc.) on kubernetes.
2024/03/28 10:25:26 stat /dev/null/siegfried: not a directoryLast version which was tested ok is v1.10.1.
From our point of view, this error occurs within an init() function.
We think, it could be
siegfried/pkg/config/default.go
Line 40 in aa72ecc
If homedirectory points to /dev/null, this line tries to
os.Stat("/dev/null/siegfried").After that, the error is not known and
log.Fatal(err)insiegfried/pkg/config/default.go
Line 44 in aa72ecc
happens.
This error occurs even if we do not use any functionality from siegfried. Using a library which uses siegfried is enough.
Is there a way to make sure, that
init()function cannot result in afatal()orpanic()?It's quite hard to debug the minimalistic docker image, since it has no delve on it.