Skip to content

Conversation

@mergify
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) # Conflicts: #	NOTICE.txt #	go.mod
@mergify mergify bot requested a review from a team as a code owner February 7, 2025 15:38
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Feb 7, 2025
@mergify mergify bot requested review from michel-laterman and pkoutsovasilis and removed request for a team February 7, 2025 15:38
@mergify mergify bot assigned intxgo Feb 7, 2025
@mergify
Copy link
Contributor Author

mergify bot commented Feb 7, 2025

Cherry-pick of be179d8 has failed:

On branch mergify/bp/8.16/pr-6675 Your branch is up to date with 'origin/8.16'. You are currently cherry-picking commit be179d886. (fix conflicts and run "git cherry-pick --continue") (use "git cherry-pick --skip" to skip this patch) (use "git cherry-pick --abort" to cancel the cherry-pick operation) Changes to be committed:	new file: changelog/fragments/1738329703-environment-proxy-injection-fix.yaml	modified: internal/pkg/agent/application/inject_proxy_component_modifier.go	modified: internal/pkg/agent/application/inject_proxy_component_modifier_test.go Unmerged paths: (use "git add <file>..." to mark resolution)	both modified: NOTICE.txt	both modified: go.mod 

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@intxgo intxgo enabled auto-merge (squash) February 7, 2025 16:22
@mergify
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? 🙏

@pkoutsovasilis
Copy link
Contributor

@intxgo could you please take care of this PR? The NOTICE.txt needs update

@intxgo intxgo merged commit 87b7a8b into 8.16 Feb 11, 2025
14 checks passed
@intxgo intxgo deleted the mergify/bp/8.16/pr-6675 branch February 11, 2025 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport conflicts There is a conflict in the backported pull request

3 participants