Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,22 @@ void describeInstanceTypeProcessorArchitectures() {
.containsExactly("arm64");
}

/** Regression coverage for the Karpenter instance-type compatibility contract. */
@Test
@Order(7)
@DisplayName("DescribeInstanceTypes - supported usage classes")
void describeInstanceTypeSupportedUsageClasses() {
DescribeInstanceTypesResponse resp = ec2.describeInstanceTypes(DescribeInstanceTypesRequest.builder()
.instanceTypes(InstanceType.M5_LARGE, InstanceType.fromValue("t4g.medium"),
InstanceType.fromValue("m6gd.large"))
.build());

assertThat(resp.instanceTypes()).hasSize(3);
assertThat(resp.instanceTypes()).allSatisfy(instanceType ->
assertThat(instanceType.supportedUsageClassesAsStrings())
.containsExactlyInAnyOrder("on-demand", "spot"));
}

@Test
@Order(7)
@DisplayName("CreateFleet - dry-run and instant on-demand launch")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ private static Map<String, CatalogInstanceType> indexInstanceTypes(List<CatalogI
if (instanceType.supportedArchitectures == null || instanceType.supportedArchitectures.isEmpty()) {
throw new IllegalStateException("EC2 instance type catalog entry is missing supportedArchitectures: " + name);
}
if (instanceType.supportedUsageClasses == null || instanceType.supportedUsageClasses.isEmpty()) {
throw new IllegalStateException("EC2 instance type catalog entry is missing supportedUsageClasses: " + name);
}
if (instanceType.encryptionInTransitSupported == null) {
throw new IllegalStateException(
"EC2 instance type catalog entry is missing encryptionInTransitSupported: " + name);
Expand Down Expand Up @@ -156,6 +159,7 @@ public static final class CatalogInstanceType {
public int memoryMib;
public int localStorageGiB;
public List<String> supportedArchitectures = List.of();
public List<String> supportedUsageClasses = List.of("on-demand", "spot");
public Boolean currentGeneration;
public Boolean encryptionInTransitSupported;
public Integer defaultNetworkCardIndex;
Expand All @@ -170,6 +174,7 @@ public Map<String, Object> toResponseMap() {
type.put("instanceStorageSupported", localStorageGiB > 0);
type.put("localStorageGiB", localStorageGiB);
type.put("supportedArchitectures", List.copyOf(supportedArchitectures));
type.put("supportedUsageClasses", List.copyOf(supportedUsageClasses));
type.put("currentGeneration", currentGeneration == null || currentGeneration);
Map<String, Object> networkInfo = new LinkedHashMap<>();
networkInfo.put("encryptionInTransitSupported", encryptionInTransitSupported);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3849,7 +3849,12 @@ private Response handleDescribeInstanceTypes(MultivaluedMap<String, String> p, S
for (String arch : (List<String>) t.get("supportedArchitectures")) {
xml.elem("item", arch);
}
xml.end("supportedArchitectures").end("processorInfo");
xml.end("supportedArchitectures").end("processorInfo")
.start("supportedUsageClasses");
for (String usageClass : (List<String>) t.get("supportedUsageClasses")) {
xml.elem("item", usageClass);
}
xml.end("supportedUsageClasses");
Map<String, Object> networkInfo = (Map<String, Object>) t.get("networkInfo");
xml.start("networkInfo")
.elem("encryptionInTransitSupported",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
* <p>Both fields are resolved through the same reference-path resolver a {@code ".$"} payload
* template field uses, so an unresolvable path fails with {@code States.Runtime}, matching the
* precedent set for issue #2521 in {@link AslExecutorUnresolvableJsonPathTest}.
*
* <p>The fixture supplies all service handlers required by the production executor, including
* the SNS handler introduced by the Step Functions SNS integration.
*/
@QuarkusTest
class AslExecutorFailStateErrorCauseTest {
Expand Down
Loading