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:
commit
8c8b5ed418
@ -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])
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user