kubernetes/pkg/controller/controller_utils.go

const ExpectationsTimeout

const SlowStartInitialBatchSize

var UpdateTaintBackoff

var UpdateLabelBackoff

var KeyFunc

var podPhaseToOrdinal

type ResyncPeriodFunc

// Returns 0 for resyncPeriod in case resyncing is not needed.
func NoResyncPeriodFunc() time.Duration {}

// StaticResyncPeriodFunc returns the resync period specified
func StaticResyncPeriodFunc(resyncPeriod time.Duration) ResyncPeriodFunc {}

var ExpKeyFunc

type ControllerExpectationsInterface

type ControllerExpectations

// GetExpectations returns the ControlleeExpectations of the given controller.
func (r *ControllerExpectations) GetExpectations(controllerKey string) (*ControlleeExpectations, bool, error) {}

// DeleteExpectations deletes the expectations of the given controller from the TTLStore.
func (r *ControllerExpectations) DeleteExpectations(logger klog.Logger, controllerKey string) {}

// SatisfiedExpectations returns true if the required adds/dels for the given controller have been observed.
// Add/del counts are established by the controller at sync time, and updated as controllees are observed by the controller
// manager.
func (r *ControllerExpectations) SatisfiedExpectations(logger klog.Logger, controllerKey string) bool {}

// TODO: Extend ExpirationCache to support explicit expiration.
// TODO: Make this possible to disable in tests.
// TODO: Support injection of clock.
func (exp *ControlleeExpectations) isExpired() bool {}

// SetExpectations registers new expectations for the given controller. Forgets existing expectations.
func (r *ControllerExpectations) SetExpectations(logger klog.Logger, controllerKey string, add, del int) error {}

func (r *ControllerExpectations) ExpectCreations(logger klog.Logger, controllerKey string, adds int) error {}

func (r *ControllerExpectations) ExpectDeletions(logger klog.Logger, controllerKey string, dels int) error {}

// Decrements the expectation counts of the given controller.
func (r *ControllerExpectations) LowerExpectations(logger klog.Logger, controllerKey string, add, del int) {}

// Increments the expectation counts of the given controller.
func (r *ControllerExpectations) RaiseExpectations(logger klog.Logger, controllerKey string, add, del int) {}

// CreationObserved atomically decrements the `add` expectation count of the given controller.
func (r *ControllerExpectations) CreationObserved(logger klog.Logger, controllerKey string) {}

// DeletionObserved atomically decrements the `del` expectation count of the given controller.
func (r *ControllerExpectations) DeletionObserved(logger klog.Logger, controllerKey string) {}

type ControlleeExpectations

// Add increments the add and del counters.
func (e *ControlleeExpectations) Add(add, del int64) {}

// Fulfilled returns true if this expectation has been fulfilled.
func (e *ControlleeExpectations) Fulfilled() bool {}

// GetExpectations returns the add and del expectations of the controllee.
func (e *ControlleeExpectations) GetExpectations() (int64, int64) {}

// MarshalLog makes a thread-safe copy of the values of the expectations that
// can be used for logging.
func (e *ControlleeExpectations) MarshalLog() interface{}

// NewControllerExpectations returns a store for ControllerExpectations.
func NewControllerExpectations() *ControllerExpectations {}

var UIDSetKeyFunc

type UIDSet

type UIDTrackingControllerExpectations

// GetUIDs is a convenience method to avoid exposing the set of expected uids.
// The returned set is not thread safe, all modifications must be made holding
// the uidStoreLock.
func (u *UIDTrackingControllerExpectations) GetUIDs(controllerKey string) sets.String {}

// ExpectDeletions records expectations for the given deleteKeys, against the given controller.
func (u *UIDTrackingControllerExpectations) ExpectDeletions(logger klog.Logger, rcKey string, deletedKeys []string) error {}

// DeletionObserved records the given deleteKey as a deletion, for the given rc.
func (u *UIDTrackingControllerExpectations) DeletionObserved(logger klog.Logger, rcKey, deleteKey string) {}

// DeleteExpectations deletes the UID set and invokes DeleteExpectations on the
// underlying ControllerExpectationsInterface.
func (u *UIDTrackingControllerExpectations) DeleteExpectations(logger klog.Logger, rcKey string) {}

// NewUIDTrackingControllerExpectations returns a wrapper around
// ControllerExpectations that is aware of deleteKeys.
func NewUIDTrackingControllerExpectations(ce ControllerExpectationsInterface) *UIDTrackingControllerExpectations {}

const FailedCreatePodReason

const SuccessfulCreatePodReason

const FailedDeletePodReason

const SuccessfulDeletePodReason

type RSControlInterface

type RealRSControl

var _

func (r RealRSControl) PatchReplicaSet(ctx context.Context, namespace, name string, data []byte) error {}

type ControllerRevisionControlInterface

type RealControllerRevisionControl

var _

func (r RealControllerRevisionControl) PatchControllerRevision(ctx context.Context, namespace, name string, data []byte) error {}

type PodControlInterface

type RealPodControl

var _

func getPodsLabelSet(template *v1.PodTemplateSpec) labels.Set {}

func getPodsFinalizers(template *v1.PodTemplateSpec) []string {}

func getPodsAnnotationSet(template *v1.PodTemplateSpec) labels.Set {}

func getPodsPrefix(controllerName string) string {}

func validateControllerRef(controllerRef *metav1.OwnerReference) error {}

func (r RealPodControl) CreatePods(ctx context.Context, namespace string, template *v1.PodTemplateSpec, controllerObject runtime.Object, controllerRef *metav1.OwnerReference) error {}

func (r RealPodControl) CreatePodsWithGenerateName(ctx context.Context, namespace string, template *v1.PodTemplateSpec, controllerObject runtime.Object, controllerRef *metav1.OwnerReference, generateName string) error {}

func (r RealPodControl) PatchPod(ctx context.Context, namespace, name string, data []byte) error {}

func GetPodFromTemplate(template *v1.PodTemplateSpec, parentObject runtime.Object, controllerRef *metav1.OwnerReference) (*v1.Pod, error) {}

func (r RealPodControl) createPods(ctx context.Context, namespace string, pod *v1.Pod, object runtime.Object) error {}

func (r RealPodControl) DeletePod(ctx context.Context, namespace string, podID string, object runtime.Object) error {}

type FakePodControl

var _

func (f *FakePodControl) PatchPod(ctx context.Context, namespace, name string, data []byte) error {}

func (f *FakePodControl) CreatePods(ctx context.Context, namespace string, spec *v1.PodTemplateSpec, object runtime.Object, controllerRef *metav1.OwnerReference) error {}

func (f *FakePodControl) CreatePodsWithGenerateName(ctx context.Context, namespace string, spec *v1.PodTemplateSpec, object runtime.Object, controllerRef *metav1.OwnerReference, generateNamePrefix string) error {}

func (f *FakePodControl) DeletePod(ctx context.Context, namespace string, podID string, object runtime.Object) error {}

func (f *FakePodControl) Clear() {}

type ByLogging

func (s ByLogging) Len() int      {}

func (s ByLogging) Swap(i, j int) {}

func (s ByLogging) Less(i, j int) bool {}

type ActivePods

func (s ActivePods) Len() int      {}

func (s ActivePods) Swap(i, j int) {}

func (s ActivePods) Less(i, j int) bool {}

type ActivePodsWithRanks

func (s ActivePodsWithRanks) Len() int {}

func (s ActivePodsWithRanks) Swap(i, j int) {}

// Less compares two pods with corresponding ranks and returns true if the first
// one should be preferred for deletion.
func (s ActivePodsWithRanks) Less(i, j int) bool {}

// afterOrZero checks if time t1 is after time t2; if one of them
// is zero, the zero time is seen as after non-zero time.
func afterOrZero(t1, t2 *metav1.Time) bool {}

// logarithmicRankDiff calculates the base-2 logarithmic ranks of 2 timestamps,
// compared to the current timestamp
func logarithmicRankDiff(t1, t2, now metav1.Time) int64 {}

func podReadyTime(pod *v1.Pod) *metav1.Time {}

func maxContainerRestarts(pod *v1.Pod) int {}

// FilterActivePods returns pods that have not terminated.
func FilterActivePods(logger klog.Logger, pods []*v1.Pod) []*v1.Pod {}

func FilterTerminatingPods(pods []*v1.Pod) []*v1.Pod {}

func CountTerminatingPods(pods []*v1.Pod) int32 {}

func IsPodActive(p *v1.Pod) bool {}

func IsPodTerminating(p *v1.Pod) bool {}

// FilterActiveReplicaSets returns replica sets that have (or at least ought to have) pods.
func FilterActiveReplicaSets(replicaSets []*apps.ReplicaSet) []*apps.ReplicaSet {}

type filterRS

// FilterReplicaSets returns replica sets that are filtered by filterFn (all returned ones should match filterFn).
func FilterReplicaSets(RSes []*apps.ReplicaSet, filterFn filterRS) []*apps.ReplicaSet {}

// PodKey returns a key unique to the given pod within a cluster.
// It's used so we consistently use the same key scheme in this module.
// It does exactly what cache.MetaNamespaceKeyFunc would have done
// except there's not possibility for error since we know the exact type.
func PodKey(pod *v1.Pod) string {}

type ControllersByCreationTimestamp

func (o ControllersByCreationTimestamp) Len() int      {}

func (o ControllersByCreationTimestamp) Swap(i, j int) {}

func (o ControllersByCreationTimestamp) Less(i, j int) bool {}

type ReplicaSetsByCreationTimestamp

func (o ReplicaSetsByCreationTimestamp) Len() int      {}

func (o ReplicaSetsByCreationTimestamp) Swap(i, j int) {}

func (o ReplicaSetsByCreationTimestamp) Less(i, j int) bool {}

type ReplicaSetsBySizeOlder

func (o ReplicaSetsBySizeOlder) Len() int      {}

func (o ReplicaSetsBySizeOlder) Swap(i, j int) {}

func (o ReplicaSetsBySizeOlder) Less(i, j int) bool {}

type ReplicaSetsBySizeNewer

func (o ReplicaSetsBySizeNewer) Len() int      {}

func (o ReplicaSetsBySizeNewer) Swap(i, j int) {}

func (o ReplicaSetsBySizeNewer) Less(i, j int) bool {}

// AddOrUpdateTaintOnNode add taints to the node. If taint was added into node, it'll issue API calls
// to update nodes; otherwise, no API calls. Return error if any.
func AddOrUpdateTaintOnNode(ctx context.Context, c clientset.Interface, nodeName string, taints ...*v1.Taint) error {}

// RemoveTaintOffNode is for cleaning up taints temporarily added to node,
// won't fail if target taint doesn't exist or has been removed.
// If passed a node it'll check if there's anything to be done, if taint is not present it won't issue
// any API calls.
func RemoveTaintOffNode(ctx context.Context, c clientset.Interface, nodeName string, node *v1.Node, taints ...*v1.Taint) error {}

// PatchNodeTaints patches node's taints.
func PatchNodeTaints(ctx context.Context, c clientset.Interface, nodeName string, oldNode *v1.Node, newNode *v1.Node) error {}

// ComputeHash returns a hash value calculated from pod template and
// a collisionCount to avoid hash collision. The hash will be safe encoded to
// avoid bad words.
func ComputeHash(template *v1.PodTemplateSpec, collisionCount *int32) string {}

func AddOrUpdateLabelsOnNode(kubeClient clientset.Interface, nodeName string, labelsToUpdate map[string]string) error {}