Skip to content

Commit

Permalink
fix(ketchup): Handling docker.io path to dockerhub
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <bob@vibioh.fr>
  • Loading branch information
ViBiOh committed Jun 17, 2021
1 parent 3ad4fbf commit 2548068
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 2 additions & 0 deletions pkg/ketchup/ketchups.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, "")
}
Expand Down
10 changes: 0 additions & 10 deletions pkg/model/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2548068

Please sign in to comment.