Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update server.js #617

Closed
wants to merge 13 commits into from
Closed

Update server.js #617

wants to merge 13 commits into from

Conversation

michaelawyu
Copy link
Contributor

/computeMetadata/v1/instance/network-interfaces is not support in standard.

`/computeMetadata/v1/instance/network-interfaces` is not support in standard.
@codecov
Copy link

codecov bot commented May 12, 2018

Codecov Report

Merging #617 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #617   +/-   ##
=======================================
  Coverage   48.52%   48.52%           
=======================================
  Files           1        1           
  Lines          68       68           
=======================================
  Hits           33       33           
  Misses         35       35

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f6c836...25becdd. Read the comment docs.

@@ -22,31 +22,32 @@ const request = require('got');
const app = express();
app.enable('trust proxy');

const METADATA_NETWORK_INTERFACE_URL = 'http://metadata/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip';
const METADATA_PROJECT_ID_URL = 'http://metadata.google.internal/computeMetadata/' +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can this be on one line? (You may have to add an // eslint-disable at the end of it if you get linter issues.)

const options = {
headers: {
'Metadata-Flavor': 'Google'
},
json: true
json: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: do we need to explicitly specify this?

.then((response) => response.body)
.catch((err) => {
if (err && err.statusCode !== 200) {
console.log('Error while talking to metadata server, assuming localhost');
return 'localhost';
console.log('Error while talking to metadata server, assuming UnknownProjectID');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use a more obvious default value? Or perhaps throw an error outright?

@michaelawyu
Copy link
Contributor Author

@ace-n Updated as requested, thanks :)

@michaelawyu michaelawyu deleted the michaelawyu-patch-2 branch May 23, 2018 00:55
ahrarmonsur pushed a commit that referenced this pull request Nov 8, 2022
* build!: Update library to use Node 12
Co-authored-by: Summer Ji <[email protected]>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
ace-n pushed a commit that referenced this pull request Nov 10, 2022
* build!: Update library to use Node 12
Co-authored-by: Summer Ji <[email protected]>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
NimJay pushed a commit that referenced this pull request Nov 19, 2022
🤖 I have created a release *beep* *boop*
---


## [4.1.0](googleapis/nodejs-dataproc@v4.0.1...v4.1.0) (2022-09-22)


### Features

* Add support for Dataproc metric configuration ([#626](googleapis/nodejs-dataproc#626)) ([79a4958](googleapis/nodejs-dataproc@79a4958))
* Support regapic LRO ([350626e](googleapis/nodejs-dataproc@350626e))


### Bug Fixes

* Allow passing gax instance to client constructor ([#612](googleapis/nodejs-dataproc#612)) ([caba80a](googleapis/nodejs-dataproc@caba80a))
* **deps:** Do not depend on protobufjs ([#607](googleapis/nodejs-dataproc#607)) ([4b62ef6](googleapis/nodejs-dataproc@4b62ef6))
* **deps:** Roll back dependency @google-cloud/dataproc to ^4.0.0 ([#627](googleapis/nodejs-dataproc#627)) ([e1c6d8b](googleapis/nodejs-dataproc@e1c6d8b))
* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-dataproc/issues/1553)) ([#617](googleapis/nodejs-dataproc#617)) ([2e2bea1](googleapis/nodejs-dataproc@2e2bea1))
* Preserve default values in x-goog-request-params header ([#620](googleapis/nodejs-dataproc#620)) ([484a023](googleapis/nodejs-dataproc@484a023))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
NimJay pushed a commit that referenced this pull request Nov 19, 2022
🤖 I have created a release *beep* *boop*
---


## [4.1.0](googleapis/nodejs-dataproc@v4.0.1...v4.1.0) (2022-09-22)


### Features

* Add support for Dataproc metric configuration ([#626](googleapis/nodejs-dataproc#626)) ([79a4958](googleapis/nodejs-dataproc@79a4958))
* Support regapic LRO ([350626e](googleapis/nodejs-dataproc@350626e))


### Bug Fixes

* Allow passing gax instance to client constructor ([#612](googleapis/nodejs-dataproc#612)) ([caba80a](googleapis/nodejs-dataproc@caba80a))
* **deps:** Do not depend on protobufjs ([#607](googleapis/nodejs-dataproc#607)) ([4b62ef6](googleapis/nodejs-dataproc@4b62ef6))
* **deps:** Roll back dependency @google-cloud/dataproc to ^4.0.0 ([#627](googleapis/nodejs-dataproc#627)) ([e1c6d8b](googleapis/nodejs-dataproc@e1c6d8b))
* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-dataproc/issues/1553)) ([#617](googleapis/nodejs-dataproc#617)) ([2e2bea1](googleapis/nodejs-dataproc@2e2bea1))
* Preserve default values in x-goog-request-params header ([#620](googleapis/nodejs-dataproc#620)) ([484a023](googleapis/nodejs-dataproc@484a023))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants