Allow repotest OCI server to bind to localhost

Signed-off-by: Chris Bruce <aprofessionalemailaddress@gmail.com>
pull/12978/head
Chris Bruce 5 months ago
parent 14d0c13e9e
commit 23d1794568

@ -93,6 +93,10 @@ func WithDependingChart(c *chart.Chart) OCIServerOpt {
}
func NewOCIServer(t *testing.T, dir string) (*OCIServer, error) {
return NewOCIServerWithBindAddress(t, dir, "")
}
func NewOCIServerWithBindAddress(t *testing.T, dir string, bindAddress string) (*OCIServer, error) {
testHtpasswdFileBasename := "authtest.htpasswd"
testUsername, testPassword := "username", "password"
@ -113,7 +117,7 @@ func NewOCIServer(t *testing.T, dir string) (*OCIServer, error) {
t.Fatalf("error finding free port for test registry")
}
config.HTTP.Addr = fmt.Sprintf(":%d", port)
config.HTTP.Addr = fmt.Sprintf("%s:%d", bindAddress, port)
config.HTTP.DrainTimeout = time.Duration(10) * time.Second
config.Storage = map[string]configuration.Parameters{"inmemory": map[string]interface{}{}}
config.Auth = configuration.Auth{

Loading…
Cancel
Save