• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang common.GetPodListChannel函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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)
}
开发者ID:cheld,项目名称:dashboard,代码行数:13,代码来源:petsetlist.go


示例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)
}
开发者ID:cheld,项目名称:dashboard,代码行数:13,代码来源:joblist.go


示例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)
}
开发者ID:kubernetes,项目名称:dashboard,代码行数:13,代码来源:replicasetlist.go


示例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)
}
开发者ID:bryk,项目名称:dashboard,代码行数:19,代码来源:workloads.go


示例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
}
开发者ID:kubernetes,项目名称:dashboard,代码行数:22,代码来源:daemonsetpods.go


示例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
}
开发者ID:kubernetes,项目名称:dashboard,代码行数:22,代码来源:statefulsetpods.go


示例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)
}
开发者ID:floreks,项目名称:dashboard,代码行数:23,代码来源:poddetail.go



注:本文中的github.com/kubernetes/dashboard/src/app/backend/resource/common.GetPodListChannel函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang common.GetPodListChannelWithOptions函数代码示例发布时间:2022-05-23
下一篇:
Golang common.GetPodInfo函数代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap