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

Remove custom http transport in git resolver #1231

Merged
merged 1 commit into from
Jun 8, 2023

Conversation

tomkennedy513
Copy link
Collaborator

@tomkennedy513 tomkennedy513 commented Jun 6, 2023

The default http transport will handle proxy logic so there isnt a need for us to create our own transport

- The default http transport will handle proxy logic so there isnt a
  need for us to create our own transport
@tomkennedy513 tomkennedy513 force-pushed the remote-got-resolver-init branch from 493be17 to cf11558 Compare June 7, 2023 13:17
@tomkennedy513 tomkennedy513 changed the title Resolve concurrent map write error in remote git resolver Remove custom http transport in git resolver Jun 7, 2023
Comment on lines -112 to -119
it("uses the http proxy env vars", func() {
require.NoError(t, os.Setenv("HTTPS_PROXY", "http://invalid-proxy"))
defer os.Unsetenv("HTTPS_PROXY")

err := fetcher.Fetch(testDir, "https://github.com/git-fixtures/basic", "master", metadataDir)
require.Error(t, err)
require.Contains(t, err.Error(), "proxyconnect tcp: dial tcp")
})
Copy link
Contributor

Choose a reason for hiding this comment

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

Were you able to verify that HTTPS_PROXY is supported out of the box? I still think it's valuable to test it, but I can't get this test to work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I ran a proxy locally and saw that it was attempting to reach git through the proxy. I think the problem with the tests is that they're running in parallel and attempting to use a shared environment variable. I personally don't see a ton of value on this test because we are basically testing the go http proxy package for this particular use case and not any of the other instances where kpack may need to utilize a proxy with the same default transport (i.e. registry access)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If you focus that test with the changes in the PR then you it will use the proxy.

Copy link
Contributor

Choose a reason for hiding this comment

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

The main reason I wanted to test it is that the proxy logic is hidden under so many layers of abstraction that there's no way of knowing it's even a thing if it's not explicitly called out in the docs or code.

Copy link
Contributor

Choose a reason for hiding this comment

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

There might be a conversation for a integration test instead of unit, but as long as it was at least tested manually I'm fine with this

@tomkennedy513 tomkennedy513 merged commit 26d32c1 into main Jun 8, 2023
@tomkennedy513 tomkennedy513 deleted the remote-got-resolver-init branch June 8, 2023 19:52
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