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

[8.x](backport #6675) resolve proxy to inject using http package #6756

Open
wants to merge 2 commits into
base: 8.x
Choose a base branch
from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Feb 7, 2025

What does this PR do?

Agent is injecting proxy env variables into components configs if no proxy is already specified by the config. Unfortunately with this approach the NO_PROXY variable is lost, so the target URL has to be evaluated against the environment proxy to determine if the proxy should be used. Go http provides such functionality.

Why is it important?

The environment proxy may be defined with exclusion for Fleet and Output addresses.

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

Related issues


This is an automatic backport of pull request #6675 done by [Mergify](https://mergify.com).

* resolve proxy to inject using http package

* unit tests

* golint

* golint

* changelog fragment

* changelog fragment

* move environment manipulation, trying to fix test run in CI

* fix unit test, localhost never goes through environment proxy

* use internal function to be able to unit test the behavior

* make lint happy

* fix build

* update NOTICE

(cherry picked from commit be179d8)
@mergify mergify bot requested a review from a team as a code owner February 7, 2025 15:38
@mergify mergify bot added the backport label Feb 7, 2025
@mergify mergify bot requested review from pkoutsovasilis and kaanyalti and removed request for a team February 7, 2025 15:38
@mergify mergify bot assigned intxgo Feb 7, 2025
@github-actions github-actions bot added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Feb 7, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@intxgo intxgo enabled auto-merge (squash) February 7, 2025 15:58
Copy link
Contributor Author

mergify bot commented Feb 10, 2025

This pull request has not been merged yet. Could you please review and merge it @intxgo? 🙏

@intxgo
Copy link
Contributor

intxgo commented Feb 11, 2025

/test

1 similar comment
@intxgo
Copy link
Contributor

intxgo commented Feb 12, 2025

/test

@intxgo
Copy link
Contributor

intxgo commented Feb 12, 2025

it seems the test environment won't heal itself, I'll re-try in a few weeks


=== FAIL: testing/integration TestFileBeatReceiver (0.00s)
--
  | otel_test.go:803:
  | Error Trace:	/opt/buildkite-agent/builds/bk-agent-prod-gcp-1739350151603109878/elastic/elastic-agent-extended-testing-bk/testing/integration/otel_test.
  | go:803
  | Error:      	Received unexpected error:
  | failed to find build at /opt/buildkite-agent/builds/bk-agent-prod-gcp-1739350151603109878/elastic/elastic-agent-extended-testing-bk/build/
  | distributions: stat /opt/buildkite-agent/builds/bk-agent-prod-gcp-1739350151603109878/elastic/elastic-agent-extended-testing-bk/build/distributions/elastic-agen
  | t-8.18.0-SNAPSHOT-linux-x86_64.tar.gz: no such file or directory
  | Test:       	TestFileBeatReceiver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants