-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests for containerstatus and livenssprobe #1347
base: ci_prod
Are you sure you want to change the base?
Conversation
* Returns all pods in the given namespace with the given label. | ||
*/ | ||
func GetPodsWithLabel(clientset *kubernetes.Clientset, namespace string, labelKey string, labelValue string) ([]corev1.Pod, error) { | ||
podList, err := clientset.CoreV1().Pods(namespace).List(context.TODO(), metav1.ListOptions{ |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality
func CheckIfAllPodsScheduleOnNodes(clientset *kubernetes.Clientset, namespace, labelKey string, labelValue string, osLabel string) error { | ||
|
||
// Get list of all nodes | ||
nodes, err := clientset.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{}) |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality
for _, node := range nodes.Items { | ||
if node.Labels["beta.kubernetes.io/os"] == osLabel { | ||
// Get list of pods scheduled on this node | ||
pods, err := clientset.CoreV1().Pods(namespace).List(context.TODO(), metav1.ListOptions{ |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality
func CheckIfAllPodsScheduleOnSpecificNodesLabels(clientset *kubernetes.Clientset, namespace, labelKey string, labelValue string, nodeLabelKey string, nodeLabelValue string) error { | ||
|
||
// Get list of all nodes | ||
nodes, err := clientset.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{}) |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality
if value, ok := node.Labels[nodeLabelKey]; ok && value == nodeLabelValue { | ||
|
||
// Get list of pods scheduled on this node | ||
pods, err := clientset.CoreV1().Pods(namespace).List(context.TODO(), metav1.ListOptions{ |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality
* Added test framework build pipeline * Added variables for RG and cluster name
…osoft/Docker-Provider into suyadav/testframework-part1
This PR is the part-1 of end-to-end test automation framework. In this PR, I have added tests for containerstatus and livenessprobe. The changes are similar to Prometheus tests.
ToDo:
Add tests for LAW queries.
Add a readme file.
Tests:
Tested the changes on the local cluster and ci-cd cluster with a test pipeline.