// CreateDeploymentList returns a list of all Deployment model objects in the cluster, based on all
// Kubernetes Deployment API objects.
CreateDeploymentList returns a list of all Deployment model objects in the cluster, based on all
Kubernetes Deployment API objects.
// CreateDeploymentList returns a list of all Deployment model objects in the cluster based on all // Kubernetes Deployment API objects .
func CreateDeploymentList(deployments []extensions.Deployment, pods []api.Pod, events []api.Event,
	rs []extensions.ReplicaSet, dsQuery *dataselect.DataSelectQuery,
	heapsterClient *heapster.HeapsterClient) *DeploymentList {
	deploymentList := &DeploymentList{
		Deployments: make([]Deployment, 0),
		ListMeta:    common.ListMeta{TotalItems: len(deployments)},
	}
	cachedResources := &dataselect.CachedResources{
		Pods: pods,
	}
	deploymentCells, metricPromises := dataselect.GenericDataSelectWithMetrics(toCells(deployments), dsQuery, cachedResources, heapsterClient)
	deployments = fromCells(deploymentCells)
	for _, deployment := range deployments {
		matchingPods := common.FilterDeploymentPodsByOwnerReference(deployment, rs, pods)
		podInfo := common.GetPodInfo(deployment.Status.Replicas, *deployment.Spec.Replicas,
			matchingPods)
		podInfo.Warnings = event.GetPodsEventWarnings(events, matchingPods)
		deploymentList.Deployments = append(deploymentList.Deployments,
			Deployment{
				ObjectMeta:      common.NewObjectMeta(deployment.ObjectMeta),
				TypeMeta:        common.NewTypeMeta(common.ResourceKindDeployment),
				ContainerImages: common.GetContainerImages(&deployment.Spec.Template.Spec),
				Pods:            podInfo,
			})
	}
	cumulativeMetrics, err := metricPromises.GetMetrics()
	deploymentList.CumulativeMetrics = cumulativeMetrics
	if err != nil {
		deploymentList.CumulativeMetrics = make([]metric.Metric, 0)
	}
	return deploymentList
}
func CreateDeploymentList ( deployments [ ] extensions . Deployment , pods [ ] api . Pod , events [ ] api . Event , rs [ ] extensions . ReplicaSet , dsQuery * dataselect . DataSelectQuery , heapsterClient * heapster . HeapsterClient ) * DeploymentList { deploymentList := & DeploymentList { Deployments : make ( [ ] Deployment , 0 ) , ListMeta : common . ListMeta { TotalItems : len ( deployments ) } , } cachedResources := & dataselect . CachedResources { Pods : pods , } deploymentCells , metricPromises := dataselect . GenericDataSelectWithMetrics ( toCells ( deployments ) , dsQuery , cachedResources , heapsterClient ) deployments = fromCells ( deploymentCells ) for _ , deployment := range deployments { matchingPods := common . FilterDeploymentPodsByOwnerReference ( deployment , rs , pods ) podInfo := common . GetPodInfo ( deployment . Status . Replicas , * deployment . Spec . Replicas , matchingPods ) podInfo . Warnings = event . GetPodsEventWarnings ( events , matchingPods ) deploymentList . Deployments = append ( deploymentList . Deployments , Deployment { ObjectMeta : common . NewObjectMeta ( deployment . ObjectMeta ) , TypeMeta : common . NewTypeMeta ( common . ResourceKindDeployment ) , ContainerImages : common . GetContainerImages ( & deployment . Spec . Template . Spec ) , Pods : podInfo , } ) } cumulativeMetrics , err := metricPromises . GetMetrics ( ) deploymentList . CumulativeMetrics = cumulativeMetrics if err != nil { deploymentList . CumulativeMetrics = make ( [ ] metric . Metric , 0 ) } return deploymentList }
CreateDeploymentList returns a list of all Deployment model objects in the cluster, based on all
Kubernetes Deployment API objects.
CreateDeploymentList returns a list of all Deployment model objects in the cluster based on all Kubernetes Deployment API objects .