INNER CODE UNIT · Go

TestPodIPIndexFuncWrongType

jtblin/kube2iam · namespace_test.go:227

func TestPodIPIndexFuncWrongType(t *testing.T) {
	_, err := PodIPIndexFunc("not-a-pod")
	if err == nil {
		t.Error("expected error for wrong type, got nil")
	}
}

// ---- PodHandler events ------------------------------------------------------

func TestPodHandlerOnAdd(t *testing.T) {
	h := NewPodHandler("iam.amazonaws.com/role")
	pod := &v1.Pod{
		ObjectMeta: metav1.ObjectMeta{
			Name:      "test-pod",
			Namespace: "default",
			Annotations: map[string]string{
				"iam.amazonaws.com/role": "my-role",
			},

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…