// CreateStatefulSetList creates paginated list of Stateful Set model objects based on Kubernetes
// Stateful Set objects array and related resources arrays.
CreateStatefulSetList creates paginated list of Stateful Set model objects based on Kubernetes
Stateful Set objects array and related resources arrays.
// CreateStatefulSetList creates paginated list of Stateful Set model objects based on Kubernetes // Stateful Set objects array and related resources arrays .
func CreateStatefulSetList(statefulSets []apps.StatefulSet, pods []api.Pod, events []api.Event,
	dsQuery *dataselect.DataSelectQuery, heapsterClient *heapster.HeapsterClient) *StatefulSetList {
	statefulSetList := &StatefulSetList{
		StatefulSets: make([]StatefulSet, 0),
		ListMeta:     common.ListMeta{TotalItems: len(statefulSets)},
	}
	cachedResources := &dataselect.CachedResources{
		Pods: pods,
	}
	ssCells, metricPromises := dataselect.GenericDataSelectWithMetrics(toCells(statefulSets), dsQuery, cachedResources, heapsterClient)
	statefulSets = fromCells(ssCells)
	for _, statefulSet := range statefulSets {
		matchingPods := common.FilterPodsByOwnerReference(statefulSet.Namespace,
			statefulSet.UID, pods)
		podInfo := common.GetPodInfo(statefulSet.Status.Replicas,
			*statefulSet.Spec.Replicas, matchingPods)
		podInfo.Warnings = event.GetPodsEventWarnings(events, matchingPods)
		statefulSetList.StatefulSets = append(statefulSetList.StatefulSets,
			ToStatefulSet(&statefulSet, &podInfo))
	}
	cumulativeMetrics, err := metricPromises.GetMetrics()
	statefulSetList.CumulativeMetrics = cumulativeMetrics
	if err != nil {
		statefulSetList.CumulativeMetrics = make([]metric.Metric, 0)
	}
	return statefulSetList
}
func CreateStatefulSetList ( statefulSets [ ] apps . StatefulSet , pods [ ] api . Pod , events [ ] api . Event , dsQuery * dataselect . DataSelectQuery , heapsterClient * heapster . HeapsterClient ) * StatefulSetList { statefulSetList := & StatefulSetList { StatefulSets : make ( [ ] StatefulSet , 0 ) , ListMeta : common . ListMeta { TotalItems : len ( statefulSets ) } , } cachedResources := & dataselect . CachedResources { Pods : pods , } ssCells , metricPromises := dataselect . GenericDataSelectWithMetrics ( toCells ( statefulSets ) , dsQuery , cachedResources , heapsterClient ) statefulSets = fromCells ( ssCells ) for _ , statefulSet := range statefulSets { matchingPods := common . FilterPodsByOwnerReference ( statefulSet . Namespace , statefulSet . UID , pods ) podInfo := common . GetPodInfo ( statefulSet . Status . Replicas , * statefulSet . Spec . Replicas , matchingPods ) podInfo . Warnings = event . GetPodsEventWarnings ( events , matchingPods ) statefulSetList . StatefulSets = append ( statefulSetList . StatefulSets , ToStatefulSet ( & statefulSet , & podInfo ) ) } cumulativeMetrics , err := metricPromises . GetMetrics ( ) statefulSetList . CumulativeMetrics = cumulativeMetrics if err != nil { statefulSetList . CumulativeMetrics = make ( [ ] metric . Metric , 0 ) } return statefulSetList }
CreateStatefulSetList creates paginated list of Stateful Set model objects based on Kubernetes
Stateful Set objects array and related resources arrays.
CreateStatefulSetList creates paginated list of Stateful Set model objects based on Kubernetes Stateful Set objects array and related resources arrays .
// TODO(floreks): Conversion should be omitted when client type will be updated