Skip to content

Commit d7a85bd

Browse files
authored
Ensure that driver is deleted prior to sparkapplication resubmission (#1521)
* Ensure that driver is deleted prior to sparkapplication resubmission Signed-off-by: Khor Shu Heng <[email protected]> * Update app version Signed-off-by: Khor Shu Heng <[email protected]> * Update chart version Signed-off-by: Khor Shu Heng <[email protected]> Co-authored-by: Khor Shu Heng <[email protected]>
1 parent 3b58b26 commit d7a85bd

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

charts/spark-operator-chart/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v2
22
name: spark-operator
33
description: A Helm chart for Spark on Kubernetes operator
4-
version: 1.1.20
5-
appVersion: v1beta2-1.3.4-3.1.1
4+
version: 1.1.21
5+
appVersion: v1beta2-1.3.5-3.1.1
66
keywords:
77
- spark
88
home: https://github.com/GoogleCloudPlatform/spark-on-k8s-operator

pkg/controller/sparkapplication/controller.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,15 @@ func (c *Controller) syncSparkApplication(key string) error {
579579
appCopy.Status.AppState.State = v1beta2.FailedState
580580
c.recordSparkApplicationEvent(appCopy)
581581
} else if isNextRetryDue(appCopy.Spec.RestartPolicy.OnSubmissionFailureRetryInterval, appCopy.Status.SubmissionAttempts, appCopy.Status.LastSubmissionAttemptTime) {
582-
appCopy = c.submitSparkApplication(appCopy)
582+
if c.validateSparkResourceDeletion(appCopy) {
583+
c.submitSparkApplication(appCopy)
584+
} else {
585+
if err := c.deleteSparkResources(appCopy); err != nil {
586+
glog.Errorf("failed to delete resources associated with SparkApplication %s/%s: %v",
587+
appCopy.Namespace, appCopy.Name, err)
588+
return err
589+
}
590+
}
583591
}
584592
case v1beta2.InvalidatingState:
585593
// Invalidate the current run and enqueue the SparkApplication for re-execution.

0 commit comments

Comments
 (0)