This repository was archived by the owner on Apr 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 6868 "console-log-level" : " ^1.4.0" ,
6969 "extend" : " ^3.0.1" ,
7070 "findit2" : " ^2.2.3" ,
71- "gcp-metadata" : " ^0.9 .0" ,
71+ "gcp-metadata" : " ^1.0 .0" ,
7272 "lodash.pickby" : " ^4.6.0" ,
7373 "p-limit" : " ^2.0.0" ,
7474 "pify" : " ^4.0.1" ,
Original file line number Diff line number Diff line change 1414 * limitations under the License.
1515 */
1616
17+ import * as gcpMetadata from 'gcp-metadata' ;
1718import * as nock from 'nock' ;
1819
1920// In the future _=>true.
@@ -48,14 +49,14 @@ export function register(validator?: Validator): nock.Scope {
4849}
4950
5051export function projectId ( reply : string ) : nock . Scope {
51- return nock ( 'http://metadata.google.internal' )
52+ return nock ( gcpMetadata . HOST_ADDRESS )
5253 . get ( '/computeMetadata/v1/project/project-id' )
5354 . once ( )
5455 . reply ( 200 , reply ) ;
5556}
5657
5758export function metadataInstance ( ) : nock . Scope {
58- return nock ( 'http://metadata.google.internal/' )
59+ return nock ( gcpMetadata . HOST_ADDRESS )
5960 . get ( '/computeMetadata/v1/instance' )
6061 . replyWithError ( { code : 'ENOTFOUND' , message : 'nocked request' } ) ;
6162}
Original file line number Diff line number Diff line change 1616
1717import * as assert from 'assert' ;
1818import * as fs from 'fs' ;
19+ import * as gcpMetadata from 'gcp-metadata' ;
1920import * as path from 'path' ;
2021import * as proxyquire from 'proxyquire' ;
2122
@@ -728,7 +729,7 @@ describe('Debuglet', () => {
728729 return Promise . resolve ( true ) ;
729730 } ;
730731 const clusterScope =
731- nock ( 'http://metadata.google.internal' )
732+ nock ( gcpMetadata . HOST_ADDRESS )
732733 . get ( '/computeMetadata/v1/instance/attributes/cluster-name' )
733734 . once ( )
734735 . reply ( 200 , 'cluster-name-from-metadata' ) ;
You can’t perform that action at this time.
0 commit comments