INNER CODE UNIT · Go

TestIsNodeBeingDrained

kubernetes-sigs/aws-ebs-csi-driver · cmd/hooks/prestop_test.go:272

func TestIsNodeBeingDrained(t *testing.T) {
	testCases := []struct {
		name         string
		nodeTaintKey string
		want         bool
	}{
		{"Should recognize common eviction taint", v1.TaintNodeUnschedulable, true},
		{"Should recognize cluster autoscaler taint", clusterAutoscalerTaint, true},
		{"Should recognize Karpenter v1beta1 taint", v1beta1KarpenterTaint, true},
		{"Should recognize Karpenter v1 taint", v1KarpenterTaint, true},
		{"Should not block on generic taint", "ebs/fake-taint", false},
		{"Should not block on no taint", "", false},
	}
	for _, tc := range testCases {
		t.Run(tc.name, func(t *testing.T) {
			var taints []v1.Taint

			if tc.nodeTaintKey != "" {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…