INNER CODE UNIT · Go
TestGetPodsAndNodes
robscott/kube-capacity · pkg/capacity/capacity_test.go:26
func TestGetPodsAndNodes(t *testing.T) {
clientset := fake.NewSimpleClientset(
node("mynode", map[string]string{"hello": "world"}, false),
node("mynode2", map[string]string{"hello": "world", "moon": "lol"}, true),
nodeWithTaint("mynode3", map[string]string{"hello": "world"}, "taintkey", "taintvalue"),
nodeWithTaint("mynode4", map[string]string{}, "taintkey", ""),
namespace("default", map[string]string{"app": "true"}),
namespace("kube-system", map[string]string{"system": "true"}),
namespace("other", map[string]string{"app": "true", "system": "true"}),
namespace("another", map[string]string{"hello": "world"}),
pod("mynode", "default", "mypod", map[string]string{"a": "test"}),
pod("mynode2", "kube-system", "mypod1", map[string]string{"b": "test"}),
pod("mynode", "other", "mypod2", map[string]string{"c": "test"}),
pod("mynode2", "other", "mypod3", map[string]string{"d": "test"}),
pod("mynode2", "default", "mypod4", map[string]string{"e": "test"}),
pod("mynode", "another", "mypod5", map[string]string{"f": "test"}),
pod("mynode", "default", "mypod6", map[string]string{"g": "test"}),
pod("mynode3", "default", "mypod7", map[string]string{"e": "test"}),