Commit 38ac5e49 authored by Yann Hodique's avatar Yann Hodique Committed by GitHub

feat(op-deployer): add support for http locator (#13464)

* feat(op-deployer): add support for http locator

Given that the downloader code already supports it, we might as well offer the capability.

This is useful for pointing to local registries during development, without having to worry about SSL.

* update locator_test.go

http is now supported.
ftp can be used for unsupported scheme test.
parent 52c8da4d
...@@ -13,6 +13,7 @@ type schemeUnmarshaler func(string) (*Locator, error) ...@@ -13,6 +13,7 @@ type schemeUnmarshaler func(string) (*Locator, error)
var schemeUnmarshalerDispatch = map[string]schemeUnmarshaler{ var schemeUnmarshalerDispatch = map[string]schemeUnmarshaler{
"tag": unmarshalTag, "tag": unmarshalTag,
"file": unmarshalURL, "file": unmarshalURL,
"http": unmarshalURL,
"https": unmarshalURL, "https": unmarshalURL,
} }
......
...@@ -42,6 +42,14 @@ func TestLocator_Marshaling(t *testing.T) { ...@@ -42,6 +42,14 @@ func TestLocator_Marshaling(t *testing.T) {
}, },
err: false, err: false,
}, },
{
name: "valid HTTP URL",
in: "http://example.com",
out: &Locator{
URL: parseUrl(t, "http://example.com"),
},
err: false,
},
{ {
name: "valid file URL", name: "valid file URL",
in: "file:///tmp/artifacts", in: "file:///tmp/artifacts",
...@@ -64,7 +72,7 @@ func TestLocator_Marshaling(t *testing.T) { ...@@ -64,7 +72,7 @@ func TestLocator_Marshaling(t *testing.T) {
}, },
{ {
name: "unsupported scheme", name: "unsupported scheme",
in: "http://example.com", in: "ftp://example.com",
out: nil, out: nil,
err: true, err: true,
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment