本文整理匯總了Golang中github.com/kubernetes/dashboard/src/app/backend/resource/common.GetPodListChannel函數的典型用法代碼示例。如果您正苦於以下問題:Golang GetPodListChannel函數的具體用法?Golang GetPodListChannel怎麽用?Golang GetPodListChannel使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GetPodListChannel函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: GetPetSetList
// GetPetSetList returns a list of all Pet Sets in the cluster.
func GetPetSetList(client *client.Client, nsQuery *common.NamespaceQuery,
dsQuery *dataselect.DataSelectQuery, heapsterClient *heapster.HeapsterClient) (*PetSetList, error) {
log.Printf("Getting list of all pet sets in the cluster")
channels := &common.ResourceChannels{
PetSetList: common.GetPetSetListChannel(client.Apps(), nsQuery, 1),
PodList: common.GetPodListChannel(client, nsQuery, 1),
EventList: common.GetEventListChannel(client, nsQuery, 1),
}
return GetPetSetListFromChannels(channels, dsQuery, heapsterClient)
}
示例2: GetJobList
// GetJobList returns a list of all Jobs in the cluster.
func GetJobList(client client.Interface, nsQuery *common.NamespaceQuery,
dsQuery *dataselect.DataSelectQuery, heapsterClient *heapster.HeapsterClient) (*JobList, error) {
log.Printf("Getting list of all jobs in the cluster")
channels := &common.ResourceChannels{
JobList: common.GetJobListChannel(client.Extensions(), nsQuery, 1),
PodList: common.GetPodListChannel(client, nsQuery, 1),
EventList: common.GetEventListChannel(client, nsQuery, 1),
}
return GetJobListFromChannels(channels, dsQuery, heapsterClient)
}
示例3: GetReplicaSetList
// GetReplicaSetList returns a list of all Replica Sets in the cluster.
func GetReplicaSetList(client client.Interface, nsQuery *common.NamespaceQuery,
dsQuery *dataselect.DataSelectQuery, heapsterClient *heapster.HeapsterClient) (*ReplicaSetList, error) {
log.Print("Getting list of all replica sets in the cluster")
channels := &common.ResourceChannels{
ReplicaSetList: common.GetReplicaSetListChannel(client, nsQuery, 1),
PodList: common.GetPodListChannel(client, nsQuery, 1),
EventList: common.GetEventListChannel(client, nsQuery, 1),
}
return GetReplicaSetListFromChannels(channels, dsQuery, heapsterClient)
}
示例4: GetWorkloads
// GetWorkloads returns a list of all workloads in the cluster.
func GetWorkloads(client *k8sClient.Clientset, heapsterClient client.HeapsterClient,
nsQuery *common.NamespaceQuery, metricQuery *dataselect.MetricQuery) (*Workloads, error) {
log.Print("Getting lists of all workloads")
channels := &common.ResourceChannels{
ReplicationControllerList: common.GetReplicationControllerListChannel(client, nsQuery, 1),
ReplicaSetList: common.GetReplicaSetListChannel(client, nsQuery, 1),
JobList: common.GetJobListChannel(client, nsQuery, 1),
DaemonSetList: common.GetDaemonSetListChannel(client, nsQuery, 1),
DeploymentList: common.GetDeploymentListChannel(client, nsQuery, 1),
StatefulSetList: common.GetStatefulSetListChannel(client, nsQuery, 1),
ServiceList: common.GetServiceListChannel(client, nsQuery, 1),
PodList: common.GetPodListChannel(client, nsQuery, 7),
EventList: common.GetEventListChannel(client, nsQuery, 6),
}
return GetWorkloadsFromChannels(channels, heapsterClient, metricQuery)
}
示例5: getRawDaemonSetPods
// Returns array of api pods targeting daemon set with given name.
func getRawDaemonSetPods(client k8sClient.Interface, daemonSetName, namespace string) (
[]api.Pod, error) {
daemonSet, err := client.Extensions().DaemonSets(namespace).Get(daemonSetName)
if err != nil {
return nil, err
}
channels := &common.ResourceChannels{
PodList: common.GetPodListChannel(client, common.NewSameNamespaceQuery(namespace), 1),
}
podList := <-channels.PodList.List
if err := <-channels.PodList.Error; err != nil {
return nil, err
}
matchingPods := common.FilterNamespacedPodsByLabelSelector(podList.Items,
daemonSet.ObjectMeta.Namespace, daemonSet.Spec.Selector)
return matchingPods, nil
}
示例6: getRawStatefulSetPods
// Returns array of api pods targeting pet set with given name.
func getRawStatefulSetPods(client *k8sClient.Clientset, statefulSetName, namespace string) (
[]api.Pod, error) {
statefulSet, err := client.Apps().StatefulSets(namespace).Get(statefulSetName)
if err != nil {
return nil, err
}
channels := &common.ResourceChannels{
PodList: common.GetPodListChannel(client, common.NewSameNamespaceQuery(namespace), 1),
}
podList := <-channels.PodList.List
if err := <-channels.PodList.Error; err != nil {
return nil, err
}
matchingPods := common.FilterNamespacedPodsByLabelSelector(podList.Items,
statefulSet.ObjectMeta.Namespace, statefulSet.Spec.Selector)
return matchingPods, nil
}
示例7: getPodCreator
func getPodCreator(client k8sClient.Interface, creatorAnnotation string, nsQuery *common.NamespaceQuery, heapsterClient client.HeapsterClient) (*Controller, error) {
var serializedReference api.SerializedReference
err := json.Unmarshal([]byte(creatorAnnotation), &serializedReference)
if err != nil {
return nil, err
}
channels := &common.ResourceChannels{
PodList: common.GetPodListChannel(client, nsQuery, 1),
EventList: common.GetEventListChannel(client, nsQuery, 1),
}
pods := <-channels.PodList.List
if err := <-channels.PodList.Error; err != nil {
return nil, err
}
events := <-channels.EventList.List
if err := <-channels.EventList.Error; err != nil {
return nil, err
}
reference := serializedReference.Reference
return toPodController(client, reference, pods.Items, events.Items, heapsterClient)
}