e2e/framework: remove direct imports to pkg/api/v1/pod
This commit is contained in:
		| @@ -64,6 +64,7 @@ go_library( | ||||
|         "//staging/src/k8s.io/client-go/tools/remotecommand:go_default_library", | ||||
|         "//staging/src/k8s.io/client-go/tools/watch:go_default_library", | ||||
|         "//staging/src/k8s.io/component-base/cli/flag:go_default_library", | ||||
|         "//staging/src/k8s.io/kubectl/pkg/util/podutils:go_default_library", | ||||
|         "//test/e2e/framework/auth:go_default_library", | ||||
|         "//test/e2e/framework/ginkgowrapper:go_default_library", | ||||
|         "//test/e2e/framework/kubectl:go_default_library", | ||||
|   | ||||
| @@ -12,7 +12,6 @@ go_library( | ||||
|     importpath = "k8s.io/kubernetes/test/e2e/framework/pod", | ||||
|     visibility = ["//visibility:public"], | ||||
|     deps = [ | ||||
|         "//pkg/api/v1/pod:go_default_library", | ||||
|         "//pkg/client/conditions:go_default_library", | ||||
|         "//pkg/kubelet/types:go_default_library", | ||||
|         "//pkg/kubelet/util/format:go_default_library", | ||||
| @@ -24,6 +23,7 @@ go_library( | ||||
|         "//staging/src/k8s.io/apimachinery/pkg/util/uuid:go_default_library", | ||||
|         "//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library", | ||||
|         "//staging/src/k8s.io/client-go/kubernetes:go_default_library", | ||||
|         "//staging/src/k8s.io/kubectl/pkg/util/podutils:go_default_library", | ||||
|         "//test/e2e/framework/log:go_default_library", | ||||
|         "//test/utils:go_default_library", | ||||
|         "//test/utils/image:go_default_library", | ||||
|   | ||||
| @@ -32,7 +32,7 @@ import ( | ||||
| 	"k8s.io/apimachinery/pkg/types" | ||||
| 	"k8s.io/apimachinery/pkg/util/wait" | ||||
| 	clientset "k8s.io/client-go/kubernetes" | ||||
| 	podutil "k8s.io/kubernetes/pkg/api/v1/pod" | ||||
| 	"k8s.io/kubectl/pkg/util/podutils" | ||||
| 	"k8s.io/kubernetes/pkg/client/conditions" | ||||
| 	kubetypes "k8s.io/kubernetes/pkg/kubelet/types" | ||||
| 	e2elog "k8s.io/kubernetes/test/e2e/framework/log" | ||||
| @@ -186,8 +186,8 @@ func podRunningAndReady(c clientset.Interface, podName, namespace string) wait.C | ||||
| 			e2elog.Logf("The status of Pod %s is %s which is unexpected", podName, pod.Status.Phase) | ||||
| 			return false, conditions.ErrPodCompleted | ||||
| 		case v1.PodRunning: | ||||
| 			e2elog.Logf("The status of Pod %s is %s (Ready = %v)", podName, pod.Status.Phase, podutil.IsPodReady(pod)) | ||||
| 			return podutil.IsPodReady(pod), nil | ||||
| 			e2elog.Logf("The status of Pod %s is %s (Ready = %v)", podName, pod.Status.Phase, podutils.IsPodReady(pod)) | ||||
| 			return podutils.IsPodReady(pod), nil | ||||
| 		} | ||||
| 		e2elog.Logf("The status of Pod %s is %s, waiting for it to be Running (with Ready = true)", podName, pod.Status.Phase) | ||||
| 		return false, nil | ||||
|   | ||||
| @@ -33,7 +33,7 @@ import ( | ||||
| 	"k8s.io/apimachinery/pkg/labels" | ||||
| 	"k8s.io/apimachinery/pkg/util/wait" | ||||
| 	clientset "k8s.io/client-go/kubernetes" | ||||
| 	podutil "k8s.io/kubernetes/pkg/api/v1/pod" | ||||
| 	"k8s.io/kubectl/pkg/util/podutils" | ||||
| 	"k8s.io/kubernetes/pkg/kubelet/util/format" | ||||
| 	e2elog "k8s.io/kubernetes/test/e2e/framework/log" | ||||
| 	testutils "k8s.io/kubernetes/test/utils" | ||||
| @@ -216,7 +216,7 @@ func WaitForPodCondition(c clientset.Interface, ns, podName, desc string, timeou | ||||
| 		} | ||||
| 		// log now so that current pod info is reported before calling `condition()` | ||||
| 		e2elog.Logf("Pod %q: Phase=%q, Reason=%q, readiness=%t. Elapsed: %v", | ||||
| 			podName, pod.Status.Phase, pod.Status.Reason, podutil.IsPodReady(pod), time.Since(start)) | ||||
| 			podName, pod.Status.Phase, pod.Status.Reason, podutils.IsPodReady(pod), time.Since(start)) | ||||
| 		if done, err := condition(pod); done { | ||||
| 			if err == nil { | ||||
| 				e2elog.Logf("Pod %q satisfied condition %q", podName, desc) | ||||
| @@ -505,7 +505,7 @@ func WaitForPodsReady(c clientset.Interface, ns, name string, minReadySeconds in | ||||
| 			return false, nil | ||||
| 		} | ||||
| 		for _, pod := range pods.Items { | ||||
| 			if !podutil.IsPodAvailable(&pod, int32(minReadySeconds), metav1.Now()) { | ||||
| 			if !podutils.IsPodAvailable(&pod, int32(minReadySeconds), metav1.Now()) { | ||||
| 				return false, nil | ||||
| 			} | ||||
| 		} | ||||
|   | ||||
| @@ -31,7 +31,7 @@ import ( | ||||
| 	"k8s.io/apimachinery/pkg/util/wait" | ||||
| 	"k8s.io/client-go/kubernetes/scheme" | ||||
| 	v1core "k8s.io/client-go/kubernetes/typed/core/v1" | ||||
| 	podutil "k8s.io/kubernetes/pkg/api/v1/pod" | ||||
| 	"k8s.io/kubectl/pkg/util/podutils" | ||||
| 	"k8s.io/kubernetes/pkg/kubelet/events" | ||||
| 	"k8s.io/kubernetes/pkg/kubelet/sysctl" | ||||
|  | ||||
| @@ -262,5 +262,5 @@ func (c *PodClient) MatchContainerOutput(name string, containerName string, expe | ||||
| func (c *PodClient) PodIsReady(name string) bool { | ||||
| 	pod, err := c.Get(context.TODO(), name, metav1.GetOptions{}) | ||||
| 	ExpectNoError(err) | ||||
| 	return podutil.IsPodReady(pod) | ||||
| 	return podutils.IsPodReady(pod) | ||||
| } | ||||
|   | ||||
| @@ -11,7 +11,6 @@ go_library( | ||||
|     importpath = "k8s.io/kubernetes/test/e2e/framework/statefulset", | ||||
|     visibility = ["//visibility:public"], | ||||
|     deps = [ | ||||
|         "//pkg/api/v1/pod:go_default_library", | ||||
|         "//staging/src/k8s.io/api/apps/v1:go_default_library", | ||||
|         "//staging/src/k8s.io/api/core/v1:go_default_library", | ||||
|         "//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library", | ||||
| @@ -21,6 +20,7 @@ go_library( | ||||
|         "//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library", | ||||
|         "//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library", | ||||
|         "//staging/src/k8s.io/client-go/kubernetes:go_default_library", | ||||
|         "//staging/src/k8s.io/kubectl/pkg/util/podutils:go_default_library", | ||||
|         "//test/e2e/framework:go_default_library", | ||||
|         "//test/e2e/manifest:go_default_library", | ||||
|         "//test/utils/image:go_default_library", | ||||
|   | ||||
| @@ -28,7 +28,7 @@ import ( | ||||
| 	"k8s.io/apimachinery/pkg/api/resource" | ||||
| 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||||
| 	clientset "k8s.io/client-go/kubernetes" | ||||
| 	podutil "k8s.io/kubernetes/pkg/api/v1/pod" | ||||
| 	"k8s.io/kubectl/pkg/util/podutils" | ||||
| 	"k8s.io/kubernetes/test/e2e/framework" | ||||
| 	imageutils "k8s.io/kubernetes/test/utils/image" | ||||
| ) | ||||
| @@ -159,7 +159,7 @@ func ResumeNextPod(c clientset.Interface, ss *appsv1.StatefulSet) { | ||||
| 		if pod.Status.Phase != v1.PodRunning { | ||||
| 			framework.Failf("Found pod in phase %q, cannot resume", pod.Status.Phase) | ||||
| 		} | ||||
| 		if podutil.IsPodReady(&pod) || !hasPauseProbe(&pod) { | ||||
| 		if podutils.IsPodReady(&pod) || !hasPauseProbe(&pod) { | ||||
| 			continue | ||||
| 		} | ||||
| 		if resumedPod != "" { | ||||
|   | ||||
| @@ -31,7 +31,7 @@ import ( | ||||
| 	"k8s.io/apimachinery/pkg/util/sets" | ||||
| 	"k8s.io/apimachinery/pkg/util/wait" | ||||
| 	clientset "k8s.io/client-go/kubernetes" | ||||
| 	podutil "k8s.io/kubernetes/pkg/api/v1/pod" | ||||
| 	"k8s.io/kubectl/pkg/util/podutils" | ||||
| 	"k8s.io/kubernetes/test/e2e/framework" | ||||
| 	"k8s.io/kubernetes/test/e2e/manifest" | ||||
| ) | ||||
| @@ -160,7 +160,7 @@ func Scale(c clientset.Interface, ss *appsv1.StatefulSet, count int32) (*appsv1. | ||||
| 	if pollErr != nil { | ||||
| 		unhealthy := []string{} | ||||
| 		for _, statefulPod := range statefulPodList.Items { | ||||
| 			delTs, phase, readiness := statefulPod.DeletionTimestamp, statefulPod.Status.Phase, podutil.IsPodReady(&statefulPod) | ||||
| 			delTs, phase, readiness := statefulPod.DeletionTimestamp, statefulPod.Status.Phase, podutils.IsPodReady(&statefulPod) | ||||
| 			if delTs != nil || phase != v1.PodRunning || !readiness { | ||||
| 				unhealthy = append(unhealthy, fmt.Sprintf("%v: deletion %v, phase %v, readiness %v", statefulPod.Name, delTs, phase, readiness)) | ||||
| 			} | ||||
|   | ||||
| @@ -25,7 +25,7 @@ import ( | ||||
| 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||||
| 	"k8s.io/apimachinery/pkg/util/wait" | ||||
| 	clientset "k8s.io/client-go/kubernetes" | ||||
| 	podutil "k8s.io/kubernetes/pkg/api/v1/pod" | ||||
| 	"k8s.io/kubectl/pkg/util/podutils" | ||||
| 	"k8s.io/kubernetes/test/e2e/framework" | ||||
| ) | ||||
|  | ||||
| @@ -45,7 +45,7 @@ func WaitForRunning(c clientset.Interface, numPodsRunning, numPodsReady int32, s | ||||
| 			} | ||||
| 			for _, p := range podList.Items { | ||||
| 				shouldBeReady := getStatefulPodOrdinal(&p) < int(numPodsReady) | ||||
| 				isReady := podutil.IsPodReady(&p) | ||||
| 				isReady := podutils.IsPodReady(&p) | ||||
| 				desiredReadiness := shouldBeReady == isReady | ||||
| 				framework.Logf("Waiting for pod %v to enter %v - Ready=%v, currently %v - Ready=%v", p.Name, v1.PodRunning, shouldBeReady, p.Status.Phase, isReady) | ||||
| 				if p.Status.Phase != v1.PodRunning || !desiredReadiness { | ||||
| @@ -88,7 +88,7 @@ func WaitForPodReady(c clientset.Interface, set *appsv1.StatefulSet, podName str | ||||
| 		pods = pods2 | ||||
| 		for i := range pods.Items { | ||||
| 			if pods.Items[i].Name == podName { | ||||
| 				return podutil.IsPodReady(&pods.Items[i]), nil | ||||
| 				return podutils.IsPodReady(&pods.Items[i]), nil | ||||
| 			} | ||||
| 		} | ||||
| 		return false, nil | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 SataQiu
					SataQiu