func getReplicaSetDetail(replicaSet *extensions.ReplicaSet, heapsterClient client.HeapsterClient, events *common.EventList, pods []api.Pod) ReplicaSetDetail { matchingPods := common.FilterNamespacedPodsByLabelSelector(pods, replicaSet.ObjectMeta.Namespace, replicaSet.Spec.Selector) podInfo := getPodInfo(replicaSet, matchingPods) return ReplicaSetDetail{ ObjectMeta: common.NewObjectMeta(replicaSet.ObjectMeta), TypeMeta: common.NewTypeMeta(common.ResourceKindReplicaSet), ContainerImages: common.GetContainerImages(&replicaSet.Spec.Template.Spec), PodInfo: podInfo, PodList: pod.CreatePodList(matchingPods, heapsterClient), EventList: *events, } }
func getPetSetDetail(petSet *apps.PetSet, heapsterClient client.HeapsterClient, events *common.EventList, pods []api.Pod) PetSetDetail { matchingPods := common.FilterNamespacedPodsByLabelSelector(pods, petSet.ObjectMeta.Namespace, petSet.Spec.Selector) podInfo := common.GetPodInfo(int32(petSet.Status.Replicas), int32(petSet.Spec.Replicas), matchingPods) return PetSetDetail{ ObjectMeta: common.NewObjectMeta(petSet.ObjectMeta), TypeMeta: common.NewTypeMeta(common.ResourceKindPetSet), ContainerImages: common.GetContainerImages(&petSet.Spec.Template.Spec), PodInfo: podInfo, PodList: pod.CreatePodList(matchingPods, heapsterClient), EventList: *events, } }