-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
health based check before polling vm #52
Conversation
@@ -22,7 +22,7 @@ type Hypervisor interface { | |||
|
|||
Modify(vmName string, cpus int, mem int) error | |||
|
|||
HealthCheck(vmName, property string) (*string, error) | |||
HealthCheck(vmName string) (*string, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why return *string? the string you assert on in the ip.go ("UP") is VirtualBox specific.
better to make it general. so it is either pass (return nil error) or return an error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed making this return boolean instead of string
|
||
// Wait for health status to be "Up" for up to 5 minutes | ||
timeout := time.After(5 * time.Minute) | ||
for *health != "Up" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
part of this logic is internal to VirtualBox (checking the "up" string), other part (the loop and the timeout thing) is general to all Healthchecks
I'll accept this PR and will open another PR to illustrate what I mean here ...
I'll accept this PR and will open another PR to let you know what I mean... will make you a reviewer |
closes #51