Skip to content

Commit efb1721

Browse files
committed
Use non-deprecated runtime in examples
1 parent a949aaa commit efb1721

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

examples/automatic-labelling-from-localhost/function_source/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ storeLabels =
110110
* @param {!Object} event Event payload and metadata.
111111
* @param {!Function} callback Callback function to signal completion.
112112
*/
113-
exports.labelResource = (event, callback) => {
113+
exports.labelResource = (data, context, callback)=> {
114114
const eventData =
115-
JSON.parse(Buffer.from(event.data.data, "base64").toString());
115+
JSON.parse(Buffer.from(data.data, "base64").toString());
116116

117117
console.log("Received event");
118118
console.log(eventData);

examples/automatic-labelling-from-localhost/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ module "localhost_function" {
6161
project_id = "${var.project_id}"
6262
region = "${var.region}"
6363
source_directory = "${path.module}/function_source"
64-
runtime = "nodejs6"
64+
runtime = "nodejs8"
6565
}
6666

6767
resource "null_resource" "wait_for_function" {

examples/automatic-labelling-from-repository/function_source/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ storeLabels =
110110
* @param {!Object} event Event payload and metadata.
111111
* @param {!Function} callback Callback function to signal completion.
112112
*/
113-
exports.labelResource = (event, callback) => {
113+
exports.labelResource = (data, context, callback)=> {
114114
const eventData =
115-
JSON.parse(Buffer.from(event.data.data, "base64").toString());
115+
JSON.parse(Buffer.from(data.data, "base64").toString());
116116

117117
console.log("Received event");
118118
console.log(eventData);

examples/automatic-labelling-from-repository/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ module "repository_function" {
8080

8181
description = "Labels resource with owner information."
8282
entry_point = "labelResource"
83-
runtime = "nodejs6"
83+
runtime = "nodejs8"
8484

8585
environment_variables = {
8686
LABEL_KEY = "principal-email"

0 commit comments

Comments
 (0)