Skip to content

Commit

Permalink
refactor: unsupported docker runtimes
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Sep 3, 2022
1 parent 3b9e45f commit c4a53d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/config/supportedRuntimes.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ export const supportedRuntimes = new Set([
...supportedPython,
...supportedRuby,
])

export const unsupportedDockerRuntimes = new Set(['nodejs14.x', 'python3.9'])
11 changes: 3 additions & 8 deletions src/lambda/handler-runner/HandlerRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
supportedNodejs,
supportedPython,
supportedRuby,
unsupportedDockerRuntimes,
} from '../../config/index.js'

export default class HandlerRunner {
Expand All @@ -29,19 +30,13 @@ export default class HandlerRunner {
log.debug(`Loading handler... (${handler})`)

if (useDocker) {
// https://github.com/lambci/docker-lambda/issues/329
if (runtime === 'nodejs14.x') {
if (unsupportedDockerRuntimes.has(runtime)) {
log.warning(
'"nodejs14.x" runtime is not supported with docker. See https://github.com/lambci/docker-lambda/issues/329',
`"${runtime}" runtime is not supported with docker. See https://github.com/lambci/docker-lambda`,
)
throw new Error('Unsupported runtime')
}

if (runtime === 'python3.9') {
log.warning('"python3.9" runtime is not supported with docker.')
throw new Error('Unsupported runtime')
}

const dockerOptions = {
host: this.#options.dockerHost,
hostServicePath: this.#options.dockerHostServicePath,
Expand Down

0 comments on commit c4a53d9

Please sign in to comment.