1
0
mirror of https://github.com/rancher/os.git synced 2025-08-01 15:08:47 +00:00

Merge pull request #1078 from imikushin/dont-lose-ssh-keys

Do not lose ssh keys from metadata if there are no ssh keys in cloud-config
This commit is contained in:
Darren Shepherd 2016-06-30 21:50:22 -07:00 committed by GitHub
commit 8c8b5ed418

View File

@ -144,12 +144,7 @@ func mergeMetadata(rawCfg map[interface{}]interface{}, md datasource.Metadata) m
sort.Sort(sort.StringSlice(keys))
currentKeys, ok := out["ssh_authorized_keys"]
if !ok {
return out
}
finalKeys := currentKeys.([]interface{})
finalKeys, _ := out["ssh_authorized_keys"].([]interface{})
for _, k := range keys {
finalKeys = append(finalKeys, md.SSHPublicKeys[k])
}