base

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualIgnoreHash

func EqualIgnoreHash(template1, template2 *corev1.PodTemplateSpec) bool

EqualIgnoreHash returns true if two given podTemplateSpec are equal, ignoring the diff in value of Labels[pod-template-hash] We ignore pod-template-hash because:

  1. The hash result would be different upon podTemplateSpec API changes (e.g. the addition of a new field will cause the hash code to change)
  2. The deployment template won't have hash labels

func FindNewReplicaSet

func FindNewReplicaSet(d *appsv1.Deployment, rsList []*appsv1.ReplicaSet) *appsv1.ReplicaSet

FindNewReplicaSet returns the new RS this given deployment targets (the one with the same pod template).

func GetNewReplicaSetWithoutRetry

func GetNewReplicaSetWithoutRetry(d *appsv1.Deployment) (*appsv1.ReplicaSet, error)

GetNewReplicaSetWithoutRetry returns the new rs (the one with the same pod template).

func GetPodInCache

func GetPodInCache(ns, name string) (*corev1.Pod, bool, error)

func GetPodsInCache

func GetPodsInCache(ns string, ls labels.Selector) ([]*corev1.Pod, error)

GetPodsInCache gets pods in local cache, if 1. ns is empty, return all pods in all namespace 2. ns is set, but ls is nil, return all pods in namespace 3. both ns and ls are set, return all pods matching ls

func GetReplicaSetsInCache

func GetReplicaSetsInCache(d *appsv1.Deployment) ([]*appsv1.ReplicaSet, error)

Types

type DeploysByCreationTimestamp

type DeploysByCreationTimestamp []*tritonappsv1alpha1.DeployFlow

DeploysByCreationTimestamp sorts a list of Deploy by creation timestamp, using their names as a tie breaker.

func (DeploysByCreationTimestamp) Len

func (DeploysByCreationTimestamp) Less

func (o DeploysByCreationTimestamp) Less(i, j int) bool

func (DeploysByCreationTimestamp) Swap

func (o DeploysByCreationTimestamp) Swap(i, j int)

type PodsByCreationTimestamp

type PodsByCreationTimestamp []*corev1.Pod

ObjectsByCreationTimestamp sorts a list of Pod by creation timestamp, using their names as a tie breaker.

func (PodsByCreationTimestamp) Len

func (o PodsByCreationTimestamp) Len() int

func (PodsByCreationTimestamp) Less

func (o PodsByCreationTimestamp) Less(i, j int) bool

func (PodsByCreationTimestamp) Swap

func (o PodsByCreationTimestamp) Swap(i, j int)

type ReplicaSetsByCreationTimestamp

type ReplicaSetsByCreationTimestamp []*appsv1.ReplicaSet

ReplicaSetsByCreationTimestamp sorts a list of ReplicaSet by creation timestamp, using their names as a tie breaker.

func (ReplicaSetsByCreationTimestamp) Len

func (ReplicaSetsByCreationTimestamp) Less

func (ReplicaSetsByCreationTimestamp) Swap

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

Jump to

Keyboard shortcuts

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