cluster

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

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

func NewFetcher(kubeconfig, kubecontext string) (*Fetcher, error)

NewFetcher creates a new cluster Fetcher.

func NewFetcherFromClient

func NewFetcherFromClient(client dynamic.Interface) *Fetcher

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

func NewFetcherFromConfig(config *rest.Config) (*Fetcher, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL