diff --git a/pkg/ketchup/ketchups.go b/pkg/ketchup/ketchups.go index f9c46223..b9aa3d6c 100644 --- a/pkg/ketchup/ketchups.go +++ b/pkg/ketchup/ketchups.go @@ -57,6 +57,8 @@ func (a app) handleCreate(w http.ResponseWriter, r *http.Request) { switch repositoryKind { case model.Helm: repository = model.NewHelmRepository(0, strings.TrimSuffix(name, "/"), r.FormValue("part")) + case model.Docker: + repository = model.NewRepository(0, repositoryKind, strings.TrimPrefix(name, "docker.io/"), "") default: repository = model.NewRepository(0, repositoryKind, name, "") } diff --git a/pkg/model/repository.go b/pkg/model/repository.go index 6b37806a..81e50a18 100644 --- a/pkg/model/repository.go +++ b/pkg/model/repository.go @@ -81,16 +81,6 @@ func NewHelmRepository(id uint64, name, part string) Repository { return NewRepository(id, Helm, name, part) } -// NewDockerRepository create new Repository with initialized values -func NewDockerRepository(id uint64, name string) Repository { - return NewRepository(id, Docker, name, "") -} - -// NewNPMRepository create new Repository with initialized values -func NewNPMRepository(id uint64, name string) Repository { - return NewRepository(id, NPM, name, "") -} - // AddVersion adds given pattern to versions map func (r Repository) AddVersion(pattern, version string) Repository { r.Versions[pattern] = version