mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
e2e: move funs of framework/kubelet to e2e/scheduling
This commit is contained in:
parent
2fbe432d23
commit
546dbf8b3c
@ -20,7 +20,6 @@ import (
|
||||
v1 "k8s.io/api/core/v1"
|
||||
clientset "k8s.io/client-go/kubernetes"
|
||||
"k8s.io/kubernetes/pkg/master/ports"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
)
|
||||
|
||||
// GetKubeletPods retrieves the list of pods on the kubelet.
|
||||
@ -46,19 +45,3 @@ func getKubeletPods(c clientset.Interface, node, resource string) (*v1.PodList,
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// PrintAllKubeletPods outputs status of all kubelet pods into log.
|
||||
func PrintAllKubeletPods(c clientset.Interface, nodeName string) {
|
||||
podList, err := GetKubeletPods(c, nodeName)
|
||||
if err != nil {
|
||||
framework.Logf("Unable to retrieve kubelet pods for node %v: %v", nodeName, err)
|
||||
return
|
||||
}
|
||||
for _, p := range podList.Items {
|
||||
framework.Logf("%v from %v started at %v (%d container statuses recorded)", p.Name, p.Namespace, p.Status.StartTime, len(p.Status.ContainerStatuses))
|
||||
for _, c := range p.Status.ContainerStatuses {
|
||||
framework.Logf("\tContainer %v ready: %v, restart count %v",
|
||||
c.Name, c.Ready, c.RestartCount)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ var _ = SIGDescribe("SchedulerPredicates [Serial]", func() {
|
||||
|
||||
for _, node := range nodeList.Items {
|
||||
framework.Logf("\nLogging pods the kubelet thinks is on node %v before test", node.Name)
|
||||
e2ekubelet.PrintAllKubeletPods(cs, node.Name)
|
||||
printAllKubeletPods(cs, node.Name)
|
||||
}
|
||||
|
||||
})
|
||||
@ -598,6 +598,22 @@ var _ = SIGDescribe("SchedulerPredicates [Serial]", func() {
|
||||
})
|
||||
})
|
||||
|
||||
// printAllKubeletPods outputs status of all kubelet pods into log.
|
||||
func printAllKubeletPods(c clientset.Interface, nodeName string) {
|
||||
podList, err := e2ekubelet.GetKubeletPods(c, nodeName)
|
||||
if err != nil {
|
||||
framework.Logf("Unable to retrieve kubelet pods for node %v: %v", nodeName, err)
|
||||
return
|
||||
}
|
||||
for _, p := range podList.Items {
|
||||
framework.Logf("%v from %v started at %v (%d container statuses recorded)", p.Name, p.Namespace, p.Status.StartTime, len(p.Status.ContainerStatuses))
|
||||
for _, c := range p.Status.ContainerStatuses {
|
||||
framework.Logf("\tContainer %v ready: %v, restart count %v",
|
||||
c.Name, c.Ready, c.RestartCount)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func initPausePod(f *framework.Framework, conf pausePodConfig) *v1.Pod {
|
||||
var gracePeriod = int64(1)
|
||||
pod := &v1.Pod{
|
||||
|
Loading…
Reference in New Issue
Block a user