Skip to content
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

Merged
merged 3 commits into from May 21, 2019
Merged

get vm by name instead of search in a list #151

merged 3 commits into from May 21, 2019

Conversation

xunpan
Copy link
Contributor

@xunpan xunpan commented May 17, 2019

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

  • cover domain filter
  • test function

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 17, 2019
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 17, 2019
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 17, 2019
@xunpan xunpan changed the title WIP get vm by name instead of search in a list get vm by name instead of search in a list May 20, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 20, 2019
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.")
Copy link
Contributor

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.",
Copy link
Contributor

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?

Copy link
Contributor Author

@xunpan xunpan May 21, 2019

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.

@xunpan
Copy link
Contributor Author

xunpan commented May 21, 2019

addressed comments and rebase done

@gyliu513

@gyliu513
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 21, 2019
@k8s-ci-robot k8s-ci-robot merged commit 76ea8b4 into kubernetes-sigs:master May 21, 2019
@xunpan xunpan deleted the get-vm branch May 24, 2019 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants