You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Unfortunately, the next auto generated samples do not help https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-functions/samples
I am trying to update environment variables via nodejs package "@google-cloud/functions"
Here is my code:
`const test = require("ava");
test.serial("update google function env variables", async (t) => {
const { FunctionServiceClient } = require("@google-cloud/functions").v2;
const client = new FunctionServiceClient();
const [service] = await client.getFunction({
name: "projects/myproject/locations/us-central1/functions/myfunction",
});
t.truthy(service);
service.serviceConfig.environmentVariables["TEST"] = "test";
console.info(service);
const result = await client.updateFunction({
function: service,
updateMask: { paths: ["service_config.environment_variables"] },
});
console.info(result);
t.truthy(result);
});`
The call starts the update but it does not update actual value for serviceConfig.environmentVariables["TEST"]
Please advise
Beta Was this translation helpful? Give feedback.
All reactions