@@ -36,10 +36,7 @@ use stackable_operator::{
36
36
merge:: { Atomic , Merge } ,
37
37
} ,
38
38
k8s_openapi:: {
39
- api:: core:: v1:: {
40
- EmptyDirVolumeSource , EnvVar , LocalObjectReference , PodTemplateSpec , Volume ,
41
- VolumeMount ,
42
- } ,
39
+ api:: core:: v1:: { EmptyDirVolumeSource , EnvVar , PodTemplateSpec , Volume , VolumeMount } ,
43
40
apimachinery:: pkg:: api:: resource:: Quantity ,
44
41
} ,
45
42
kube:: { CustomResource , ResourceExt } ,
@@ -49,7 +46,7 @@ use stackable_operator::{
49
46
role_utils:: pod_overrides_schema,
50
47
schemars:: { self , JsonSchema } ,
51
48
} ;
52
- use strum:: { Display , EnumIter , EnumString } ;
49
+ use strum:: { Display , EnumIter } ;
53
50
54
51
#[ derive( Snafu , Debug ) ]
55
52
pub enum Error {
@@ -178,10 +175,6 @@ pub struct SparkApplicationSpec {
178
175
#[ serde( default , skip_serializing_if = "Option::is_none" ) ]
179
176
pub image : Option < String > ,
180
177
pub spark_image : ProductImage ,
181
- #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
182
- pub spark_image_pull_policy : Option < ImagePullPolicy > ,
183
- #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
184
- pub spark_image_pull_secrets : Option < Vec < LocalObjectReference > > ,
185
178
/// Name of the Vector aggregator discovery ConfigMap.
186
179
/// It must contain the key `ADDRESS` with the address of the Vector aggregator.
187
180
#[ serde( skip_serializing_if = "Option::is_none" ) ]
@@ -210,13 +203,6 @@ pub struct SparkApplicationSpec {
210
203
pub log_file_directory : Option < LogFileDirectorySpec > ,
211
204
}
212
205
213
- #[ derive( Clone , Debug , Deserialize , Eq , JsonSchema , PartialEq , Serialize , Display , EnumString ) ]
214
- pub enum ImagePullPolicy {
215
- Always ,
216
- IfNotPresent ,
217
- Never ,
218
- }
219
-
220
206
#[ derive( Clone , Debug , Default , Deserialize , JsonSchema , PartialEq , Eq , Serialize ) ]
221
207
#[ serde( rename_all = "camelCase" ) ]
222
208
pub struct JobDependencies {
@@ -247,14 +233,6 @@ impl SparkApplication {
247
233
self . spec . image . as_deref ( )
248
234
}
249
235
250
- pub fn spark_image_pull_policy ( & self ) -> Option < ImagePullPolicy > {
251
- self . spec . spark_image_pull_policy . clone ( )
252
- }
253
-
254
- pub fn spark_image_pull_secrets ( & self ) -> Option < Vec < LocalObjectReference > > {
255
- self . spec . spark_image_pull_secrets . clone ( )
256
- }
257
-
258
236
pub fn version ( & self ) -> Option < & str > {
259
237
self . spec . version . as_deref ( )
260
238
}
@@ -1072,11 +1050,9 @@ impl ExecutorConfig {
1072
1050
1073
1051
#[ cfg( test) ]
1074
1052
mod tests {
1075
- use crate :: {
1076
- cores_from_quantity, resources_to_executor_props, ExecutorConfig , ImagePullPolicy ,
1077
- } ;
1053
+ use crate :: DriverConfig ;
1054
+ use crate :: { cores_from_quantity, resources_to_executor_props, ExecutorConfig } ;
1078
1055
use crate :: { resources_to_driver_props, SparkApplication } ;
1079
- use crate :: { DriverConfig , LocalObjectReference } ;
1080
1056
use crate :: { Quantity , SparkStorageConfig } ;
1081
1057
use rstest:: rstest;
1082
1058
use stackable_operator:: builder:: ObjectMetaBuilder ;
@@ -1087,7 +1063,6 @@ mod tests {
1087
1063
use stackable_operator:: k8s_openapi:: api:: core:: v1:: PodTemplateSpec ;
1088
1064
use stackable_operator:: product_logging:: spec:: Logging ;
1089
1065
use std:: collections:: { BTreeMap , HashMap } ;
1090
- use std:: str:: FromStr ;
1091
1066
1092
1067
#[ test]
1093
1068
fn test_spark_examples_s3 ( ) {
@@ -1258,75 +1233,6 @@ spec:
1258
1233
assert ! ( spark_application. spec. image. is_none( ) ) ;
1259
1234
}
1260
1235
1261
- #[ test]
1262
- fn test_image_actions ( ) {
1263
- let spark_application = serde_yaml:: from_str :: < SparkApplication > (
1264
- r#"
1265
- ---
1266
- apiVersion: spark.stackable.tech/v1alpha1
1267
- kind: SparkApplication
1268
- metadata:
1269
- name: spark-pi-local
1270
- namespace: default
1271
- spec:
1272
- version: "1.0"
1273
- sparkImage:
1274
- productVersion: 3.2.1
1275
- sparkImagePullPolicy: Always
1276
- sparkImagePullSecrets:
1277
- - name: myregistrykey
1278
- mode: cluster
1279
- mainClass: org.apache.spark.examples.SparkPi
1280
- mainApplicationFile: local:///stackable/spark/examples/jars/spark-examples.jar
1281
- sparkConf:
1282
- spark.kubernetes.node.selector.node: "2"
1283
- driver:
1284
- cores: 1
1285
- coreLimit: "1200m"
1286
- memory: "512m"
1287
- executor:
1288
- cores: 1
1289
- instances: 1
1290
- memory: "512m"
1291
- "# ,
1292
- )
1293
- . unwrap ( ) ;
1294
-
1295
- assert_eq ! (
1296
- Some ( vec![ LocalObjectReference {
1297
- name: Some ( "myregistrykey" . to_string( ) )
1298
- } ] ) ,
1299
- spark_application. spark_image_pull_secrets( )
1300
- ) ;
1301
- assert_eq ! (
1302
- Some ( ImagePullPolicy :: Always ) ,
1303
- spark_application. spark_image_pull_policy( )
1304
- ) ;
1305
- }
1306
-
1307
- #[ test]
1308
- fn test_image_pull_policy_ser ( ) {
1309
- assert_eq ! ( "Never" , ImagePullPolicy :: Never . to_string( ) ) ;
1310
- assert_eq ! ( "Always" , ImagePullPolicy :: Always . to_string( ) ) ;
1311
- assert_eq ! ( "IfNotPresent" , ImagePullPolicy :: IfNotPresent . to_string( ) ) ;
1312
- }
1313
-
1314
- #[ test]
1315
- fn test_image_pull_policy_de ( ) {
1316
- assert_eq ! (
1317
- ImagePullPolicy :: Always ,
1318
- ImagePullPolicy :: from_str( "Always" ) . unwrap( )
1319
- ) ;
1320
- assert_eq ! (
1321
- ImagePullPolicy :: Never ,
1322
- ImagePullPolicy :: from_str( "Never" ) . unwrap( )
1323
- ) ;
1324
- assert_eq ! (
1325
- ImagePullPolicy :: IfNotPresent ,
1326
- ImagePullPolicy :: from_str( "IfNotPresent" ) . unwrap( )
1327
- ) ;
1328
- }
1329
-
1330
1236
#[ test]
1331
1237
fn test_default_resource_limits ( ) {
1332
1238
let spark_application = serde_yaml:: from_str :: < SparkApplication > (
0 commit comments