-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented delayed validation, and added FetchWithProgress to Image.
- Loading branch information
Showing
8 changed files
with
160 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// +build !windows | ||
//go:build !windows | ||
|
||
package drivervbox | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// +build windows | ||
//go:build windows | ||
|
||
package drivervbox | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,44 @@ | ||
package drivervbox | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/kuttiproject/drivercore" | ||
"github.com/kuttiproject/workspace" | ||
) | ||
|
||
func init() { | ||
driver := newvboxdriver() | ||
driver := &Driver{} //newvboxdriver() | ||
|
||
drivercore.RegisterDriver(driverName, driver) | ||
} | ||
|
||
func newvboxdriver() *Driver { | ||
result := &Driver{} | ||
|
||
// find VBoxManage tool and set it | ||
vbmpath, err := findvboxmanage() | ||
if err != nil { | ||
result.status = "Error" | ||
result.errormessage = err.Error() | ||
return result | ||
} | ||
|
||
result.vboxmanagepath = vbmpath | ||
|
||
// test VBoxManage version | ||
vbmversion, err := workspace.Runwithresults(vbmpath, "--version") | ||
if err != nil { | ||
result.status = "Error" | ||
result.errormessage = err.Error() | ||
return result | ||
} | ||
var majorversion int | ||
_, err = fmt.Sscanf(vbmversion, "%d", &majorversion) | ||
if err != nil || majorversion < 6 { | ||
err = fmt.Errorf("unsupported VBoxManage version %v. 6.0 and above are supported", vbmversion) | ||
result.status = "Error" | ||
result.errormessage = err.Error() | ||
return result | ||
} | ||
|
||
result.status = "Ready" | ||
return result | ||
} | ||
// func newvboxdriver() *Driver { | ||
// result := &Driver{} | ||
|
||
// // find VBoxManage tool and set it | ||
// vbmpath, err := findvboxmanage() | ||
// if err != nil { | ||
// result.status = "Error" | ||
// result.errormessage = err.Error() | ||
// return result | ||
// } | ||
|
||
// result.vboxmanagepath = vbmpath | ||
|
||
// // test VBoxManage version | ||
// vbmversion, err := workspace.Runwithresults(vbmpath, "--version") | ||
// if err != nil { | ||
// result.status = "Error" | ||
// result.errormessage = err.Error() | ||
// return result | ||
// } | ||
// var majorversion int | ||
// _, err = fmt.Sscanf(vbmversion, "%d", &majorversion) | ||
// if err != nil || majorversion < 6 { | ||
// err = fmt.Errorf("unsupported VBoxManage version %v. 6.0 and above are supported", vbmversion) | ||
// result.status = "Error" | ||
// result.errormessage = err.Error() | ||
// return result | ||
// } | ||
|
||
// result.status = "Ready" | ||
// return result | ||
// } |
Oops, something went wrong.