From 6fc00ea6a8af7dab7f9a29364db224b54266a2b1 Mon Sep 17 00:00:00 2001 From: Andrew Dye Date: Tue, 10 Oct 2023 10:37:33 -0700 Subject: [PATCH] Expect merged interruptible node selectors Signed-off-by: Andrew Dye --- flyteplugins/go/tasks/plugins/k8s/spark/spark_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/flyteplugins/go/tasks/plugins/k8s/spark/spark_test.go b/flyteplugins/go/tasks/plugins/k8s/spark/spark_test.go index 13bf1153ac..25f1b0d575 100644 --- a/flyteplugins/go/tasks/plugins/k8s/spark/spark_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/spark/spark_test.go @@ -570,7 +570,6 @@ func TestBuildResourceSpark(t *testing.T) { // Validate // * Interruptible Toleration and NodeSelector set for Executor but not Driver. - // TODO: confirm expected behavior // * Validate Default NodeSelector set for Driver but overwritten with Interruptible NodeSelector for Executor. // * Default Tolerations set for both Driver and Executor. // * Interruptible/Non-Interruptible NodeSelectorRequirements set for Executor Affinity but not Driver Affinity. @@ -584,8 +583,11 @@ func TestBuildResourceSpark(t *testing.T) { assert.Equal(t, tolDriverDefault.Effect, corev1.TaintEffect("NoSchedule")) assert.Equal(t, 2, len(sparkApp.Spec.Executor.Tolerations)) - assert.Equal(t, 1, len(sparkApp.Spec.Executor.NodeSelector)) - assert.Equal(t, interruptibleNodeSelector, sparkApp.Spec.Executor.NodeSelector) + assert.Equal(t, 2, len(sparkApp.Spec.Executor.NodeSelector)) + assert.Equal(t, map[string]string{ + "x/default": "true", + "x/interruptible": "true", + }, sparkApp.Spec.Executor.NodeSelector) tolExecInterrupt := sparkApp.Spec.Executor.Tolerations[0] assert.Equal(t, tolExecInterrupt.Key, "x/flyte") @@ -599,8 +601,6 @@ func TestBuildResourceSpark(t *testing.T) { assert.Equal(t, tolExecDefault.Operator, corev1.TolerationOperator("Equal")) assert.Equal(t, tolExecDefault.Effect, corev1.TaintEffect("NoSchedule")) - assert.Equal(t, "true", sparkApp.Spec.Executor.NodeSelector["x/interruptible"]) - for confKey, confVal := range dummySparkConf { exists := false