mirror of
https://github.com/mudler/luet.git
synced 2025-09-12 21:33:31 +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
|
||||
@@ -28,22 +27,4 @@ var _ = Describe("Helpers", func() {
|
||||
Expect(SanitizeImageString("foo+bar")).To(Equal("foo-bar"))
|
||||
})
|
||||
})
|
||||
Context("StripRegistryFromImage", func() {
|
||||
It("Strips the domain name", func() {
|
||||
out := StripRegistryFromImage("valid.domain.org/base/image:tag")
|
||||
Expect(out).To(Equal("base/image:tag"))
|
||||
})
|
||||
It("Strips the domain name when port is included", func() {
|
||||
out := StripRegistryFromImage("valid.domain.org:5000/base/image:tag")
|
||||
Expect(out).To(Equal("base/image:tag"))
|
||||
})
|
||||
It("Does not strip the domain name", func() {
|
||||
out := StripRegistryFromImage("not-a-domain/base/image:tag")
|
||||
Expect(out).To(Equal("not-a-domain/base/image:tag"))
|
||||
})
|
||||
It("Does not strip the domain name on invalid domains", func() {
|
||||
out := StripRegistryFromImage("-invaliddomain.org/base/image:tag")
|
||||
Expect(out).To(Equal("-invaliddomain.org/base/image:tag"))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user