You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2022/03/13 09:30:07 UTC

[GitHub] [incubator-yunikorn-k8shim] anuraagnalluri commented on a change in pull request #369: [YUNIKORN-1040] add e2e test that re-starts the scheduler pod

anuraagnalluri commented on a change in pull request #369:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/369#discussion_r825419199



##########
File path: test/e2e/framework/helpers/k8s/k8s_utils.go
##########
@@ -112,6 +138,30 @@ func (k *KubeCtl) GetPod(name, namespace string) (*v1.Pod, error) {
 	return k.clientSet.CoreV1().Pods(namespace).Get(context.TODO(), name, metav1.GetOptions{})
 }
 
+func (k *KubeCtl) GetSchedulerPod() (string, error) {
+	podNameList, err := k.GetPodNamesFromNS(configmanager.YuniKornTestConfig.YkNamespace)
+	if err != nil {
+		return "", err
+	}
+	for _, podName := range podNameList {
+		if strings.Contains(podName, configmanager.YKScheduler) {
+			return podName, nil
+		}
+	}
+	return "", errors.New("YK scheduler pod not found")
+}
+
+func (k *KubeCtl) KillKubectlProcess() error {
+	cmd := exec.Command("pkill", "-SIGINT", "kubectl")

Review comment:
       @yangwwei Definitely a valid concern. That function requires a `PortForwarder` and I couldn't figure out how to get an existing one. Only method I found returning that struct was [New](https://github.com/kubernetes/client-go/blob/master/tools/portforward/portforward.go#L156) which creates a new one. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org