From 6f8fb48f2b6dd195a732114abf33bd4e9f68439f Mon Sep 17 00:00:00 2001 From: Adrian <40185566+adrianisk@users.noreply.github.com> Date: Sat, 27 Apr 2024 16:06:33 -0700 Subject: [PATCH] Fix cacheTo Function/container prop (#3722) * Fix cacheTo Function/container prop * Sync --------- Co-authored-by: Frank --- .changeset/chilled-laws-push.md | 5 +++++ packages/sst/src/constructs/Service.ts | 4 ++-- packages/sst/src/runtime/handlers/container.ts | 8 ++++---- packages/sst/test/constructs/Function.test.ts | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 .changeset/chilled-laws-push.md diff --git a/.changeset/chilled-laws-push.md b/.changeset/chilled-laws-push.md new file mode 100644 index 0000000000..d2ea2abfd4 --- /dev/null +++ b/.changeset/chilled-laws-push.md @@ -0,0 +1,5 @@ +--- +"sst": patch +--- + +Fix cacheTo Function/container prop diff --git a/packages/sst/src/constructs/Service.ts b/packages/sst/src/constructs/Service.ts index df04fb779b..be7a759c36 100644 --- a/packages/sst/src/constructs/Service.ts +++ b/packages/sst/src/constructs/Service.ts @@ -1293,8 +1293,8 @@ export class Service extends Construct implements SSTConstruct { ([pk, pv]) => `${pk}=${pv}` ) : [] - ).join(","), - ], + ) + ].join(","),, ] : []), this.props.path, diff --git a/packages/sst/src/runtime/handlers/container.ts b/packages/sst/src/runtime/handlers/container.ts index 4120176d1c..1a18d26183 100644 --- a/packages/sst/src/runtime/handlers/container.ts +++ b/packages/sst/src/runtime/handlers/container.ts @@ -284,8 +284,8 @@ export const useContainerHandler = (): RuntimeHandler => { input.props.container?.cacheTo?.params ).map(([pk, pv]) => `${pk}=${pv}`) : [] - ).join(","), - ], + ) + ].join(","),, ] : []), `.`, @@ -346,8 +346,8 @@ export const useContainerHandler = (): RuntimeHandler => { input.props.container?.cacheTo?.params ).map(([pk, pv]) => `${pk}=${pv}`) : [] - ).join(","), - ], + ) + ].join(","),, ] : []), `--platform ${platform}`, diff --git a/packages/sst/test/constructs/Function.test.ts b/packages/sst/test/constructs/Function.test.ts index 29da31987c..f364593aa3 100644 --- a/packages/sst/test/constructs/Function.test.ts +++ b/packages/sst/test/constructs/Function.test.ts @@ -257,7 +257,7 @@ test("runtime: container: props", async () => { { type: "inline" }, { type: "local", params: { src: ".", mode: "max" } }, ], - cacheTo: { type: "inline" }, + cacheTo: { type: "local", params: { dest: ".", mode: "max"} }, }, }); await app.finish();