Skip to content

Commit

Permalink
Support sshkey from templatefile
Browse files Browse the repository at this point in the history
Signed-off-by: futuretea <[email protected]>
  • Loading branch information
futuretea committed May 22, 2023
1 parent 36626eb commit c1ea667
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Either remove unused ssh keys from "ssh_keys" or add ssh public keys to cloud-in
return nil
}

func inCloudConfig(parentKey, parent, key, value interface{}) bool {
func inCloudConfig(parentKey, parent, key interface{}, value string) bool {
switch section := parent.(type) {
case map[interface{}]interface{}:
for k, v := range section {
Expand All @@ -109,8 +109,10 @@ func inCloudConfig(parentKey, parent, key, value interface{}) bool {
}
}
case interface{}:
if parentKey == key && section == value {
return true
if parentKey == key {
if sectionStr, ok := section.(string); ok && strings.TrimSpace(sectionStr) == strings.TrimSpace(value) {
return true
}
}
}
return false
Expand Down

0 comments on commit c1ea667

Please sign in to comment.