Skip to content

Commit

Permalink
feat: support dotnet8 runtime (#122)
Browse files Browse the repository at this point in the history
* add `dotnet8` runtime

* add tests for `dotnet8`

* typo
  • Loading branch information
duncanista authored Apr 10, 2024
1 parent e454941 commit 54f4320
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions serverless/src/layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const architectureToExtensionLayerName: { [key: string]: string } = {

export const runtimeLookup: { [key: string]: RuntimeType } = {
dotnet6: RuntimeType.DOTNET,
dotnet8: RuntimeType.DOTNET,
java11: RuntimeType.JAVA,
java17: RuntimeType.JAVA,
java21: RuntimeType.JAVA,
Expand All @@ -64,6 +65,7 @@ export const runtimeLookup: { [key: string]: RuntimeType } = {
export const layerNameLookup: { [key in ArchitectureType]: { [key: string]: string } } = {
[ArchitectureType.x86_64]: {
dotnet6: "dd-trace-dotnet",
dotnet8: "dd-trace-dotnet",
java11: "dd-trace-java",
java17: "dd-trace-java",
java21: "dd-trace-java",
Expand All @@ -85,6 +87,7 @@ export const layerNameLookup: { [key in ArchitectureType]: { [key: string]: stri
},
[ArchitectureType.ARM64]: {
dotnet6: "dd-trace-dotnet-ARM",
dotnet8: "dd-trace-dotnet-ARM",
java11: "dd-trace-java",
java17: "dd-trace-java",
java21: "dd-trace-java",
Expand Down
6 changes: 4 additions & 2 deletions serverless/test/layer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ describe("findLambdas", () => {
it("finds lambdas and correctly assigns runtime types", () => {
const resources = {
Dotnet6Function: mockFunctionResource("dotnet6", ["x86_64"]),
Dotnet8Function: mockFunctionResource("dotnet8", ["x86_64"]),
Java11Function: mockFunctionResource("java11", ["x86_64"]),
Java17Function: mockFunctionResource("java17", ["x86_64"]),
Java21Function: mockFunctionResource("java21", ["x86_64"]),
Expand All @@ -77,6 +78,7 @@ describe("findLambdas", () => {

expect(lambdas).toEqual([
mockLambdaFunction("Dotnet6Function", "dotnet6", RuntimeType.DOTNET, "x86_64", ArchitectureType.x86_64),
mockLambdaFunction("Dotnet8Function", "dotnet8", RuntimeType.DOTNET, "x86_64", ArchitectureType.x86_64),
mockLambdaFunction("Java11Function", "java11", RuntimeType.JAVA, "x86_64", ArchitectureType.x86_64),
mockLambdaFunction("Java17Function", "java17", RuntimeType.JAVA, "x86_64", ArchitectureType.x86_64),
mockLambdaFunction("Java21Function", "java21", RuntimeType.JAVA, "x86_64", ArchitectureType.x86_64),
Expand Down Expand Up @@ -264,7 +266,7 @@ describe("applyLayers", () => {
});

it("applies the dotnet and extension lambda layers", () => {
const lambda = mockLambdaFunction("FunctionKey", "dotnet6", RuntimeType.DOTNET, "x86_64");
const lambda = mockLambdaFunction("FunctionKey", "dotnet8", RuntimeType.DOTNET, "x86_64");
const region = "us-east-1";
const dotnetLayerVersion = 14;
const extensionLayerVersion = 6;
Expand All @@ -286,7 +288,7 @@ describe("applyLayers", () => {
});

it("applies the dotnet and extension lambda layers for arm", () => {
const lambda = mockLambdaFunction("FunctionKey", "dotnet6", RuntimeType.DOTNET, "arm64", ArchitectureType.ARM64);
const lambda = mockLambdaFunction("FunctionKey", "dotnet8", RuntimeType.DOTNET, "arm64", ArchitectureType.ARM64);
const region = "us-east-1";
const dotnetLayerVersion = 14;
const extensionLayerVersion = 6;
Expand Down

0 comments on commit 54f4320

Please sign in to comment.