> +             }
> +
> +             // Add metadata from template and for ssh key and image id
> +             newInstance.metadata().putAll(options.getUserMetadata());
> +
> +             LoginCredentials credentials = resolveNodeCredentials(template);
> +             if (options.getPublicKey() != null) {
> +                     newInstance.metadata().put("sshKeys", format("%s:%s 
> %s@localhost", credentials.getUser(), options.getPublicKey(), 
> credentials.getUser()));
> +             }
> +
> +             String zone = template.getLocation().getId();
> +             InstanceApi instanceApi = api.instancesInZone(zone);
> +             Operation create = instanceApi.create(newInstance);
> +
> +             // TODO: What does this AtomicReference do?
> +             // TODO: What's the differenc between AttachDisk and 
> Instance.AttachedDisk and can they be refactored together?

Refactoring Instance.AttachedDisk and AttachDisk to be one object is a good 
idea. I'm not sure what this AtomicReference does, the comment is a little 
cryptic. 



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

Reply via email to