From b6edde6052c9595b294e503b6526b9e970611561 Mon Sep 17 00:00:00 2001 From: Ivan Mikushin Date: Thu, 30 Jun 2016 14:21:41 -0700 Subject: [PATCH] Do not lose ssh keys from metadata if there are no ssh keys in cloud-config --- config/disk.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/config/disk.go b/config/disk.go index 2e330dae..6e3cbb04 100644 --- a/config/disk.go +++ b/config/disk.go @@ -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]) }