Added integration test for pod affinity namespace selector

This commit is contained in:
Abdullah Gharaibeh
2021-04-21 17:09:10 -04:00
parent bd67aeff26
commit ebf0bca3ce
3 changed files with 369 additions and 95 deletions

View File

@@ -497,3 +497,13 @@ func podScheduled(c clientset.Interface, podNamespace, podName string) wait.Cond
return true, nil
}
}
func createNamespacesWithLabels(cs clientset.Interface, namespaces []string, labels map[string]string) error {
for _, n := range namespaces {
ns := v1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: n, Labels: labels}}
if _, err := cs.CoreV1().Namespaces().Create(context.TODO(), &ns, metav1.CreateOptions{}); err != nil {
return err
}
}
return nil
}