mirror of
https://github.com/89luca89/distrobox.git
synced 2026-08-19 01:14:49 -05:00
fix(providers): Name now returns podman or podman-launcher
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
This commit is contained in:
committed by
Alessio Biancalana
parent
603f41e58a
commit
ffeba2b78b
@@ -36,7 +36,7 @@ func TestNewAutoDetect(t *testing.T) {
|
||||
{
|
||||
name: "podman-launcher only",
|
||||
binaries: []string{"podman-launcher"},
|
||||
expectedName: "podman",
|
||||
expectedName: "podman-launcher",
|
||||
},
|
||||
{
|
||||
name: "nothing available",
|
||||
|
||||
@@ -54,7 +54,7 @@ func NewPodmanLauncher(root bool, sudoCommand string, verbose bool) *Podman {
|
||||
}
|
||||
|
||||
func (p *Podman) Name() string {
|
||||
return "podman"
|
||||
return string(p.command)
|
||||
}
|
||||
|
||||
// podmanContainer represents the JSON output from `podman ps --format json`.
|
||||
@@ -155,8 +155,6 @@ func (p *Podman) makeCreateCommand(
|
||||
distroboxExportPath string,
|
||||
distroboxHostexecPath string,
|
||||
) []string {
|
||||
containerManager := p.Name()
|
||||
|
||||
containerUserHome := userEnv.Home
|
||||
containerUserName := userEnv.User
|
||||
containerUserUID := userEnv.UserID
|
||||
@@ -207,7 +205,7 @@ func (p *Podman) makeCreateCommand(
|
||||
)
|
||||
options = append(options, "--env", fmt.Sprintf("SHELL=%s", shellFilepath))
|
||||
options = append(options, "--env", fmt.Sprintf("HOME=%s", containerUserHome))
|
||||
options = append(options, "--env", fmt.Sprintf("container=%s", containerManager))
|
||||
options = append(options, "--env", "container=podman")
|
||||
options = append(
|
||||
options,
|
||||
"--env",
|
||||
|
||||
@@ -612,6 +612,11 @@ func TestPodman_Name(t *testing.T) {
|
||||
if podman.Name() != "podman" {
|
||||
t.Errorf("Expected Name() to return 'podman', got '%s'", podman.Name())
|
||||
}
|
||||
|
||||
launcher := NewPodmanLauncher(false, "sudo", false)
|
||||
if launcher.Name() != "podman-launcher" {
|
||||
t.Errorf("Expected Name() to return 'podman-launcher', got '%s'", launcher.Name())
|
||||
}
|
||||
}
|
||||
|
||||
func TestParsePodmanContainerList(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user