diff --git a/README.md b/README.md index 8b4efdf..809f674 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # driver-vbox + kutti driver for Oracle VirtualBox [![Go Report Card](https://goreportcard.com/badge/github.com/kuttiproject/driver-vbox)](https://goreportcard.com/report/github.com/kuttiproject/driver-vbox) @@ -6,6 +7,7 @@ kutti driver for Oracle VirtualBox ![GitHub release (latest by date)](https://img.shields.io/github/v/release/kuttiproject/driver-vbox?include_prereleases) ## Images -This driver depends on VirtualBox VM images published via the [kuttiproject/driver-vbox-images](https://github.com/kuttiproject/driver-vbox-images) repository. The details of the driver-to-VM interface are documented there. -The releases of that repository are the default source for this driver. The list of available/deprecated images and the images themselves are published there. The releases match the major and minor versions of this repository, and vice versa. +This driver depends on VirtualBox VM images published via the [kuttiproject/driver-vbox-images](https://github.com/kuttiproject/driver-vbox-images) repository. The details of the driver-to-VM interface are documented there. + +The releases of that repository are the default source for this driver. The list of available/deprecated images and the images themselves are published there. The releases of that repository follow the major and minor versions of this repository, but sometimes may lag by one version. The `ImagesVersion` constant specifies the version of the images repository that is used by a particular version of this driver. diff --git a/driver.go b/driver.go index 09d61e1..6112d7a 100644 --- a/driver.go +++ b/driver.go @@ -22,7 +22,7 @@ type Driver struct { errormessage string } -// Name returns the "vbox" +// Name returns "vbox" func (vd *Driver) Name() string { return driverName } @@ -32,6 +32,11 @@ func (vd *Driver) Description() string { return driverDescription } +// UsesPerClusterNetworking returns true +func (vd *Driver) UsesPerClusterNetworking() bool { + return true +} + // UsesNATNetworking returns true func (vd *Driver) UsesNATNetworking() bool { return true diff --git a/drivervbox-imagemanagement.go b/drivervbox-imagemanagement.go index 7537b79..58b3045 100644 --- a/drivervbox-imagemanagement.go +++ b/drivervbox-imagemanagement.go @@ -10,10 +10,14 @@ import ( "github.com/kuttiproject/workspace" ) +// ImagesVersion defines the image repository version for the current version +// of the driver. +const ImagesVersion = "0.2" + const imagesConfigFile = "driver-vbox-images.json" // ImagesSourceURL is the location where the master list of images can be found -var ImagesSourceURL = "https://github.com/kuttiproject/driver-vbox-images/releases/download/v0.2/driver-vbox-images.json" +var ImagesSourceURL = "https://github.com/kuttiproject/driver-vbox-images/releases/download/v" + ImagesVersion + "/" + imagesConfigFile var ( imagedata = &imageconfigdata{} @@ -42,7 +46,7 @@ func (icd *imageconfigdata) Setdefaults() { } func vboxCacheDir() (string, error) { - return workspace.Cachesubdir("vbox") + return workspace.Cachesubdir("driver-vbox") } func vboxConfigDir() (string, error) { diff --git a/drivervbox.go b/drivervbox.go index 0e57a24..be2e550 100644 --- a/drivervbox.go +++ b/drivervbox.go @@ -10,7 +10,7 @@ import ( func init() { driver := newvboxdriver() - drivercore.RegisterDriver("vbox", driver) + drivercore.RegisterDriver(driverName, driver) } func newvboxdriver() *Driver { diff --git a/drivervbox_test.go b/drivervbox_test.go index 992113a..3aed9a6 100644 --- a/drivervbox_test.go +++ b/drivervbox_test.go @@ -76,7 +76,7 @@ func TestDriverVBox(t *testing.T) { <-time.After(5 * time.Second) - err = workspace.Set("/home/raj/projects/kuttiproject/driver-vbox/out") + err = workspace.Set("out/") if err != nil { t.Fatalf("Error: %v", err) } diff --git a/go.mod b/go.mod index 7b1edc9..b4ea490 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/kuttiproject/driver-vbox go 1.16 require ( - github.com/kuttiproject/drivercore v0.1.3 + github.com/kuttiproject/drivercore v0.2.0 github.com/kuttiproject/kuttilog v0.1.2 github.com/kuttiproject/workspace v0.2.2 ) diff --git a/go.sum b/go.sum index dc8e240..e01089f 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ github.com/kuttiproject/drivercore v0.1.3 h1:dX57IlZhYX2AZ3BVDWTF12mn35fK1/MV974r/WpSxvc= github.com/kuttiproject/drivercore v0.1.3/go.mod h1:1C1TMGfQ4u/5ltHUtl4hL7gYzXZyZQVhkOha4GuOzk0= +github.com/kuttiproject/drivercore v0.2.0 h1:RZI/azMsyI8gPidXzHPcZXqajHPdq+zaRg3W4x9ASC0= +github.com/kuttiproject/drivercore v0.2.0/go.mod h1:1C1TMGfQ4u/5ltHUtl4hL7gYzXZyZQVhkOha4GuOzk0= github.com/kuttiproject/kuttilog v0.1.2 h1:VEqVWrR3M6RME6aoUuVwXNO3bRpHKNp0ISAP/vqncpg= github.com/kuttiproject/kuttilog v0.1.2/go.mod h1:OO3dHpXm1/Pjlc57R4c0e/C+ZWkYlY3Fd9Ikn8xPXi4= github.com/kuttiproject/workspace v0.2.2 h1:1eNdMooB6Oq7jq2wodbuaY+IVZSYcEuXnqY3e00s64Y=