Skip to content

Commit 71f3ef3

Browse files
authored
Disable metadata service detection in the emulator. (#6860)
* Disable metadata service detection in the emulator. Fix for #6765. The latest version of google-gax attempts to read from the metadata server (on an internal IP address). Setting the environment variable METADATA_SERVER_DETECTION=none by default will turn this behavior off. This is overridable with .env.local. * changelog
1 parent 032f61c commit 71f3ef3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Inject an environment variable in the node functions emulator to tell the google-gax SDK not to look for the metadata service. (#6860)

src/emulator/functionsEmulator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1349,6 +1349,7 @@ export class FunctionsEmulator implements EmulatorInstance {
13491349
cwd: backend.functionsDir,
13501350
env: {
13511351
node: backend.bin,
1352+
METADATA_SERVER_DETECTION: "none",
13521353
...process.env,
13531354
...envs,
13541355
PORT: socketPath,
@@ -1451,7 +1452,6 @@ export class FunctionsEmulator implements EmulatorInstance {
14511452
/**
14521453
* Gets the address of a running emulator, either from explicit args or by
14531454
* consulting the emulator registry.
1454-
*
14551455
* @param emulator
14561456
*/
14571457
private getEmulatorInfo(emulator: Emulators): EmulatorInfo | undefined {

0 commit comments

Comments
 (0)