Skip to content

Commit

Permalink
k8s cluster auto discovery (#2052)
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
  • Loading branch information
imilchev authored Oct 3, 2023
1 parent 1e9dee0 commit f367d03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions providers/k8s/resources/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"go.mondoo.com/cnquery/providers/k8s/connection/shared"
"go.mondoo.com/cnquery/providers/k8s/connection/shared/resources"
"go.mondoo.com/cnquery/types"
"golang.org/x/exp/slices"
"go.mondoo.com/cnquery/utils/stringx"
admissionv1 "k8s.io/api/admission/v1"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -125,7 +125,7 @@ func Discover(runtime *plugin.Runtime) (*inventory.Inventory, error) {
Platform: conn.Platform(),
Connections: []*inventory.Config{invConfig.Clone(inventory.WithoutDiscovery())}, // pass-in the parent connection config
}
if slices.Contains(invConfig.Discover.Targets, DiscoveryClusters) {
if stringx.ContainsAnyOf(invConfig.Discover.Targets, DiscoveryAuto, DiscoveryClusters) {
in.Spec.Assets = append(in.Spec.Assets, root)
}

Expand Down

0 comments on commit f367d03

Please sign in to comment.