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

Allow repotest OCI server to bind to localhost #12978

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brucec5
Copy link

@brucec5 brucec5 commented Apr 23, 2024

What this PR does / why we need it:

This adds a repotest.NewOCIServerWithBindAddress function for building an OCI server that binds to a specific address, eg.

ociServer, err := repotest.NewOCIServerWithBindAddress(t, repoDir, "localhost")

The current repotest.NewOCIServer function binds to an empty address, which means binding to all interfaces. This gets annoying when locally running tests that use repotest, as the Macos firewall dialog box will pop up every time you run tests.

I figured it would technically be backwards incompatible to just change repotest.NewOCIServer to bind to localhost instead of all interfaces, so I decided to split that out into a separate function. I assume most people probably don't rely on exposing the repotest server outside localhost (especially since the returned RegistryURL is for localhost), but someone could conceivably be depending on that.

Special notes for your reviewer:

I didn't see any test coverage for this function, so I'll probably need to write that if you think this change is a good idea.

If applicable:

  • this PR contains documentation
  • this PR contains unit tests
  • this PR has been tested for backwards compatibility

Signed-off-by: Chris Bruce <aprofessionalemailaddress@gmail.com>
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant