Skip to content

Commit

Permalink
Support non-standard Spark container names (#2441)
Browse files Browse the repository at this point in the history
Signed-off-by: jbhalodia-slack <[email protected]>
  • Loading branch information
jbhalodia-slack authored Feb 20, 2025
1 parent d10b8f5 commit 79264a4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/webhook/sparkpod_defaulter.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ func findContainer(pod *corev1.Pod) int {
candidateContainerNames = append(candidateContainerNames, common.SparkExecutorContainerName, common.Spark3DefaultExecutorContainerName)
}

// return -1 if the pod is not a Driver or an Executor pod
if len(candidateContainerNames) == 0 {
return -1
}
Expand All @@ -725,7 +726,8 @@ func findContainer(pod *corev1.Pod) int {
}
}
}
return -1
// if no containers match the candidateContainerNames, assume the first container is the spark container.
return 0
}

func hasContainer(pod *corev1.Pod, container *corev1.Container) bool {
Expand Down

0 comments on commit 79264a4

Please sign in to comment.