Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Commit ea9cb4b

Browse files
renovate[bot]kjin
authored andcommitted
fix(deps): update dependency gcp-metadata to v1 (#975)
* fix(deps): update dependency gcp-metadata to v1 * fix nock paths * use HOST_ADDRESS
1 parent 29bb15c commit ea9cb4b

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"console-log-level": "^1.4.0",
104104
"continuation-local-storage": "^3.2.1",
105105
"extend": "^3.0.0",
106-
"gcp-metadata": "^0.9.0",
106+
"gcp-metadata": "^1.0.0",
107107
"hex2dec": "^1.0.1",
108108
"is": "^3.2.0",
109109
"methods": "^1.1.1",

test/nocks.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
import {HOST_ADDRESS} from 'gcp-metadata';
1718
import * as nock from 'nock';
1819

1920
const accept = () => true;
@@ -36,7 +37,7 @@ export function projectId(status: number|(() => string), reply?: () => string) {
3637
reply = status;
3738
status = 200;
3839
}
39-
return nock('http://metadata.google.internal')
40+
return nock(HOST_ADDRESS)
4041
.get('/computeMetadata/v1/project/project-id')
4142
.once()
4243
.reply(status, reply, {'Metadata-Flavor': 'Google'});
@@ -48,7 +49,7 @@ export function instanceId(
4849
reply = status;
4950
status = 200;
5051
}
51-
return nock('http://metadata.google.internal')
52+
return nock(HOST_ADDRESS)
5253
.get('/computeMetadata/v1/instance/id')
5354
.once()
5455
.reply(status, reply, {'Metadata-Flavor': 'Google'});
@@ -59,7 +60,7 @@ export function hostname(status: number|(() => string), reply?: () => string) {
5960
reply = status;
6061
status = 200;
6162
}
62-
return nock('http://metadata.google.internal')
63+
return nock(HOST_ADDRESS)
6364
.get('/computeMetadata/v1/instance/hostname')
6465
.once()
6566
.reply(status, reply, {'Metadata-Flavor': 'Google'});

test/test-no-self-tracing.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
'use strict';
1818

1919
import {FORCE_NEW} from '../src/util';
20+
import {HOST_ADDRESS} from 'gcp-metadata';
2021

2122
var assert = require('assert');
2223
var nock = require('nock');
@@ -32,7 +33,7 @@ nock.disableNetConnect();
3233

3334
describe('test-no-self-tracing', function() {
3435
it('should not trace metadata queries', function(done) {
35-
var scope = nock('http://metadata.google.internal')
36+
var scope = nock(HOST_ADDRESS)
3637
.get('/computeMetadata/v1/instance/hostname').reply(200)
3738
.get('/computeMetadata/v1/instance/id').reply(200);
3839
require('../..').start({[FORCE_NEW]: true});
@@ -46,7 +47,7 @@ describe('test-no-self-tracing', function() {
4647
});
4748

4849
it('should not trace publishes', function(done) {
49-
var metadataScope = nock('http://metadata.google.internal')
50+
var metadataScope = nock(HOST_ADDRESS)
5051
.get('/computeMetadata/v1/instance/hostname').reply(200)
5152
.get('/computeMetadata/v1/instance/id').reply(200);
5253
var apiScope = nock('https://cloudtrace.googleapis.com')

0 commit comments

Comments
 (0)