From 8863c0c3b95de411ecd815f84fde1c2eb40740ad Mon Sep 17 00:00:00 2001 From: Shazron Abdullah <36107+shazron@users.noreply.github.com> Date: Wed, 1 Nov 2023 21:46:38 +0800 Subject: [PATCH] fix: update openwhisk standalone config for new node-20 runtime and tags (#741) --- .../get-runtimes.js | 54 ++++++++++--------- bin/openwhisk-standalone-config/runtimes.json | 18 +++++-- 2 files changed, 41 insertions(+), 31 deletions(-) diff --git a/bin/openwhisk-standalone-config/get-runtimes.js b/bin/openwhisk-standalone-config/get-runtimes.js index 0c51ba46..aac1f2b1 100644 --- a/bin/openwhisk-standalone-config/get-runtimes.js +++ b/bin/openwhisk-standalone-config/get-runtimes.js @@ -17,37 +17,39 @@ const DOCKER_REPOS = { // repo-name:kind 'adobe-action-nodejs-v12': 'nodejs:12', 'adobe-action-nodejs-v14': 'nodejs:14', 'adobe-action-nodejs-v16': 'nodejs:16', - 'adobe-action-nodejs-v18': 'nodejs:18' + 'adobe-action-nodejs-v18': 'nodejs:18', + 'adobe-action-nodejs-v20': 'nodejs:20' } const DEFAULT_KIND = 'nodejs:18' -async function main() { - const nodejs = [] - - for ([repoName, kind] of Object.entries(DOCKER_REPOS)) { - const data = await fetch(`https://registry.hub.docker.com/v2/repositories/${DOCKER_ORG}/${repoName}/tags`) - const json = await data.json() - const defaultKind = (kind === DEFAULT_KIND)? true : undefined - - nodejs.push({ - kind, - default: defaultKind, - image: { - prefix: DOCKER_ORG, - name: repoName, - tag: json.results[0].name - } - }) - } - - const output = { - runtimes: { - nodejs +/** @private */ +async function main () { + const nodejs = [] + + for (const [repoName, kind] of Object.entries(DOCKER_REPOS)) { + const data = await fetch(`https://registry.hub.docker.com/v2/repositories/${DOCKER_ORG}/${repoName}/tags`) + const json = await data.json() + const defaultKind = (kind === DEFAULT_KIND) ? true : undefined + + nodejs.push({ + kind, + default: defaultKind, + image: { + prefix: DOCKER_ORG, + name: repoName, + tag: json.results[0].name } + }) + } + + const output = { + runtimes: { + nodejs } - console.log(JSON.stringify(output, null, 2)) } + console.log(JSON.stringify(output, null, 2)) +} - main() - \ No newline at end of file +main() + .catch(console.error) diff --git a/bin/openwhisk-standalone-config/runtimes.json b/bin/openwhisk-standalone-config/runtimes.json index 89ac344c..2583a934 100644 --- a/bin/openwhisk-standalone-config/runtimes.json +++ b/bin/openwhisk-standalone-config/runtimes.json @@ -6,7 +6,7 @@ "image": { "prefix": "adobeapiplatform", "name": "adobe-action-nodejs-v10", - "tag": "3.0.37" + "tag": "3.0.39" } }, { @@ -14,7 +14,7 @@ "image": { "prefix": "adobeapiplatform", "name": "adobe-action-nodejs-v12", - "tag": "3.0.37" + "tag": "3.0.39" } }, { @@ -22,7 +22,7 @@ "image": { "prefix": "adobeapiplatform", "name": "adobe-action-nodejs-v14", - "tag": "3.0.37" + "tag": "3.0.39" } }, { @@ -30,7 +30,7 @@ "image": { "prefix": "adobeapiplatform", "name": "adobe-action-nodejs-v16", - "tag": "3.0.37" + "tag": "3.0.39" } }, { @@ -39,7 +39,15 @@ "image": { "prefix": "adobeapiplatform", "name": "adobe-action-nodejs-v18", - "tag": "3.0.37" + "tag": "3.0.39" + } + }, + { + "kind": "nodejs:20", + "image": { + "prefix": "adobeapiplatform", + "name": "adobe-action-nodejs-v20", + "tag": "3.0.39" } } ]