Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix: Bypass proxy for GCE metadata server requests #15145

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

Merged
merged 5 commits into from
May 19, 2025

Conversation

eliekozah
Copy link
Contributor

@eliekozah eliekozah commented May 16, 2025

This resolves an issue where requests to the GCE metadata server (metadata.google.internal) could fail on GCE VMs if an HTTP/HTTPS proxy was configured


This change is Reviewable

@eliekozah eliekozah requested a review from a team as a code owner May 16, 2025 06:22
Copy link

codecov bot commented May 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.93%. Comparing base (67bbff6) to head (222bdec).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15145      +/-   ##
==========================================
- Coverage   92.93%   92.93%   -0.01%     
==========================================
  Files        2392     2392              
  Lines      215083   215085       +2     
==========================================
- Hits       199887   199885       -2     
- Misses      15196    15200       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

google/cloud/internal/curl_impl_test.cc Outdated Show resolved Hide resolved
Copy link
Member

@scotthart scotthart left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @ddelgrosso1)


google/cloud/internal/curl_impl.cc line 376 at r1 (raw file):

                                 "http://metadata.google.internal") ||
      absl::StartsWithIgnoreCase(this->url_,
                                 "https://metadata.google.internal")) {

I don't think we need to make this conditional, just always

  status = handle_.SetOption(CURLOPT_NOPROXY, "metadata.google.internal");
  if (!status.ok()) return OnTransferError(context, std::move(status));

And I don't think we need to emit any logging.

google/cloud/internal/curl_impl_test.cc Outdated Show resolved Hide resolved
@eliekozah
Copy link
Contributor Author

Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @ddelgrosso1)

google/cloud/internal/curl_impl.cc line 376 at r1 (raw file):

                                 "http://metadata.google.internal") ||
      absl::StartsWithIgnoreCase(this->url_,
                                 "https://metadata.google.internal")) {

I don't think we need to make this conditional, just always

  status = handle_.SetOption(CURLOPT_NOPROXY, "metadata.google.internal");
  if (!status.ok()) return OnTransferError(context, std::move(status));

And I don't think we need to emit any logging.

In this case should we just remove the unit tests?

scotthart
scotthart previously approved these changes May 16, 2025
Copy link
Member

@scotthart scotthart left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 2 files at r2, all commit messages.
Reviewable status: 1 of 2 files reviewed, 2 unresolved discussions (waiting on @ddelgrosso1 and @eliekozah)


google/cloud/internal/curl_impl.cc line 376 at r1 (raw file):

Previously, eliekozah (Elie Kozah) wrote…

In this case should we just remove the unit tests?

Yes.

google/cloud/internal/curl_impl_test.cc Outdated Show resolved Hide resolved
@ddelgrosso1 ddelgrosso1 merged commit 3bb14d8 into googleapis:main May 19, 2025
77 of 79 checks passed
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.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.