@@ -112,14 +112,19 @@ def _prepare_job_resource(
112112 jars : List [str ],
113113 extra_metadata : Dict [str , str ],
114114 arguments : List [str ],
115+ namespace : str ,
115116) -> Dict [str , Any ]:
116117 """ Prepare SparkApplication custom resource configs """
117118 job = deepcopy (job_template )
118119
119120 labels = {LABEL_JOBID : job_id , LABEL_JOBTYPE : job_type }
120121
121122 _add_keys (job , ("metadata" , "labels" ), labels )
122- _add_keys (job , ("metadata" ,), dict (name = _job_id_to_resource_name (job_id )))
123+ _add_keys (
124+ job ,
125+ ("metadata" ,),
126+ dict (name = _job_id_to_resource_name (job_id ), namespace = namespace ),
127+ )
123128 _add_keys (job , ("spec" ,), dict (mainClass = main_class ))
124129 _add_keys (job , ("spec" ,), dict (mainApplicationFile = main_application_file ))
125130 _add_keys (job , ("spec" ,), dict (arguments = arguments ))
@@ -179,7 +184,7 @@ def _k8s_state_to_feast(k8s_state: str) -> SparkJobStatus:
179184
180185def _resource_to_job_info (resource : Dict [str , Any ]) -> JobInfo :
181186 labels = resource ["metadata" ]["labels" ]
182- sparkConf = resource ["spec" ].get ("sparkConf" )
187+ sparkConf = resource ["spec" ].get ("sparkConf" , {} )
183188
184189 if "status" in resource :
185190 state = _k8s_state_to_feast (resource ["status" ]["applicationState" ]["state" ])
0 commit comments