feat: use distro info to create the container
This commit is contained in:
@ -20,19 +20,12 @@ func init() {
|
||||
}
|
||||
|
||||
for _, release := range releases {
|
||||
container := "out_of_tree_ubuntu_" + release
|
||||
container = strings.Replace(container, ".", "__", -1)
|
||||
|
||||
distro.Register(Ubuntu{
|
||||
release: release,
|
||||
container: container,
|
||||
})
|
||||
distro.Register(Ubuntu{release: release})
|
||||
}
|
||||
}
|
||||
|
||||
type Ubuntu struct {
|
||||
release string
|
||||
container string
|
||||
release string
|
||||
}
|
||||
|
||||
func (u Ubuntu) Equal(d distro.Distro) bool {
|
||||
@ -44,7 +37,7 @@ func (u Ubuntu) Distro() distro.Distro {
|
||||
}
|
||||
|
||||
func (u Ubuntu) Packages() (pkgs []string, err error) {
|
||||
c, err := container.New(u.container)
|
||||
c, err := container.New(u.Distro())
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
func TestUbuntu(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
u := Ubuntu{release: "22.04", container: "out_of_tree_ubuntu_22__04"}
|
||||
u := Ubuntu{release: "22.04"}
|
||||
|
||||
assert.True(u.Equal(distro.Distro{Release: "22.04", ID: distro.Ubuntu}))
|
||||
|
||||
|
Reference in New Issue
Block a user