FIX #2561 SSH pubkey should have username comment

Signed-off-by: David Gageot <david@gageot.net>
This commit is contained in:
David Gageot 2015-12-15 11:12:53 +01:00
parent c14770f395
commit b995a4d65a
1 changed files with 1 additions and 1 deletions

View File

@ -297,7 +297,7 @@ func (c *ComputeUtil) createInstance(d *Driver) error {
} }
log.Infof("Uploading SSH Key") log.Infof("Uploading SSH Key")
metaDataValue := c.userName + ":" + string(sshKey) + "\n" metaDataValue := fmt.Sprintf("%s:%s %s\n", c.userName, strings.TrimSpace(string(sshKey)), c.userName)
op, err = c.service.Instances.SetMetadata(c.project, c.zone, c.instanceName, &raw.Metadata{ op, err = c.service.Instances.SetMetadata(c.project, c.zone, c.instanceName, &raw.Metadata{
Fingerprint: instance.Metadata.Fingerprint, Fingerprint: instance.Metadata.Fingerprint,
Items: []*raw.MetadataItems{ Items: []*raw.MetadataItems{