MCPcopy
hub / github.com/kubernetes/kubectl / controlledHistory

Function controlledHistory

pkg/polymorphichelpers/history.go:353–371  ·  view source on GitHub ↗

controlledHistories returns all ControllerRevisions in namespace that selected by selector and owned by accessor

(
	apps clientappsv1.AppsV1Interface,
	namespace string,
	selector labels.Selector,
	accessor metav1.Object)

Source from the content-addressed store, hash-verified

351
352// controlledHistories returns all ControllerRevisions in namespace that selected by selector and owned by accessor
353func controlledHistory(
354 apps clientappsv1.AppsV1Interface,
355 namespace string,
356 selector labels.Selector,
357 accessor metav1.Object) ([]*appsv1.ControllerRevision, error) {
358 var result []*appsv1.ControllerRevision
359 historyList, err := apps.ControllerRevisions(namespace).List(context.TODO(), metav1.ListOptions{LabelSelector: selector.String()})
360 if err != nil {
361 return nil, err
362 }
363 for i := range historyList.Items {
364 history := historyList.Items[i]
365 // Only add history that belongs to the API object
366 if metav1.IsControlledBy(&history, accessor) {
367 result = append(result, &history)
368 }
369 }
370 return result, nil
371}
372
373// daemonSetHistory returns the DaemonSet named name in namespace and all ControllerRevisions in its history.
374func daemonSetHistory(

Callers 1

daemonSetHistoryFunction · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…