Skip to content

Commit

Permalink
feat: allow for configuring the docker hub url via the API
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Larwig <[email protected]>
  • Loading branch information
tuunit committed Jan 8, 2025
1 parent 8ca455e commit d33cf33
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/pkg/reg/adapter/dockerhub/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ func newAdapter(registry *model.Registry) (adp.Adapter, error) {
return nil, err
}

var registryURL string
if registry.URL != baseURL {
registryURL = registry.URL
} else {
registryURL = defaultRegistryURL
}

return &adapter{
client: client,
registry: registry,
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/reg/adapter/dockerhub/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import "fmt"

const (
baseURL = "https://hub.docker.com"
registryURL = "https://registry-1.docker.io"
defaultRegistryURL = "https://registry-1.docker.io"
loginPath = "/v2/users/login/"
listNamespacePath = "/v2/repositories/namespaces"
createNamespacePath = "/v2/orgs/"
Expand Down

0 comments on commit d33cf33

Please sign in to comment.