Skip to content

Commit

Permalink
fix(aws-lambda-python): skip default docker build when image passed
Browse files Browse the repository at this point in the history
  • Loading branch information
relm923 committed Feb 24, 2022
1 parent 52128cf commit 829e593
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions packages/@aws-cdk/aws-lambda-python/lib/bundling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,13 @@ export class Bundling implements CdkBundlingOptions {
outputDir: outputPath,
});

const defaultImage = DockerImage.fromBuild(path.join(__dirname, '../lib'), {
this.image = image ?? DockerImage.fromBuild(path.join(__dirname, '../lib'), {
buildArgs: {
...props.buildArgs ?? {},
IMAGE: runtime.bundlingImage.image,
},
platform: architecture.dockerPlatform,
});
this.image = image ?? defaultImage;
this.command = ['bash', '-c', chain(bundlingCommands)];
this.environment = props.environment;
}
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-lambda-python/test/bundling.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ test('Bundling a function with custom bundling image', () => {
}),
}));

expect(DockerImage.fromBuild).toHaveBeenCalledTimes(1);
expect(DockerImage.fromBuild).toHaveBeenCalledWith(expect.stringMatching(entry));
});

Expand Down

0 comments on commit 829e593

Please sign in to comment.