flyctl
flyctl copied to clipboard
flyctl secrets import should allow whitespace between key, value, and =
Describe the bug Secrets import still doesn't allow whitespace between key, value, and =.
$ cat /etc/os-release
NAME="Pop!_OS"
VERSION="22.04 LTS"
ID=pop
ID_LIKE="ubuntu debian"
PRETTY_NAME="Pop!_OS 22.04 LTS"
VERSION_ID="22.04"
HOME_URL="https://pop.system76.com"
SUPPORT_URL="https://support.system76.com"
BUG_REPORT_URL="https://github.com/pop-os/pop/issues"
PRIVACY_POLICY_URL="https://system76.com/privacy"
VERSION_CODENAME=jammy
UBUNTU_CODENAME=jammy
LOGO=distributor-logo-pop-os
$ flyctl version
flyctl v0.1.119 linux/amd64 Commit: e2d15d62a963c6a86daeefcfb435788575ba98f1 BuildDate: 2023-11-06T22:46:27Z
Command output:
$ cat .env
APP_ENV = production
$ cat .env | flyctl secrets import
Error: Validation failed: Name only allows letters, numbers, and underscores
Relates to: https://github.com/superfly/flyctl/issues/1710
Hey, did you got any workaround for that?
@thereis no, I was manually removing whitespace prior to running the command. It shouldn't be hard to strip the whitespace on the fly though.
I'm no Go engineer, but maybe someone can add the whitespace stripping here
And in the meantime, I think this may do. Removes blank lines first then removes whitespace surrounding =
cat .env | sed -r '/^\s*$/d' | sed -r 's/\s*=\s*/=/g' | flyctl secrets import