mirror of
https://github.com/mudler/luet.git
synced 2025-09-16 15:19:24 +00:00
🎨 Port package to types
This refactors DefaultPackage into types.Package and gets rid of the interface. This is a preceeding for a follow up where accessors will be removed from the code. It also does several cleanup, so we get rid also of some unneeded dependencies.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
// Copyright © 2019-2020 Ettore Di Giacinto <mudler@gentoo.org>
|
||||
// David Cassany <dcassany@suse.com>
|
||||
// Copyright © 2019-2022 Ettore Di Giacinto <mudler@gentoo.org>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@@ -18,18 +17,8 @@ package helpers
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/asaskevich/govalidator"
|
||||
)
|
||||
|
||||
func StripRegistryFromImage(image string) string {
|
||||
img := strings.SplitN(image, "/", 2)
|
||||
if len(img) == 2 && govalidator.IsURL(img[0]) {
|
||||
return img[1]
|
||||
}
|
||||
return image
|
||||
}
|
||||
|
||||
func SanitizeImageString(s string) string {
|
||||
return strings.ReplaceAll(s, "+", "-")
|
||||
}
|
||||
|
Reference in New Issue
Block a user