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

feat: add proxy settings to git client #3461

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

abelhoula
Copy link

No description provided.

@abelhoula abelhoula requested a review from a team as a code owner February 7, 2025 12:58
Copy link

netlify bot commented Feb 7, 2025

Deploy Preview for docs-kargo-io canceled.

Name Link
🔨 Latest commit aa6180b
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-io/deploys/67adf9a613d32800081f8d1b

@abelhoula abelhoula changed the title add proxy settings to git client feat: add proxy settings to git client Feb 7, 2025
@abelhoula
Copy link
Author

related to #3452

@hiddeco
Copy link
Contributor

hiddeco commented Feb 11, 2025

I think the correct patch would be:

	if b.creds != nil && b.creds.Password != "" {
		cmd.Env = append(cmd.Env, "GIT_ASKPASS=/usr/local/bin/credential-helper")
		cmd.Env = append(cmd.Env, fmt.Sprintf("GIT_PASSWORD=%s", b.creds.Password))
	}
	if httpProxy := os.Getenv("HTTP_PROXY"); httpProxy != "" {
		cmd.Env = append(cmd.Env, fmt.Sprintf("http_proxy=%s", httpProxy))
	}
	if httpsProxy := os.Getenv("HTTPS_PROXY"); httpsProxy != ""
		cmd.Env = append(cmd.Env, fmt.Sprintf("https_proxy=%s", httpsProxy))
	}

As you can have a proxy set without having credentials set, and you can have a HTTP proxy set without the HTTP/S proxy being set.

Copy link

codecov bot commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 52.24%. Comparing base (e0f0daa) to head (aa6180b).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
internal/controller/git/base_repo.go 0.00% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3461      +/-   ##
==========================================
- Coverage   52.25%   52.24%   -0.02%     
==========================================
  Files         290      290              
  Lines       26306    26313       +7     
==========================================
  Hits        13747    13747              
- Misses      11809    11814       +5     
- Partials      750      752       +2     

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

@abelhoula abelhoula requested a review from krancour February 14, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants