yangwwei commented on a change in pull request #369: URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/369#discussion_r825583628
########## 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: The initial port forwarding code was actually the last step of the installation, I think we can remove it, and use your latest code to create the port forward in golang code. Then we either create a shared context between test suits or use a singleton pattern to maintain one instance to do easier creating/stopping port forward. That might be a more consistent way to manage this. What do you think? -- 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-unsubscr...@yunikorn.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org