nroi / flexo

a central pacman cache
MIT License
172 stars 10 forks source link

FLEXO_PORT env var can conflict with k8s services env vars #70

Closed jraby closed 3 years ago

jraby commented 3 years ago

Hi,

I was trying to deploy flexo to a kubernetes cluster and ran into this error while trying to run it without a config file:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { inner: ErrorInner { kind: UnquotedString, line: Some(0), col: 8, at: Some(8), message: "", key: [] } }', src/mirror_config.rs:156:68

It turns out that if a k8s service named flexo exists, k8s will inject a conflicting FLEXO_PORT var into the container's environment, leading to that error. (something like FLEXO_PORT=tcp://10.43.0.4:7878 which is not valid for flexo)

A quick fix is simply to rename the flexo service to something else (e.g. flexo-svc)

I simply wanted to note it here in the issue tracker so that other people could google it instead of having to debug it.

Feel free to close the issue :-)

nroi commented 3 years ago

Thanks for pointing this out! I'm closing this for now, because I can't think of a way to fix this in Flexo (other than renaming the env variable) and the workaround seems good enough. But I don't know much about k8s, so if anyone has any ideas how Flexo can be improved so that no one else stumbles upon this issue, feel free to comment.