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
get vm by name instead of search in a list #151
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: xunpan 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 |
if len(guests) > 1 { | ||
// I noticed that IBM Cloud can use same name for 2 machines. | ||
// It is bad for our case. Print a message to make it to be noticed. | ||
klog.Errorf("Getting more than one virtual guest. The first is used.") |
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.
Print out the guest name here for better debug.
if len(guests) > 1 { | ||
// I noticed that IBM Cloud can use same name for 2 machines. | ||
// It is bad for our case. Print a message to make it to be noticed. | ||
klog.Errorf("Getting more than one virtual guests by filter (hostname=%s, domain=%s): %v. The first is used.", |
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.
How about The first host %s is used
?
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.
I use guest ID because names are the same when the issue happens.
addressed comments and rebase done |
/lgtm |
What this PR does / why we need it:
make code logic simple and clear.
Specify your PR reviewers:
/cc @gyliu513 @jichenjc
Special notes for your reviewer:
Still need to do below things in this PR before review