Skip to content

fix: propagate errors from known_hosts setup instead of silently ignoring#155

Merged
creydr merged 1 commit into
functions-dev:mainfrom
creydr:fix/known-hosts-error-propagation
May 20, 2026
Merged

fix: propagate errors from known_hosts setup instead of silently ignoring#155
creydr merged 1 commit into
functions-dev:mainfrom
creydr:fix/known-hosts-error-propagation

Conversation

@creydr
Copy link
Copy Markdown
Collaborator

@creydr creydr commented May 20, 2026

Summary

  • Replaces the nested if err == nil chain in getSSHClientOptions with proper error returns when known_hosts temp file creation, writing, or callback setup fails
  • Cleans up temp files on each error path to prevent leaks
  • Adds test for the known_hosts happy path

Previously, if a user provided known_hosts data but the setup failed (e.g. temp file write error), the error was silently swallowed and the connection fell back to insecure mode without any indication.

…ring them

When a user provides known_hosts data in the auth secret, errors during
temp file creation, writing, or callback setup were silently swallowed,
causing silent fallback to no host key verification. Now these errors
are returned so the operator knows when known_hosts setup fails.
@creydr creydr enabled auto-merge May 20, 2026 15:15
@creydr creydr added this pull request to the merge queue May 20, 2026
Merged via the queue into functions-dev:main with commit a76ad47 May 20, 2026
11 checks passed
@creydr creydr deleted the fix/known-hosts-error-propagation branch May 20, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant