Skip to content

Fix malformed oneliner ca.crt in projected volumes#526

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-malformed-oneliner-ca-crt
Draft

Fix malformed oneliner ca.crt in projected volumes#526
Copilot wants to merge 2 commits intomainfrom
copilot/fix-malformed-oneliner-ca-crt

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 29, 2026

When KubernetesApiCaCrt is configured via tools like helm --set, newlines in the PEM certificate are collapsed into spaces, producing a malformed oneliner that gets written as-is to the projected volume ca.crt file and breaks TLS verification.

Changes

  • normalizePEMCertificate() — new function that detects oneliner PEM certs (no \n, but has both -----BEGIN and -----END markers) and restores proper formatting by converting the spaces around header/footer markers back to newlines
  • Applied at the point where KubernetesAPICaCrt is stored into projected volume data in remoteExecutionHandleProjectedSource()

Before / After:

# Malformed (from helm --set or similar)
-----BEGIN CERTIFICATE----- MIIBIjAN... -----END CERTIFICATE-----

# Normalized
-----BEGIN CERTIFICATE-----
MIIBIjAN...
-----END CERTIFICATE-----

Already properly-formatted multi-line certs pass through unchanged.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 29, 2026

Deploy Preview for interlink-dev canceled.

Name Link
🔨 Latest commit eacd2e7
🔍 Latest deploy log https://app.netlify.com/projects/interlink-dev/deploys/69f211d17e95000008a649d3

Copilot AI linked an issue Apr 29, 2026 that may be closed by this pull request
Add normalizePEMCertificate() to convert single-line PEM certs
(produced by tools like helm --set that collapse newlines) back to
proper multi-line PEM format before storing in projected volume data.

Fixes: Malformed oneliner in ca.crt for projected volumes

Agent-Logs-Url: https://github.com/interlink-hq/interLink/sessions/37d0f278-c6f8-4a1f-b1ac-9d76be1ed15b

Co-authored-by: dciangot <4144326+dciangot@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix malformed oneliner in ca.crt for projected volumes Fix malformed oneliner ca.crt in projected volumes Apr 29, 2026
Copilot AI requested a review from dciangot April 29, 2026 14:13
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.

Malformed oneliner in ca.crt for projected volumes

2 participants