Commit 34a8ace5 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #48934 from vikaschoudhary16/test-inter-pod-affinity

Automatic merge from submit-queue (batch tested with PRs 49665, 49689, 49495, 49146, 48934) Add Integration tests for Inter-Pod Affinity(AntiAffinity) Signed-off-by: 's avatarvikaschoudhary16 <choudharyvikas16@gmail.com> **What this PR does / why we need it**: Adds integration tests for inter-pod affinity(anti-affinity) **Special notes for your reviewer**: Once after @bsalamat 's #48847 gets merged, changes in this PR will be restructured according to the merged changes. ref/ #48176 #48847 @kubernetes/sig-scheduling-pr-reviews @davidopp @k82cn
parents bc3c5bc0 189129c7
......@@ -14,6 +14,7 @@ go_test(
srcs = [
"extender_test.go",
"main_test.go",
"predicates_test.go",
"priorities_test.go",
"scheduler_test.go",
],
......@@ -37,6 +38,7 @@ go_test(
"//test/integration/framework:go_default_library",
"//test/utils:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library",
......
......@@ -282,6 +282,17 @@ func runPausePod(cs clientset.Interface, conf *pausePodConfig) (*v1.Pod, error)
return pod, nil
}
// podDeleted returns true if a pod is not found in the given namespace.
func podDeleted(c clientset.Interface, podNamespace, podName string) wait.ConditionFunc {
return func() (bool, error) {
_, err := c.Core().Pods(podNamespace).Get(podName, metav1.GetOptions{})
if errors.IsNotFound(err) {
return true, nil
}
return false, nil
}
}
// podScheduled returns true if a node is assigned to the given pod.
func podScheduled(c clientset.Interface, podNamespace, podName string) wait.ConditionFunc {
return func() (bool, error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment