Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 ¶
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
func (f NilControllerFetcher) FindTopMostWellKnownOrScalable(_ context.Context, _ *ControllerKeyWithAPIVersion) (*ControllerKeyWithAPIVersion, error)
FindTopMostWellKnownOrScalable always returns nil