controllerfetcher

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 25 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNodeInvalidOwner = errors.New("node is not a valid owner")

ErrNodeInvalidOwner is thrown when a Pod is owned by a Node.

Functions

func NewControllerFetcher

func NewControllerFetcher(config *rest.Config, kubeClient kube_client.Interface, factory informers.SharedInformerFactory, betweenRefreshes, lifeTime time.Duration, jitterFactor float64) *controllerFetcher

NewControllerFetcher returns a new instance of controllerFetcher

Types

type ControllerFetcher

type ControllerFetcher interface {
	// FindTopMostWellKnownOrScalable returns topmost well-known or scalable controller. Error is returned if controller cannot be found.
	FindTopMostWellKnownOrScalable(ctx context.Context, controller *ControllerKeyWithAPIVersion) (*ControllerKeyWithAPIVersion, error)
}

ControllerFetcher is responsible for finding the topmost well-known or scalable controller

type ControllerKey

type ControllerKey struct {
	Namespace string
	Kind      string
	Name      string
}

ControllerKey identifies a controller.

type ControllerKeyWithAPIVersion

type ControllerKeyWithAPIVersion struct {
	ControllerKey
	ApiVersion string
}

ControllerKeyWithAPIVersion identifies a controller and API it's defined in.

type FakeControllerFetcher

type FakeControllerFetcher struct{}

FakeControllerFetcher should be used in test only. It returns exactly the same controllerKey

func (FakeControllerFetcher) FindTopMostWellKnownOrScalable

func (f FakeControllerFetcher) FindTopMostWellKnownOrScalable(_ context.Context, controller *ControllerKeyWithAPIVersion) (*ControllerKeyWithAPIVersion, error)

FindTopMostWellKnownOrScalable returns the same key for that fake implementation and returns and error when the kind is Node See pkg/target/controller_fetcher/controller_fetcher.go:296 where the original implementation does the same.

type NilControllerFetcher added in v1.3.0

type NilControllerFetcher struct{}

NilControllerFetcher is a fake ControllerFetcher which always returns 'nil'

func (NilControllerFetcher) FindTopMostWellKnownOrScalable added in v1.3.0

FindTopMostWellKnownOrScalable always returns nil

Jump to

Keyboard shortcuts

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