Skip to content

Commit

Permalink
feat(op-deployer): add support for http locator (#13464)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
sigma authored Dec 18, 2024
1 parent 52c8da4 commit 38ac5e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions op-deployer/pkg/deployer/artifacts/locator.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type schemeUnmarshaler func(string) (*Locator, error)
var schemeUnmarshalerDispatch = map[string]schemeUnmarshaler{
"tag": unmarshalTag,
"file": unmarshalURL,
"http": unmarshalURL,
"https": unmarshalURL,
}

Expand Down
10 changes: 9 additions & 1 deletion op-deployer/pkg/deployer/artifacts/locator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ func TestLocator_Marshaling(t *testing.T) {
},
err: false,
},
{
name: "valid HTTP URL",
in: "http://example.com",
out: &Locator{
URL: parseUrl(t, "http://example.com"),
},
err: false,
},
{
name: "valid file URL",
in: "file:///tmp/artifacts",
Expand All @@ -64,7 +72,7 @@ func TestLocator_Marshaling(t *testing.T) {
},
{
name: "unsupported scheme",
in: "http://example.com",
in: "ftp://example.com",
out: nil,
err: true,
},
Expand Down

0 comments on commit 38ac5e4

Please sign in to comment.