GetKeyFile returns the path to the SSH key file for a given instance UUID. Falls back to empty string only if ThunderDir resolution fails, which callers should treat as "no cached key".
(uuid string)
| 10 | // Falls back to empty string only if ThunderDir resolution fails, which |
| 11 | // callers should treat as "no cached key". |
| 12 | func GetKeyFile(uuid string) string { |
| 13 | base, err := ThunderDir() |
| 14 | if err != nil { |
| 15 | return "" |
| 16 | } |
| 17 | return filepath.Join(base, "keys", uuid) |
| 18 | } |
| 19 | |
| 20 | // KeyExists checks if the SSH key file exists for a given UUID |
| 21 | func KeyExists(uuid string) bool { |