controllerfinder

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerFinder

type ControllerFinder struct {
	client.Client
}

func NewControllerFinder

func NewControllerFinder(c client.Client) *ControllerFinder

func (*ControllerFinder) Finders

func (r *ControllerFinder) Finders() []PodControllerFinder

func (*ControllerFinder) GetPodsForRef

func (r *ControllerFinder) GetPodsForRef(apiVersion, kind, name, ns string, active bool) ([]*corev1.Pod, int32, error)

GetPodsForRef return target workload's podList and spec.replicas.

func (*ControllerFinder) GetScaleAndSelectorForRef

func (r *ControllerFinder) GetScaleAndSelectorForRef(apiVersion, kind, ns, name string, uid types.UID) (*ScaleAndSelector, error)

type ControllerReference

type ControllerReference struct {
	// API version of the referent.
	APIVersion string `json:"apiVersion" protobuf:"bytes,5,opt,name=apiVersion"`
	// Kind of the referent.
	Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"`
	// Name of the referent.
	Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
	// UID of the referent.
	UID types.UID `json:"uid" protobuf:"bytes,4,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"`
}

type PodControllerFinder

type PodControllerFinder func(ref ControllerReference, namespace string) (*ScaleAndSelector, error)

PodControllerFinder is a function type that maps a pod to a list of controllers and their scale.

type ScaleAndSelector

type ScaleAndSelector struct {
	ControllerReference
	// controller.spec.Replicas
	Scale int32
	// controller.spec.Selector
	Selector *metav1.LabelSelector
	// metadata
	Metadata metav1.ObjectMeta
}

ScaleAndSelector is used to return (controller, scale, selector) fields from the controller finder functions.

Jump to

Keyboard shortcuts

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