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

Specifying instances by index ambiguous #605

Closed
risicle opened this issue Dec 20, 2022 · 3 comments
Closed

Specifying instances by index ambiguous #605

risicle opened this issue Dec 20, 2022 · 3 comments

Comments

@risicle
Copy link

risicle commented Dec 20, 2022

Using bosh-cli 7.1.0 on macos 12 (against BOSH 276.1.0), we noticed something that caught us off guard, and doesn't seem to be noted/acknowledged anywhere.

Because bosh-cli both attempts to support specifying instances by-index and by-guid-prefix, trying to e.g ssh in to router instance number 29 via bosh ssh router/29 will actually log you in to any instance you might happen to have with a guid beginning 29... in preference to the instance with index 29. It's not at all obvious when this has happened and could lead to some serious mistakes.

@beyhan
Copy link
Member

beyhan commented Dec 23, 2022

I couldn't reproduce this. I tested with bosh CLI version 7.0.1-799538d1 (there a no noticeable changes between 7.0.1 and 7.1.0) and bosh director version v276.0.0. I had three instances:

test/13099bcd-f2c7-4472-8359-66ab398e9b4a
test/2aa1bea1-7c74-4f50-87c3-ac435a47c41b
test/ffab33ac-c864-4d47-95b1-7126f320374d

With bosh -d test ssh test/1 I landed in the test/2aa1bea1-7c74-4f50-87c3-ac435a47c41b instance. With bosh bosh -d test ssh test/2 I landed in the test/ffab33ac-c864-4d47-95b1-7126f320374d instance. So the indexes were preferred.

Also looking into the bosh CLI code here and in bosh director here it should try to match the value after <job >/... to an index when it is only with digits (this line). Which director version do you use?

@risicle
Copy link
Author

risicle commented Dec 28, 2022

This is director version 276.1.1. I'm having trouble reproducing it myself but I saw it with my own eyes on a colleague's machine. Will see if I can get them to reproduce it.

@risicle
Copy link
Author

risicle commented Dec 28, 2022

Neither of us can reproduce this now so I'm going to close this issue. But I'm still suspicious that there may be an issue here.

@risicle risicle closed this as completed Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants