yevsh opened a new issue #16290:
URL: https://github.com/apache/airflow/issues/16290
airflow version: v2.0.2
**Description**
calling SparkKubernetesOperator within DAG should delete spark application
if such already exists before submitting a new one.
**Use case / motivation**
```
t1 = SparkKubernetesOperator(
task_id='spark_pi_submit',
namespace="dummy",
application_file="spark.yaml",
kubernetes_conn_id="kubernetes",
do_xcom_push=True,
dag=dag,
)
```
After first successful run, next runs fail to submit spark application
> airflow.exceptions.AirflowException: Exception when calling ->
create_custom_object: (409)
> Reason: Conflict
>
>
{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"sparkapplications.sparkoperator.k8s.io
"xxx" already
exists","reason":"AlreadyExists","details":{"name":"xxx","group":"sparkoperator.k8s.io","kind":"sparkapplications"},"code":409}
>
**Expected Result**
Delete existing spark application if such exists before submitting new one.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]