fix(providers): Name now returns podman or podman-launcher

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
This commit is contained in:
Fabrizio Sestito
2026-06-14 13:04:28 +02:00
committed by Alessio Biancalana
parent 603f41e58a
commit ffeba2b78b
3 changed files with 8 additions and 5 deletions
@@ -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",
+2 -4
View File
@@ -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) {