Skip to content

Commit

Permalink
Remove unused user parameter
Browse files Browse the repository at this point in the history
Signed-off-by: German Maglione <[email protected]>
  • Loading branch information
germag committed Jul 8, 2024
1 parent 5312ba9 commit 34ea90f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func doRun(flags *cobra.Command, args []string) error {
}

//podman machine connection
machineInfo, err := utils.GetMachineInfo(user)
machineInfo, err := utils.GetMachineInfo()
if err != nil {
return err
}
Expand Down
8 changes: 3 additions & 5 deletions pkg/utils/podman.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
"os/exec"
"strings"

"github.com/containers/podman-bootc/pkg/user"

"github.com/containers/podman/v5/pkg/machine"
"github.com/containers/podman/v5/pkg/machine/define"
"github.com/containers/podman/v5/pkg/machine/env"
Expand All @@ -22,13 +20,13 @@ type MachineInfo struct {
Rootful bool
}

func GetMachineInfo(user user.User) (*MachineInfo, error) {
func GetMachineInfo() (*MachineInfo, error) {
minfo, err := getMachineInfo()
if err != nil {
var errIncompatibleMachineConfig *define.ErrIncompatibleMachineConfig
var errVMDoesNotExist *define.ErrVMDoesNotExist
if errors.As(err, &errIncompatibleMachineConfig) || errors.As(err, &errVMDoesNotExist) {
minfo, err := getPv4MachineInfo(user)
minfo, err := getPv4MachineInfo()
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -71,7 +69,7 @@ func getMachineInfo() (*MachineInfo, error) {
}

// Just to support podman v4.9, it will be removed in the future
func getPv4MachineInfo(user user.User) (*MachineInfo, error) {
func getPv4MachineInfo() (*MachineInfo, error) {
//check if a default podman machine exists
listCmd := exec.Command("podman", "machine", "list", "--format", "json")
var listCmdOutput strings.Builder
Expand Down
2 changes: 1 addition & 1 deletion podman-bootc.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func cleanup() {
}

//podman machine connection
machineInfo, err := utils.GetMachineInfo(user)
machineInfo, err := utils.GetMachineInfo()
if err != nil {
logrus.Errorf("unable to get podman machine info: %s", err)
os.Exit(1)
Expand Down

0 comments on commit 34ea90f

Please sign in to comment.