Skip to content

Commit

Permalink
libvirt: Add MachineDriverPath()
Browse files Browse the repository at this point in the history
  • Loading branch information
cfergeau authored and praveenkumar committed Feb 3, 2023
1 parent baebd65 commit e96b3bb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/crc/machine/driver_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package machine
import (
"encoding/json"
"errors"
"path/filepath"

"github.com/crc-org/crc/pkg/crc/constants"
"github.com/crc-org/crc/pkg/crc/machine/config"
"github.com/crc-org/crc/pkg/crc/machine/libvirt"
"github.com/crc-org/crc/pkg/libmachine"
Expand All @@ -18,7 +18,7 @@ func newHost(api libmachine.API, machineConfig config.MachineConfig) (*host.Host
if err != nil {
return nil, errors.New("Failed to marshal driver options")
}
return api.NewHost("libvirt", constants.BinDir(), json)
return api.NewHost("libvirt", filepath.Dir(libvirt.MachineDriverPath()), json)
}

/* FIXME: host.Host is only known here, and libvirt.Driver is only accessible
Expand Down
13 changes: 11 additions & 2 deletions pkg/crc/machine/libvirt/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@

package libvirt

import "fmt"
import (
"fmt"
"path/filepath"

"github.com/crc-org/crc/pkg/crc/constants"
)

const (
// Defaults
Expand All @@ -21,5 +26,9 @@ const (
)

var (
MachineDriverDownloadURL = fmt.Sprintf("https://github.com/crc-org/machine-driver-libvirt/releases/download/%s/crc-driver-libvirt", MachineDriverVersion)
MachineDriverDownloadURL = fmt.Sprintf("https://github.com/crc-org/machine-driver-libvirt/releases/download/%s/%s", MachineDriverVersion, MachineDriverCommand)
)

func MachineDriverPath() string {
return filepath.Join(constants.BinDir(), MachineDriverCommand)
}

0 comments on commit e96b3bb

Please sign in to comment.