k8s/io/kubernetes/pkg/api.GetContainerStatus 示例代码

2022-03-03

以下示例是关于golang中包含api.GetContainerStatus用法的示例代码,想了解api.GetContainerStatus的具体用法?api.GetContainerStatus怎么用?api.GetContainerStatus使用的例子?那么可以参考以下10个相关示例代码来学习它的具体使用方法。

示例1:
kubelet_pods.go开发语言: Go项目名称: cjcullen代码行数: 1399
799
800	cStatus, found := api.GetContainerStatus(podStatus.ContainerStatuses, containerName)
801	// if not found, check the init containers
802	if !found {
803		cStatus, found = api.GetContainerStatus(podStatus.InitContainerStatuses, containerName)
804	}
900	for _, container := range spec.InitContainers {
901		containerStatus, ok := api.GetContainerStatus(info, container.Name)
902		if !ok {
937	for _, container := range spec.Containers {
938		containerStatus, ok := api.GetContainerStatus(info, container.Name)
939		if !ok {
示例2:
generate.go开发语言: Go项目名称: cjcullen代码行数: 134
39	for _, container := range spec.Containers {
40		if containerStatus, ok := api.GetContainerStatus(containerStatuses, container.Name); ok {
41			if !containerStatus.Ready {
94	for _, container := range spec.InitContainers {
95		if containerStatus, ok := api.GetContainerStatus(containerStatuses, container.Name); ok {
96			if !containerStatus.Ready {
示例3:
generate.go开发语言: Go项目名称: cloud-zuiwanyuan代码行数: 134
39	for _, container := range spec.Containers {
40		if containerStatus, ok := api.GetContainerStatus(containerStatuses, container.Name); ok {
41			if !containerStatus.Ready {
94	for _, container := range spec.InitContainers {
95		if containerStatus, ok := api.GetContainerStatus(containerStatuses, container.Name); ok {
96			if !containerStatus.Ready {
示例4:
util.go开发语言: Go项目名称: kubernetes代码行数: 367
108		// Cannot use pod.Status.Phase == api.PodSucceeded/api.PodFailed due to #2632
109		ci, ok := api.GetContainerStatus(pod.Status.ContainerStatuses, contName)
110		if !ok {
示例5:
pods.go开发语言: Go项目名称: cjcullen代码行数: 660
104		framework.ExpectNoError(err, fmt.Sprintf("getting pod %s", podName))
105		status, ok := api.GetContainerStatus(pod.Status.ContainerStatuses, containerName)
106		if !ok {
示例6:
pods.go开发语言: Go项目名称: cloud-zuiwanyuan代码行数: 683
105		framework.ExpectNoError(err, fmt.Sprintf("getting pod %s", podName))
106		status, ok := api.GetContainerStatus(pod.Status.ContainerStatuses, containerName)
107		if !ok {
示例7:
util.go开发语言: Go项目名称: cloud-zuiwanyuan代码行数: 4806
1271		// Cannot use pod.Status.Phase == api.PodSucceeded/api.PodFailed due to #2632
1272		ci, ok := api.GetContainerStatus(pod.Status.ContainerStatuses, contName)
1273		if !ok {
示例8:
worker.go开发语言: Go项目名称: cjcullen代码行数: 226
157
158	c, ok := api.GetContainerStatus(status.ContainerStatuses, w.container.Name)
159	if !ok || len(c.ContainerID) == 0 {
示例9:
worker.go开发语言: Go项目名称: cloud-zuiwanyuan代码行数: 226
157
158	c, ok := api.GetContainerStatus(status.ContainerStatuses, w.container.Name)
159	if !ok || len(c.ContainerID) == 0 {
示例10:
pods.go开发语言: Go项目名称: amygdala代码行数: 1222
191		expectNoError(err, fmt.Sprintf("getting pod %s", name))
192		status, ok := api.GetContainerStatus(pod.Status.ContainerStatuses, containerName)
193		if !ok {

本文地址:https://www.itbaoku.cn/snippets/415593.html