Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot unmarshal float environment values. #410

Closed
cdrage opened this issue Feb 3, 2017 · 9 comments
Closed

Cannot unmarshal float environment values. #410

cdrage opened this issue Feb 3, 2017 · 9 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@cdrage
Copy link
Member

cdrage commented Feb 3, 2017

When passing in a float value through env: seems to fail:

Ex:

  environment:
    TEST: 4
    BAR: 0.3
    FOO: 0.3
ERRO Could not parse config for project foobar : Cannot unmarshal '0.3' of type float64 into a string value 
FATA Failed to load compose file: Cannot unmarshal '0.3' of type float64 into a string value 
@surajnarwade
Copy link
Contributor

@cdrage , I was working on this issue, I found that, this error occurs due to libcompose, so I raised an issue docker/libcompose#435
(if you passed float value in quotes, it works)

@surajssd
Copy link
Member

surajssd commented Feb 6, 2017

Is this working with docker-compose ?

@surajnarwade
Copy link
Contributor

@surajssd , yeah, it works with docker-compose but not with libcompose

@cdrage
Copy link
Member Author

cdrage commented Feb 6, 2017

@surajnarwade As a work-around, should we update in our code to convert it to a string before being passed in?

@surajnarwade
Copy link
Contributor

@cdrage , sounds good actually, I would like to work on it then

@surajnarwade
Copy link
Contributor

@cdrage , I tried to work on this, this error occurs due to libcompose, hence as a work around, we can tell user that if you want to put float value, put it in quotes.

@cdrage
Copy link
Member Author

cdrage commented Feb 7, 2017

@surajnarwade That wouldn't be a great work-around, our code should automatically detect that the environment variables are not in quotes and put them in converts / convert to string before passing to libcompose.

I did however take a quick look through the libcompose code and it doesn't seem too daunting to fix it upstream.

@surajnarwade
Copy link
Contributor

@cdrage, I tested kompose with your PR on libcompose, docker/libcompose#437
its working.

@kadel kadel added the kind/bug Categorizes issue or PR as related to a bug. label Feb 10, 2017
@kadel
Copy link
Member

kadel commented Feb 15, 2017

Closing. Fixed in #425

@kadel kadel closed this as completed Feb 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

4 participants