Skip to content

Commit f62c056

Browse files
fix: handle err from utils.HasRoot
1 parent f9231ea commit f62c056

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/pkg/agent/cmd/container_init_linux.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ var (
3434
// If new binary capabilities are set then the returned cmd will be not nil. Note that it is up to caller to invoke
3535
// the returned cmd and spawn an agent instance with all the capabilities.
3636
func initContainer(streams *cli.IOStreams) (shouldExit bool, err error) {
37-
isRoot, _ := utils.HasRoot()
37+
isRoot, err := utils.HasRoot()
38+
if err != nil {
39+
return true, err
40+
}
3841
if !skipFileCapabilities && !isRoot {
3942
executable, err := os.Executable()
4043
if err != nil {

0 commit comments

Comments
 (0)