Documentation ¶
Index ¶
- Variables
- func DoItSlowly(count int, initialBatchSize int, fn func() error) (int, error)
- func GetActivePods(reader client.Reader, opts *client.ListOptions) ([]*v1.Pod, error)
- func GetControllerKey(cs *appsv1alpha1.CloneSet) string
- func GetPersistentVolumeClaims(cs *appsv1alpha1.CloneSet, pod *v1.Pod) map[string]v1.PersistentVolumeClaim
- func GetPodRevision(pod metav1.Object) string
- func GetPodsRevisions(pods []*v1.Pod) sets.String
- func IsRunningAndAvailable(pod *v1.Pod, minReadySeconds int32) bool
- func IsRunningAndReady(pod *v1.Pod) bool
- func NextRevision(revisions []*apps.ControllerRevision) int64
- func SplitPodsByRevision(pods []*v1.Pod, rev string) (matched, unmatched []*v1.Pod)
- func UpdateStorage(cs *appsv1alpha1.CloneSet, pod *v1.Pod)
Constants ¶
This section is empty.
Variables ¶
var ControllerKind = appsv1alpha1.SchemeGroupVersion.WithKind("CloneSet")
ControllerKind is GroupVersionKind for CloneSet.
Functions ¶
func DoItSlowly ¶
DoItSlowly tries to call the provided function a total of 'count' times, starting slow to check for errors, then speeding up if calls succeed.
It groups the calls into batches, starting with a group of initialBatchSize. Within each batch, it may call the function multiple times concurrently.
If a whole batch succeeds, the next batch may get exponentially larger. If there are any failures in a batch, all remaining batches are skipped after waiting for the current batch to complete.
It returns the number of successful calls to the function.
func GetActivePods ¶
GetActivePods returns all active pods in this namespace.
func GetControllerKey ¶
func GetControllerKey(cs *appsv1alpha1.CloneSet) string
GetControllerKey return key of CloneSet.
func GetPersistentVolumeClaims ¶
func GetPersistentVolumeClaims(cs *appsv1alpha1.CloneSet, pod *v1.Pod) map[string]v1.PersistentVolumeClaim
GetPersistentVolumeClaims gets a map of PersistentVolumeClaims to their template names, as defined in set. The returned PersistentVolumeClaims are each constructed with a the name specific to the Pod. This name is determined by getPersistentVolumeClaimName.
func GetPodRevision ¶
GetPodRevision returns revision hash of this pod.
func GetPodsRevisions ¶
GetPodsRevisions return revision hash set of these pods.
func IsRunningAndAvailable ¶
IsRunningAndAvailable returns true if pod is in the PodRunning Phase, if it is available.
func IsRunningAndReady ¶
IsRunningAndReady returns true if pod is in the PodRunning Phase, if it is ready.
func NextRevision ¶
func NextRevision(revisions []*apps.ControllerRevision) int64
NextRevision finds the next valid revision number based on revisions. If the length of revisions is 0 this is 1. Otherwise, it is 1 greater than the largest revision's Revision. This method assumes that revisions has been sorted by Revision.
func SplitPodsByRevision ¶
SplitPodsByRevision returns Pods matched and unmatched the given revision
func UpdateStorage ¶
func UpdateStorage(cs *appsv1alpha1.CloneSet, pod *v1.Pod)
UpdateStorage insert volumes generated by cs.Spec.VolumeClaimTemplates into Pod.
Types ¶
This section is empty.