Skip network and proxy creation when no credentials are present#534
Closed
Skip network and proxy creation when no credentials are present#534
Conversation
Co-authored-by: jakecoffman <886768+jakecoffman@users.noreply.github.com>
…ario Co-authored-by: jakecoffman <886768+jakecoffman@users.noreply.github.com>
Co-authored-by: jakecoffman <886768+jakecoffman@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add condition to handle absence of credentials for container network
Skip network and proxy creation when no credentials are present
Nov 6, 2025
Member
|
@copilot fix the CI errors |
Co-authored-by: jakecoffman <886768+jakecoffman@users.noreply.github.com>
Contributor
Author
... Fixed in commit 001ef59. The issue was that case-insensitive filesystem support requires networks to be created even when credentials are absent. Updated the logic to create networks when either credentials exist OR case-insensitive filesystem is needed, while the proxy is only created when credentials exist. |
Member
|
@copilot Fix these tests as well: I think the issue here is we are expecting to see certain output from the Proxy, but we aren't running the proxy since there are no credentials. Is there another way to assert? Or can we add an unrelated credential to the test so the Proxy starts up? |
Co-authored-by: jakecoffman <886768+jakecoffman@users.noreply.github.com>
Contributor
Author
Member
|
Will revisit soon, still think this is a good idea but things are getting messy. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Successfully implemented the optimization to skip creating Docker networks and starting the proxy container when there are no credentials to protect.
Changes Made
Technical Details
Modified Files
internal/infra/run.go:
hasCredentialscheck to determine if proxy should be createdneedsNetworkcheck for both credentials and case-insensitive filesysteminternal/infra/updater.go:
NewUpdaterto handle nil network and proxy parametersputUpdaterInputsto skip certificate copy when no proxy existsinternal/infra/run_test.go:
testdata/scripts/proxy.txt:
testdata/scripts/pypi.txt:
Benefits
Test Results
✅ SMB mount test passes (case-insensitive filesystem works)
✅ Proxy tests pass (with and without credentials)
✅ PyPI test updated to work with conditional proxy
✅ All unit tests pass
✅ All linting checks pass (gofmt, go vet)
✅ CodeQL security scan: 0 vulnerabilities
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.