> +
> +   @Inject
> +   public DockerComputeServiceAdapter(DockerApi api) {
> +      this.api = checkNotNull(api, "api");
> +   }
> +
> +   @Override
> +   public NodeAndInitialCredentials<Container> 
> createNodeWithGroupEncodedIntoName(String group, String name,
> +                                                                             
>      Template template) {
> +      checkNotNull(template, "template was null");
> +      checkNotNull(template.getOptions(), "template options was null");
> +      DockerTemplateOptions templateOptions = 
> DockerTemplateOptions.class.cast(template.getOptions());
> +
> +      String imageId = checkNotNull(template.getImage().getId(), "template 
> image id must not be null");
> +      String loginUser = 
> template.getImage().getDefaultCredentials().getUser();
> +      String loginUserPassword = 
> template.getImage().getDefaultCredentials().getPassword();

Having a deeper look, the Image will already have the default credentials 
populated with the value of the `ComputeServiceProperties.IMAGE_LOGIN_USER` 
value, so it should be enough.

However, you should take into account here that the user can have used the 
`templateOptions` to override the username, the password, or the private key. 
The login options provided in the `templateOptions` take preference over the 
image defaults.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57/files#r12954809

Reply via email to