// CreateReplicationControllerList creates paginated list of Replication Controller model
// objects based on Kubernetes Replication Controller objects array and related resources arrays.
CreateReplicationControllerList creates paginated list of Replication Controller model
objects based on Kubernetes Replication Controller objects array and related resources arrays.
// CreateReplicationControllerList creates paginated list of Replication Controller model // objects based on Kubernetes Replication Controller objects array and related resources arrays .
func CreateReplicationControllerList(replicationControllers []api.ReplicationController,
	dsQuery *dataselect.DataSelectQuery, pods []api.Pod, events []api.Event, heapsterClient *heapster.HeapsterClient) *ReplicationControllerList {
	rcList := &ReplicationControllerList{
		ReplicationControllers: make([]ReplicationController, 0),
		ListMeta:               common.ListMeta{TotalItems: len(replicationControllers)},
	}
	cachedResources := &dataselect.CachedResources{
		Pods: pods,
	}
	rcCells, metricPromises := dataselect.GenericDataSelectWithMetrics(toCells(replicationControllers), dsQuery, cachedResources, heapsterClient)
	replicationControllers = fromCells(rcCells)
	for _, rc := range replicationControllers {
		matchingPods := common.FilterPodsByOwnerReference(rc.Namespace, rc.UID, pods)
		podInfo := common.GetPodInfo(rc.Status.Replicas, *rc.Spec.Replicas, matchingPods)
		podInfo.Warnings = event.GetPodsEventWarnings(events, matchingPods)
		replicationController := ToReplicationController(&rc, &podInfo)
		rcList.ReplicationControllers = append(rcList.ReplicationControllers, replicationController)
	}
	cumulativeMetrics, err := metricPromises.GetMetrics()
	rcList.CumulativeMetrics = cumulativeMetrics
	if err != nil {
		rcList.CumulativeMetrics = make([]metric.Metric, 0)
	}
	return rcList
}
func CreateReplicationControllerList ( replicationControllers [ ] api . ReplicationController , dsQuery * dataselect . DataSelectQuery , pods [ ] api . Pod , events [ ] api . Event , heapsterClient * heapster . HeapsterClient ) * ReplicationControllerList { rcList := & ReplicationControllerList { ReplicationControllers : make ( [ ] ReplicationController , 0 ) , ListMeta : common . ListMeta { TotalItems : len ( replicationControllers ) } , } cachedResources := & dataselect . CachedResources { Pods : pods , } rcCells , metricPromises := dataselect . GenericDataSelectWithMetrics ( toCells ( replicationControllers ) , dsQuery , cachedResources , heapsterClient ) replicationControllers = fromCells ( rcCells ) for _ , rc := range replicationControllers { matchingPods := common . FilterPodsByOwnerReference ( rc . Namespace , rc . UID , pods ) podInfo := common . GetPodInfo ( rc . Status . Replicas , * rc . Spec . Replicas , matchingPods ) podInfo . Warnings = event . GetPodsEventWarnings ( events , matchingPods ) replicationController := ToReplicationController ( & rc , & podInfo ) rcList . ReplicationControllers = append ( rcList . ReplicationControllers , replicationController ) } cumulativeMetrics , err := metricPromises . GetMetrics ( ) rcList . CumulativeMetrics = cumulativeMetrics if err != nil { rcList . CumulativeMetrics = make ( [ ] metric . Metric , 0 ) } return rcList }
CreateReplicationControllerList creates paginated list of Replication Controller model
objects based on Kubernetes Replication Controller objects array and related resources arrays.
CreateReplicationControllerList creates paginated list of Replication Controller model objects based on Kubernetes Replication Controller objects array and related resources arrays .