Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
Fetcher retrieves resources from a Kubernetes cluster.
func NewFetcher ¶
NewFetcher creates a new cluster Fetcher.
func NewFetcherFromClient ¶
NewFetcherFromClient creates a Fetcher from an existing dynamic client. Useful for tests and for consumers that build a dynamic client themselves. The client must be non-nil; a nil client defers failure to the first Get call.
func NewFetcherFromConfig ¶
NewFetcherFromConfig creates a new cluster Fetcher from an existing *rest.Config. This is the entry point for in-cluster consumers such as a controller-runtime manager, which already hold a REST config and should not go through kubeconfig file loading.
func (*Fetcher) Get ¶
func (f *Fetcher) Get(ctx context.Context, apiVersion, kind, namespace, name string) (*unstructured.Unstructured, error)
Get retrieves a single resource from the cluster.
type ResourceFetcher ¶
type ResourceFetcher interface {
Get(ctx context.Context, apiVersion, kind, namespace, name string) (*unstructured.Unstructured, error)
}
ResourceFetcher is the interface for retrieving resources from a Kubernetes cluster.