MCPcopy
hub / github.com/istio/istio / BuildMultiClusterKclientComponent

Function BuildMultiClusterKclientComponent

pkg/kube/multicluster/component.go:202–207  ·  view source on GitHub ↗

BuildMultiClusterKclientComponent builds a simple Component that just wraps a single kclient.Client

(c ComponentBuilder, filter kubetypes.Filter)

Source from the content-addressed store, hash-verified

200
201// BuildMultiClusterKclientComponent builds a simple Component that just wraps a single kclient.Client
202func BuildMultiClusterKclientComponent[T controllers.ComparableObject](c ComponentBuilder, filter kubetypes.Filter) *KclientComponent[T] {
203 res := BuildMultiClusterComponent[kclientInternalComponent[T]](c, func(cluster *Cluster) kclientInternalComponent[T] {
204 return kclientInternalComponent[T]{kclient.NewFiltered[T](cluster.Client, filter)}
205 })
206 return &KclientComponent[T]{res}
207}
208
209// ForCluster returns the client for the requests cluster
210// Note: this may return nil.

Callers 3

TestInjectionFunction · 0.92
NewWebhookFunction · 0.92

Calls 1

Tested by 2

TestInjectionFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…