[ Agent ] [ Base ] - nfs-server bug fixs
This commit is contained in:
@@ -365,7 +365,7 @@ func (op *AgentOsOperator) deployTestNFS(funcArgs []string) (bool, []string) {
|
|||||||
result = append(result, "NFS 文件写入 异常!!")
|
result = append(result, "NFS 文件写入 异常!!")
|
||||||
}
|
}
|
||||||
|
|
||||||
if !CheckPodStatusTimeout("test-pod ", "default", 30) {
|
if !CheckPodStatusTimeout("test-pod", "default", 30) {
|
||||||
return false, []string{
|
return false, []string{
|
||||||
"[deployTestNFS] - test pod create failed !",
|
"[deployTestNFS] - test pod create failed !",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,14 +77,14 @@ func CheckPodStatusTimeout(specificPod string, supreme string, waitTimeOut int)
|
|||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-timeout:
|
case <-timeout:
|
||||||
log.ErrorF("[CheckPodStatusTimeout] - 命名空间: %s, Pod名称: %s, 状态: 失败!\n", supreme, specificPod)
|
log.ErrorF("[CheckPodStatusTimeout] - 命名空间: [%s], Pod名称: [%s], 状态: 失败!\n", supreme, specificPod)
|
||||||
return false
|
return false
|
||||||
case <-tick:
|
case <-tick:
|
||||||
pod, err := k8sClient.CoreV1().Pods(supreme).Get(context.TODO(), specificPod, metav1.GetOptions{})
|
pod, err := k8sClient.CoreV1().Pods(supreme).Get(context.TODO(), specificPod, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ErrorF("[CheckPodStatusTimeout] - 获取Pod信息失败: %v\n", err)
|
log.ErrorF("[CheckPodStatusTimeout] - 获取Pod信息失败: %s", err.Error())
|
||||||
} else {
|
} else {
|
||||||
log.DebugF("[CheckPodStatusTimeout] - 命名空间: %s, Pod名称: %s, 状态: %s\n", supreme, pod.Name, pod.Status.Phase)
|
log.DebugF("[CheckPodStatusTimeout] - 命名空间: [%s], Pod名称: [%s], 状态: [%s]\n", supreme, pod.Name, pod.Status.Phase)
|
||||||
if pod.Status.Phase == corev1.PodRunning || pod.Status.Phase == corev1.PodSucceeded {
|
if pod.Status.Phase == corev1.PodRunning || pod.Status.Phase == corev1.PodSucceeded {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user