-
Notifications
You must be signed in to change notification settings - Fork 55
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
BROOKLYN-259: Fix JcloudsByonLocationResolver #132
BROOKLYN-259: Fix JcloudsByonLocationResolver #132
Conversation
bae0726
to
66be0cb
Compare
public static final ConfigKey<Supplier<? extends List<? extends MachineLocation>>> INITIAL_MACHINES_FACTORY = ConfigKeys.newConfigKey( | ||
new TypeToken<Supplier<? extends List<? extends MachineLocation>>>() {}, | ||
"byon.initialMachinesFactory", | ||
"Factory for creating the machines that should be immediatly instantiated on init", |
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.
immediatly
Looks good, only a few minor comments. Believe @johnmccabe is testing this with a deployment. |
Throwing an NPE when deploying an app to a JcloudsByonLocation that was working before this PR:
Example location:
Not clear why its not getting at the creds yet. |
assertEquals(machine.getPrivateAddresses(), ImmutableSet.of(nodePrivateAddress)); | ||
|
||
// TODO what user/password should we expect? Fails below because has "dummy": | ||
// assertEquals(machine.getUser(), "myuser"); |
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 is whats throwing the NPE mentioned earlier (ie machine.getUser()
returns null, previously it was these user/password values that were being used.
Looks like Theres no support for |
Spoke too soon on the location working with privateKey, throws an NPE when deploying a docker infrastructure via Clocker:
|
@aledsage important comments from @johnmccabe need addressing before can merge |
- Previously, it created locations every time the resolver was called (even if that was just to query about what it would produce), which caused us to leak locations. - Now it defers creating the locations (though doing this with LocationSpec is not practical because of the relationship between the JcloudsLocation and the machines)! - Adds FixedListMachineProvisioningLocation.initialMachinesFactory, for deferring the machine-lookup until the byon location is really being created.
66be0cb
to
a927f66
Compare
Rebasing fixed the problem in my test where For "NPE when deploying a docker infrastructure via Clocker", that has been fixed in a separate PR by the looks of it (certainly we guard against that NPE). See commit bee832d. I've confirmed that it works with username using @johnmccabe can you review / test again with this latest code when you get a chance? |
@aledsage testing this at the moment |
@johnmccabe did you get a chance to test this? Any comments? Can we merge it? |
Hi @aledsage, sorry for the delay getting back to you, the env I had originally observed this on is still inaccessible so I had to recreate, unfortunately, still seeing an NPE when attempting to deploy to the following location (
I'm going to rebuild to sanity check my install (I've built clocker against the #132 brooklyn-server branch). |
Rebuild appears to have done the trick, in the process of deploying a simple test app.
|
LGTM, thanks @aledsage |
Great, thanks @johnmccabe - merging now! |
(even if that was just to query about what it would produce), which
caused us to leak locations.
LocationSpec is not practical because of the relationship between
the JcloudsLocation and the machines)!
for deferring the machine-lookup until the byon location is really
being created.