@@ -444,68 +444,6 @@ def test_default_cluster_creation(mocker):
444
444
assert cluster .config .namespace == "opendatahub"
445
445
446
446
447
- def test_cluster_with_custom_volumes (mocker ):
448
- mocker .patch ("kubernetes.client.ApisApi.get_api_versions" )
449
- mocker .patch (
450
- "codeflare_sdk.cluster.cluster.get_current_namespace" ,
451
- return_value = "opendatahub" ,
452
- )
453
- mocker .patch (
454
- "kubernetes.client.CustomObjectsApi.list_namespaced_custom_object" ,
455
- return_value = get_local_queue ("kueue.x-k8s.io" , "v1beta1" , "ns" , "localqueues" ),
456
- )
457
-
458
- from kubernetes .client import (
459
- V1Volume ,
460
- V1VolumeMount ,
461
- V1EmptyDirVolumeSource ,
462
- V1ConfigMapVolumeSource ,
463
- V1KeyToPath ,
464
- V1SecretVolumeSource ,
465
- )
466
-
467
- volume_mounts = [
468
- V1VolumeMount (mount_path = "/home/ray/test1" , name = "test" ),
469
- V1VolumeMount (
470
- mount_path = "/home/ray/test2" ,
471
- name = "test2" ,
472
- ),
473
- V1VolumeMount (
474
- mount_path = "/home/ray/test2" ,
475
- name = "test3" ,
476
- ),
477
- ]
478
-
479
- volumes = [
480
- V1Volume (
481
- name = "test" ,
482
- empty_dir = V1EmptyDirVolumeSource (size_limit = "500Gi" ),
483
- ),
484
- V1Volume (
485
- name = "test2" ,
486
- config_map = V1ConfigMapVolumeSource (
487
- name = "config-map-test" ,
488
- items = [V1KeyToPath (key = "test" , path = "/home/ray/test2/data.txt" )],
489
- ),
490
- ),
491
- V1Volume (name = "test3" , secret = V1SecretVolumeSource (secret_name = "test-secret" )),
492
- ]
493
-
494
- test_config = ClusterConfiguration (
495
- name = "unit-test-volume-cluster" ,
496
- image = "quay.io/project-codeflare/ray:2.20.0-py39-cu118" ,
497
- volume_mounts = volume_mounts ,
498
- volumes = volumes ,
499
- )
500
- cluster = Cluster (test_config )
501
- test_rc = yaml .load (cluster .app_wrapper_yaml , Loader = yaml .FullLoader )
502
- with open (
503
- f"{ parent } /tests/unit-test-volume-cluster.yaml" ,
504
- ) as f :
505
- volume_rc = yaml .load (f , Loader = yaml .FullLoader )
506
- assert test_rc == volume_rc
507
-
508
-
509
447
def test_gen_names_with_name (mocker ):
510
448
mocker .patch .object (
511
449
uuid , "uuid4" , return_value = uuid .UUID ("00000000-0000-0000-0000-000000000001" )
0 commit comments