Skip to content

Commit 485a2a4

Browse files
committed
[DFSM] Use UpdatePolicy.IGNORED for Ebs/Efs/FSxLustreSettings.
Signed-off-by: Giacomo Marciani <[email protected]>
1 parent bfb0b45 commit 485a2a4

File tree

2 files changed

+111
-3
lines changed

2 files changed

+111
-3
lines changed

cli/src/pcluster/schemas/cluster_schema.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,9 @@ class SharedStorageSchema(BaseSchema):
482482
validate=validate.OneOf(["Ebs", FSX_LUSTRE, FSX_OPENZFS, FSX_ONTAP, "Efs"]),
483483
metadata={"update_policy": UpdatePolicy.UNSUPPORTED},
484484
)
485-
ebs_settings = fields.Nested(EbsSettingsSchema, metadata={"update_policy": UpdatePolicy.UNSUPPORTED})
486-
efs_settings = fields.Nested(EfsSettingsSchema, metadata={"update_policy": UpdatePolicy.UNSUPPORTED})
487-
fsx_lustre_settings = fields.Nested(FsxLustreSettingsSchema, metadata={"update_policy": UpdatePolicy.UNSUPPORTED})
485+
ebs_settings = fields.Nested(EbsSettingsSchema, metadata={"update_policy": UpdatePolicy.IGNORED})
486+
efs_settings = fields.Nested(EfsSettingsSchema, metadata={"update_policy": UpdatePolicy.IGNORED})
487+
fsx_lustre_settings = fields.Nested(FsxLustreSettingsSchema, metadata={"update_policy": UpdatePolicy.IGNORED})
488488
fsx_open_zfs_settings = fields.Nested(
489489
FsxOpenZfsSettingsSchema, metadata={"update_policy": UpdatePolicy.UNSUPPORTED}
490490
)

cli/tests/pcluster/config/test_config_patch.py

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,113 @@ def _test_different_names(base_conf, target_conf):
648648
)
649649

650650

651+
def _test_storage(base_conf, target_conf):
652+
# Check the update of Ebs,Efs,FsxLustreSettings
653+
# with both updatable and not updatable keys
654+
for storage_type in ("Ebs", "Efs", "FsxLustre"):
655+
storage_name = storage_type.lower()
656+
base_conf["SharedStorage"].append(
657+
{
658+
"Name": f"{storage_name}3",
659+
"MountDir": f"/{storage_name}3",
660+
"StorageType": storage_type,
661+
}
662+
)
663+
target_conf["SharedStorage"].append(
664+
{
665+
"Name": f"{storage_name}3",
666+
"MountDir": f"/{storage_name}3",
667+
"StorageType": storage_type,
668+
f"{storage_type}Settings": {"DeletionPolicy": "Retain"},
669+
}
670+
)
671+
base_conf["SharedStorage"].append(
672+
{
673+
"Name": f"{storage_name}4",
674+
"MountDir": f"/{storage_name}4",
675+
"StorageType": storage_type,
676+
}
677+
)
678+
target_conf["SharedStorage"].append(
679+
{
680+
"Name": f"{storage_name}4",
681+
"MountDir": f"/{storage_name}4",
682+
"StorageType": storage_type,
683+
f"{storage_type}Settings": {"Encrypted": True}
684+
if storage_type in ("Ebs", "Efs")
685+
else {"DeploymentType": "PERSISTENT_2"},
686+
}
687+
)
688+
689+
_check_patch(
690+
base_conf,
691+
target_conf,
692+
[
693+
Change(
694+
["SharedStorage[ebs3]", "EbsSettings"],
695+
"DeletionPolicy",
696+
None,
697+
"Retain",
698+
UpdatePolicy(
699+
UpdatePolicy.SUPPORTED,
700+
),
701+
is_list=False,
702+
),
703+
Change(
704+
["SharedStorage[efs3]", "EfsSettings"],
705+
"DeletionPolicy",
706+
None,
707+
"Retain",
708+
UpdatePolicy(
709+
UpdatePolicy.SUPPORTED,
710+
),
711+
is_list=False,
712+
),
713+
Change(
714+
["SharedStorage[fsxlustre3]", "FsxLustreSettings"],
715+
"DeletionPolicy",
716+
None,
717+
"Retain",
718+
UpdatePolicy(
719+
UpdatePolicy.SUPPORTED,
720+
),
721+
is_list=False,
722+
),
723+
Change(
724+
["SharedStorage[ebs4]", "EbsSettings"],
725+
"Encrypted",
726+
None,
727+
True,
728+
UpdatePolicy(
729+
UpdatePolicy.UNSUPPORTED,
730+
),
731+
is_list=False,
732+
),
733+
Change(
734+
["SharedStorage[efs4]", "EfsSettings"],
735+
"Encrypted",
736+
None,
737+
True,
738+
UpdatePolicy(
739+
UpdatePolicy.UNSUPPORTED,
740+
),
741+
is_list=False,
742+
),
743+
Change(
744+
["SharedStorage[fsxlustre4]", "FsxLustreSettings"],
745+
"DeploymentType",
746+
None,
747+
"PERSISTENT_2",
748+
UpdatePolicy(
749+
UpdatePolicy.UNSUPPORTED,
750+
),
751+
is_list=False,
752+
),
753+
],
754+
UpdatePolicy.UNSUPPORTED,
755+
)
756+
757+
651758
@pytest.mark.parametrize(
652759
"test",
653760
[
@@ -658,6 +765,7 @@ def _test_different_names(base_conf, target_conf):
658765
_test_different_names,
659766
_test_compute_resources,
660767
_test_queues,
768+
_test_storage,
661769
],
662770
)
663771
def test_adaptation(mocker, test_datadir, pcluster_config_reader, test):

0 commit comments

Comments
 (0)