Closed deepy closed 4 months ago
regcred-test.yaml
gets saved in UTF-16LE and based on the fact that --cert mycert.pem
produces error: data does not contain any valid RSA or ECDSA certificates
and works fine when I convert it to UTF-8 probably confirms it
I encountered the same problem with Windows.
After a lot of wasted time I narrowed down the problem to my IDE was accidentally using an older version of PowerShell (powershell.exe
). If I used PowerShell 7/Core (pwsh.exe
) or cmd.exe
then things work as expected.
PowerShell 6 (bundled by default in Windows 10) and older versions use UTF-16LE, and in version 7 they changed the default to UTF-8
kubectl handles this just fine though, so people are unlikely to notice
If anyone else encounters these errors (Especially Windows) save the file with UTF-8 encoding.
Since the issue seems to be related to PowerShell version, we can close the issue
@agarcia-oss the issue is unrelated to the PowerShell version, the issue is that kubeseal fails silently. That it doesn't handle UTF-16LE is a different issue
Which component: kubeseal CLI 0.24.5
Describe the bug
kubeseal --scope cluster-wide -f regcred-test.yaml -w sealed-secret-regcred.yaml
writes an empty file, exits with 0, and gives no logs or explanation of whyTo Reproduce Steps to reproduce the behavior:
Expected behavior A sealed secret in
sealed-secret-regcred.yaml
or a message explaining what went wrongVersion of Kubernetes: 1.28.4
Additional context Logs from kubeseal -v 15
Nothing new in controller logs.
Run in Windows in Windows Terminal with PowerShell 5.1 (not cmd.exe)
Here's the content of
regcred-test.yaml