Skip to content

Commit e5bfbd0

Browse files
himani2411Himani Anil Deshpande
andauthored
[Ubuntu24] Add Ubuntu24 for other validators (#6754)
Co-authored-by: Himani Anil Deshpande <himanidp@amazon.com>
1 parent fddd76c commit e5bfbd0

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

cli/src/pcluster/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"rocky9",
3636
]
3737
SUPPORTED_OSES_FOR_SCHEDULER = {"slurm": SUPPORTED_OSES, "awsbatch": ["alinux2", "alinux2023"]}
38-
UNSUPPORTED_OSES_FOR_MICRO_NANO = ["ubuntu2004", "ubuntu2204", "rhel8", "rocky8", "rhel9", "rocky9"]
38+
UNSUPPORTED_OSES_FOR_MICRO_NANO = ["ubuntu2004", "ubuntu2204", "ubuntu2404", "rhel8", "rocky8", "rhel9", "rocky9"]
3939
UNSUPPORTED_OSES_FOR_DCV = ["alinux2023"]
4040
UNSUPPORTED_ARM_OSES_FOR_DCV = ["ubuntu2004"]
4141
UNSUPPORTED_OSES_FOR_LUSTRE = []

cli/src/pcluster/validators/ec2_validators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,9 @@ def _validate(self, key_name: str, os: str):
208208
if key_name:
209209
try:
210210
key_pair = KeyPairInfo(key_name)
211-
if os == "ubuntu2204" and key_pair.key_type == "rsa":
211+
if os in ["ubuntu2204", "ubuntu2404"] and key_pair.key_type == "rsa":
212212
self._add_failure(
213-
"Ubuntu 22.04 does not support RSA keys. Please generate and use an ed25519 key",
213+
f"{os} does not support RSA keys. Please generate and use an ed25519 key",
214214
FailureLevel.ERROR,
215215
)
216216
except AWSClientError as e:

cli/tests/pcluster/validators/test_cluster_validators.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3509,6 +3509,7 @@ def test_multi_network_interfaces_instances_validator(
35093509
("ami-000000000000", "rhel8", None, None),
35103510
("ami-000000000000", "ubuntu22", None, None),
35113511
("ami-000000000000", "ubuntu20", None, None),
3512+
("ami-000000000000", "ubuntu24", None, None),
35123513
(
35133514
None,
35143515
"rocky8",
@@ -3522,6 +3523,7 @@ def test_multi_network_interfaces_instances_validator(
35223523
(None, "rhel8", None, None),
35233524
(None, "ubuntu22", None, None),
35243525
(None, "ubuntu20", None, None),
3526+
(None, "ubuntu24", None, None),
35253527
],
35263528
)
35273529
def test_compute_ami_os_compatible_validator(mocker, custom_ami_id, os, expected_message, expected_failure_level):

cli/tests/pcluster/validators/test_ec2_validators.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,8 @@ def test_instance_type_os_compatible_validator(instance_type, os, expected_messa
472472
"does not exist",
473473
),
474474
("key-name", GoodKeyPairsDict, "ubuntu2204", None, None),
475-
("key-name", BadKeyPairsDict, "ubuntu2204", None, "Ubuntu 22.04 does not support RSA keys"),
475+
("key-name", BadKeyPairsDict, "ubuntu2204", None, "ubuntu2204 does not support RSA keys"),
476+
("key-name", BadKeyPairsDict, "ubuntu2404", None, "ubuntu2404 does not support RSA keys"),
476477
("key-name", GoodKeyPairsDict, "ubuntu2004", None, None),
477478
("key-name", BadKeyPairsDict, "ubuntu2004", None, None),
478479
("key-name", GoodKeyPairsDict, "rhel8", None, None),

0 commit comments

Comments
 (0)