As discussed [here](https://github.com/aquasecurity/trivy/pull/7690#discussion_r1805663259) we should improve the testing for the k8s scanner as it is short on coverage. As part of this we could also look into refactoring the scanner a bit.