Skip to content

Host/username secret values contain trailing newlines, sanitization fix breaks SSH key #817

@audgirka

Description

@audgirka

Commit 83fe6f288 added tr -d '\n\r' to sanitize host and username values before base64 encoding in the host-access secret. This fixed trailing newlines in host/username but also stripped newlines from id_rsa, breaking the PEM format.

Commit 0e675cb76 reverted the fix entirely, which brought back the trailing newline problem — SSH fails with Could not resolve hostname because the host value includes \n.

Neither state works:

  • main (reverted): valid SSH key, broken hostname
  • 83fe6f288: clean hostname, broken SSH key

The fix is to sanitize host and username but not id_rsa:

host: $(cat /opt/host-info/host | tr -d '\n\r' | base64 -w0)
username: $(cat /opt/host-info/username | tr -d '\n\r' | base64 -w0)
id_rsa: $(cat /opt/host-info/id_rsa | base64 -w0)

Affects all tkn/infra-aws-*.yaml tasks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions