-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Docker API version float64 #24025
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@rmfitzpatrick @jamesmoessis any news? |
This is indeed a bug, but to support the float config value type I think we need a custom api version type. I've tried working on this briefly but mapstructure appears to only support |
@rmfitzpatrick appreciate for your answer, and work. Yeap, using not round versions is workaround for this bug |
/label -needs-triage |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
) **Description:** Fixing a bug - currently the docker client api version is a float, which is incompatible w/ the actual engine api version scheme (1.40 != 1.4). These changes adopt them as strings with validating helpers with minimum version checking using the docker types api*. Because [mapstructure's text unmarshaller hook](https://github.com/mitchellh/mapstructure/blob/63cde0dfe2481856bcfc2184477b26df770f19d7/decode_hooks.go#L266) only applies to strings I wasn't able to find a way to a complete fix without the breaking change of requiring api versions being strings (i.e. a user setting the value `1.40` will always be treated as a float 1.4)*. The proposed fix still suffers from the truncation problem but now provides the `!!str` option to offer a workaround that didn't exist. **Link to tracking Issue:** #24025
…n-telemetry#30480) **Description:** Fixing a bug - currently the docker client api version is a float, which is incompatible w/ the actual engine api version scheme (1.40 != 1.4). These changes adopt them as strings with validating helpers with minimum version checking using the docker types api*. Because [mapstructure's text unmarshaller hook](https://github.com/mitchellh/mapstructure/blob/63cde0dfe2481856bcfc2184477b26df770f19d7/decode_hooks.go#L266) only applies to strings I wasn't able to find a way to a complete fix without the breaking change of requiring api versions being strings (i.e. a user setting the value `1.40` will always be treated as a float 1.4)*. The proposed fix still suffers from the truncation problem but now provides the `!!str` option to offer a workaround that didn't exist. **Link to tracking Issue:** open-telemetry#24025
…n-telemetry#30480) **Description:** Fixing a bug - currently the docker client api version is a float, which is incompatible w/ the actual engine api version scheme (1.40 != 1.4). These changes adopt them as strings with validating helpers with minimum version checking using the docker types api*. Because [mapstructure's text unmarshaller hook](https://github.com/mitchellh/mapstructure/blob/63cde0dfe2481856bcfc2184477b26df770f19d7/decode_hooks.go#L266) only applies to strings I wasn't able to find a way to a complete fix without the breaking change of requiring api versions being strings (i.e. a user setting the value `1.40` will always be treated as a float 1.4)*. The proposed fix still suffers from the truncation problem but now provides the `!!str` option to offer a workaround that didn't exist. **Link to tracking Issue:** open-telemetry#24025
This can be closed right? #30480 fixes it. cc @MovieStoreGuy can you close it. |
Thanks @rmfitzpatrick for fixing |
appreciate @rmfitzpatrick ! |
Component(s)
receiver/dockerstats
What happened?
Description
Docker API with round versions (1.20, 1.30, 1.40, etc) converted to 1.2, 1.3, 1.4 etc
Steps to Reproduce
Enable dockerstatreceiver and set round api_version , for example 1.40:
Expected Result
This config will set api_version as expected: 1.40
Actual Result
opentelemetry restarting with error:
At docker documentation described version, and you can see "round" version : 1.20, 1.30 etc.
https://docs.docker.com/engine/api/#api-version-matrix
Collector version
0.80.0
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
OpenTelemetry Collector configuration
Log output
Additional context
In a source receiver/dockerstatsreceiver/config.go , set
While uses float64, 1.40 will convert to 1.4
$ python -c 'print(float(1.40))' 1.4
The text was updated successfully, but these errors were encountered: