@@ -22,6 +22,7 @@ import (
22
22
"strings"
23
23
"time"
24
24
25
+ cnquery_k8s "go.mondoo.com/cnquery/v11/providers/k8s/resources"
25
26
"go.mondoo.com/mondoo-operator/api/v1alpha2"
26
27
api "go.mondoo.com/mondoo-operator/api/v1alpha2"
27
28
"go.mondoo.com/mondoo-operator/pkg/utils/k8s"
@@ -754,6 +755,9 @@ func (k8sh *K8sHelper) GetWorkloadNames(ctx context.Context) ([]string, error) {
754
755
}
755
756
756
757
for _ , w := range pods .Items {
758
+ if cnquery_k8s .PodOwnerReferencesFilter (w .GetOwnerReferences ()) {
759
+ continue
760
+ }
757
761
names = append (names , fmt .Sprintf ("%s/%s" , w .GetNamespace (), w .GetName ()))
758
762
}
759
763
@@ -763,6 +767,9 @@ func (k8sh *K8sHelper) GetWorkloadNames(ctx context.Context) ([]string, error) {
763
767
}
764
768
765
769
for _ , w := range jobs .Items {
770
+ if cnquery_k8s .JobOwnerReferencesFilter (w .GetOwnerReferences ()) {
771
+ continue
772
+ }
766
773
names = append (names , fmt .Sprintf ("%s/%s" , w .Namespace , w .Name ))
767
774
}
768
775
@@ -813,6 +820,9 @@ func (k8sh *K8sHelper) GetWorkloadNames(ctx context.Context) ([]string, error) {
813
820
}
814
821
815
822
for _ , w := range replicasets .Items {
823
+ if cnquery_k8s .ReplicaSetOwnerReferencesFilter (w .GetOwnerReferences ()) {
824
+ continue
825
+ }
816
826
names = append (names , fmt .Sprintf ("%s/%s" , w .Namespace , w .Name ))
817
827
}
818
828
0 commit comments