From c5303f02e071a244f342bab2b1c851d7357aaae5 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 | 11 ++++++----- 1 file changed, 6 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 13bf1153acb..a7bb0b242ca 100644 --- a/flyteplugins/go/tasks/plugins/k8s/spark/spark_test.go +++ b/flyteplugins/go/tasks/plugins/k8s/spark/spark_test.go @@ -415,6 +415,10 @@ func TestBuildResourceSpark(t *testing.T) { interruptibleNodeSelector := map[string]string{ "x/interruptible": "true", } + mergedInterruptibleNodeSelector := map[string]string{ + "x/default": "true", + "x/interruptible": "true", + } defaultPodHostNetwork := true @@ -570,7 +574,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 +587,8 @@ 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, mergedInterruptibleNodeSelector, sparkApp.Spec.Executor.NodeSelector) tolExecInterrupt := sparkApp.Spec.Executor.Tolerations[0] assert.Equal(t, tolExecInterrupt.Key, "x/flyte") @@ -599,8 +602,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