openshift / cluster-debug-tools

Unsupported tools used to investigate broken clusters.
Apache License 2.0
26 stars 28 forks source link

psa-check panics when run against some clusters #44

Open macarpen opened 3 months ago

macarpen commented 3 months ago

The psa-check tool generally works pretty well when run against clusters in our fleet, however there are two clusters in which it will panic while running the check.

❯ oc dev-tool psa-check -A

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1024bf380]

goroutine 1 [running]:
github.com/openshift/cluster-debug-tools/pkg/cmd/psa.(*PSAOptions).checkNamespacePodSecurity(0x1400026eea0, 0x140005e7a10)
    /Users/username/go/pkg/mod/github.com/openshift/cluster-debug-tools@v0.0.0-20231018150200-f146e69dafdb/pkg/cmd/psa/psa.go:140 +0x3e0
github.com/openshift/cluster-debug-tools/pkg/cmd/psa.(*PSAOptions).Run(0x1400026eea0)
    /Users/username/go/pkg/mod/github.com/openshift/cluster-debug-tools@v0.0.0-20231018150200-f146e69dafdb/pkg/cmd/psa/psa.go:33 +0xe8
github.com/openshift/cluster-debug-tools/pkg/cmd/psa.NewCmdPSA.func1(0x14000148700?, {0x1024c3859?, 0x4?, 0x1024c385d?})
    /Users/username/go/pkg/mod/github.com/openshift/cluster-debug-tools@v0.0.0-20231018150200-f146e69dafdb/pkg/cmd/psa/cmd.go:87 +0xb4
github.com/spf13/cobra.(*Command).execute(0x140004d1b08, {0x140000617a0, 0x1, 0x1})
    /Users/username/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:940 +0x654
github.com/spf13/cobra.(*Command).ExecuteC(0x140004d1808)
    /Users/username/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x320
github.com/spf13/cobra.(*Command).Execute(...)
    /Users/username/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992
main.main()
    /Users/username/go/pkg/mod/github.com/openshift/cluster-debug-tools@v0.0.0-20231018150200-f146e69dafdb/cmd/kubectl-dev_tool/main.go:82 +0xec
openshift-bot commented 1 week ago

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale