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
Bug 1979038: oVirt: include master IPs when running must gather #5039
Bug 1979038: oVirt: include master IPs when running must gather #5039
Conversation
37a43c9
to
5c4f71d
Compare
pkg/terraform/gather/ovirt/ip.go
Outdated
|
||
reportedDeviceSlice, err := getReportedDevices(c, moRefValue) | ||
client, err := ovirt.NewConnection() |
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 are we creating a new oVirt connection here?
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.
moved to the connection one level up (outside the for loop)
@@ -69,52 +76,54 @@ func findVirtualMachineIP(c *ovirtsdk4.Connection, moRefValue string) (string, e | |||
ipres, hasAddress := ip.Address() | |||
if hasAddress { | |||
if checkPortIsOpen(ipres, bootstrapSSHPort) { | |||
logrus.Debugf("ovirt vm id: %s , found usable bootstrap IP %s", moRefValue, ipres) | |||
logrus.Debugf("ovirt vm id: %s , found usable IP Address: %s", moRefValue, ipres) |
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.
Is this log useful to the user anyhow or is this just debug code?
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.
its for debug
pkg/terraform/gather/ovirt/ip.go
Outdated
defer client.Close() | ||
|
||
|
||
reportedDeviceSlice, err := getReportedDevices(client, moRefValue) | ||
if err != nil { | ||
return "", err |
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.
This error should possibly be wrapped so we have context.
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.
done
pkg/terraform/gather/ovirt/ip.go
Outdated
} | ||
|
||
if len(br.Instances) == 0 { | ||
return "", errors.New("no bootstrap instance found") | ||
return []string{""}, errors.New(fmt.Sprintf("no %s instance found",name)) |
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.
Returning an empty IP seems like a workaround for something. It seems that this should not be handled here. If yes, we should add comments explaining what this does and why it is ok to return an empty string IP.
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.
okay , in case of error we can return nil instead
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.
done
// BootstrapIP returns the ip address for bootstrap host. | ||
func BootstrapIP(tfs *terraform.State) (string, error) { | ||
ips, err := lookupVMResources(tfs, "module.bootstrap", "bootstrap") | ||
return ips[0], err |
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.
Add error handling here if ips has no entries.
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.
After the last update this will cause a panic.
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.
done
pkg/terraform/gather/ovirt/ip.go
Outdated
} | ||
ip, err := findVirtualMachineIP(vmid) | ||
if err != nil { | ||
return []string{""}, errors.Wrapf(err, "failed to lookup %s ipv4 address",name) |
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.
Same as above.
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.
done
75cfb4e
to
a112ffe
Compare
pkg/terraform/gather/ovirt/ip.go
Outdated
func findVirtualMachineIP(c *ovirtsdk4.Connection, moRefValue string) (string, error) { | ||
|
||
reportedDeviceSlice, err := getReportedDevices(c, moRefValue) | ||
func findVirtualMachineIP(moRefValue string,client *ovirtsdk4.Connection) (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.
This change seems unnecessary. Not a big deal, but still.
// BootstrapIP returns the ip address for bootstrap host. | ||
func BootstrapIP(tfs *terraform.State) (string, error) { | ||
ips, err := lookupVMResources(tfs, "module.bootstrap", "bootstrap") | ||
return ips[0], err |
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.
After the last update this will cause a panic.
16663ca
to
f370157
Compare
`gather bootstrap` command will collect logs from the VMs only if the boostrap VM still exists. this change adds the control planes VMs IP information, resulting the master logs to be collected as well. Signed-off-by: Evgeny Slutsky <eslutsky@redhat.com>
f370157
to
d19e8c6
Compare
/assign @crawford |
@eslutsky: This pull request references Bugzilla bug 1979038, which is valid. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Bugzilla (mburman@redhat.com), skipping review request. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jhixson74 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Please review the full test history for this PR and help us cut down flakes. |
5 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
@eslutsky: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest Please review the full test history for this PR and help us cut down flakes. |
@eslutsky: All pull requests linked via external trackers have merged: Bugzilla bug 1979038 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
gather bootstrap
command will collect logs from the VMs only if the boostrap VM still exists.this change adds the control planes VMs IP information, resulting the master logs
to be collected as well.
Signed-off-by: Evgeny Slutsky eslutsky@redhat.com