Documentation ¶
Index ¶
- func EqualIgnoreHash(template1, template2 *corev1.PodTemplateSpec) bool
- func FindNewReplicaSet(deployment *appsv1.Deployment, rsList []*appsv1.ReplicaSet) *appsv1.ReplicaSet
- func GetNewReplicaSet(deployment *appsv1.Deployment, f ReplicaSetListFunc) (*appsv1.ReplicaSet, error)
- func ListPodsByRS(deployment *appsv1.Deployment, rsList []*appsv1.ReplicaSet, f PodListFunc) ([]*corev1.Pod, error)
- func ListReplicaSetsByDeployment(deployment *appsv1.Deployment, f ReplicaSetListFunc) ([]*appsv1.ReplicaSet, error)
- type PodListFunc
- type ReplicaSetListFunc
- type ReplicaSetsByCreationTimestamp
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:
- 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)
- The deployment template won't have hash labels
func FindNewReplicaSet ¶
func FindNewReplicaSet(deployment *appsv1.Deployment, rsList []*appsv1.ReplicaSet) *appsv1.ReplicaSet
FindNewReplicaSet returns the new RS this given deployment targets (the one with the same pod template).
func GetNewReplicaSet ¶
func GetNewReplicaSet(deployment *appsv1.Deployment, f ReplicaSetListFunc) (*appsv1.ReplicaSet, error)
GetNewReplicaSet returns a replica set that matches the intent of the given deployment; get ReplicaSetList from client interface. Returns nil if the new replica set doesn't exist yet.
func ListPodsByRS ¶
func ListPodsByRS(deployment *appsv1.Deployment, rsList []*appsv1.ReplicaSet, f PodListFunc) ([]*corev1.Pod, error)
ListPodsByRS returns a list of pods the given deployment targets. This needs a list of ReplicaSets for the Deployment, which can be found with ListReplicaSets(). Note that this does NOT attempt to reconcile ControllerRef (adopt/orphan), because only the controller itself should do that. However, it does filter out anything whose ControllerRef doesn't match.
func ListReplicaSetsByDeployment ¶
func ListReplicaSetsByDeployment(deployment *appsv1.Deployment, f ReplicaSetListFunc) ([]*appsv1.ReplicaSet, error)
ListReplicaSetsByDeployment returns a slice of RSes the given deployment targets. Note that this does NOT attempt to reconcile ControllerRef (adopt/orphan), because only the controller itself should do that. However, it does filter out anything whose ControllerRef doesn't match.
Types ¶
type PodListFunc ¶
PodListFunc returns the Pod slice from the Pod namespace and a selector.
type ReplicaSetListFunc ¶
ReplicaSetListFunc returns the ReplicaSet slice from the ReplicaSet namespace and a selector.
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 (o ReplicaSetsByCreationTimestamp) Len() int
func (ReplicaSetsByCreationTimestamp) Less ¶
func (o ReplicaSetsByCreationTimestamp) Less(i, j int) bool
func (ReplicaSetsByCreationTimestamp) Swap ¶
func (o ReplicaSetsByCreationTimestamp) Swap(i, j int)