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

docker inspect -f uses floats instead of ints #11641

Closed
amouat opened this issue Mar 23, 2015 · 5 comments · Fixed by #11839
Closed

docker inspect -f uses floats instead of ints #11641

amouat opened this issue Mar 23, 2015 · 5 comments · Fixed by #11839

Comments

@amouat
Copy link
Contributor

amouat commented Mar 23, 2015

It seems that the data type of all numbers in docker inspect data is floats, rather than ints.

For example, the following template fails:

$ docker inspect -f '{{eq .State.ExitCode 0}}' jenkins-data
FATA[0000] template: :1:2: executing "" at <eq .State.ExitCode 0>: error calling eq: incompatible types for comparison

But this one works:

$ docker inspect -f '{{eq .State.ExitCode 0.0}}' jenkins-data
true

The same seems to be true for all numbers. This is obviously quite confusing, as pretty much all the numbers would seem to be better represented as integers.

Could this be changed? I realise there is now an issue with backward compatibility, but it just seems ... wrong ...

Version data and stuff if needed:

adrian@bistromath:/tmp/dockerfile$ docker version
Client version: 1.5.0
Client API version: 1.17
Go version (client): go1.4.1
Git commit (client): a8a31ef
OS/Arch (client): linux/amd64
Server version: 1.5.0
Server API version: 1.17
Go version (server): go1.4.1
Git commit (server): a8a31ef
adrian@bistromath:/tmp/dockerfile$ docker info
Containers: 21
Images: 933
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 979
Execution Driver: native-0.2
Kernel Version: 3.13.0-32-generic
Operating System: Ubuntu 14.04.1 LTS
CPUs: 8
Total Memory: 5.82 GiB
Name: bistromath
ID: VFBH:SEDU:FTHB:6WGM:JMH5:EWPQ:SQ6X:WQEC:JFGP:S2RD:5VZN:7FJW
Username: amouat
Registry: [https://index.docker.io/v1/]
WARNING: No swap limit support
adrian@bistromath:/tmp/dockerfile$ uname -a
Linux bistromath 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
brahmaroutu added a commit to brahmaroutu/docker that referenced this issue Mar 26, 2015
Closes moby#11641

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
brahmaroutu added a commit to brahmaroutu/docker that referenced this issue Mar 26, 2015
Closes moby#11641

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
brahmaroutu added a commit to brahmaroutu/docker that referenced this issue Mar 26, 2015
Closes moby#11641

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
@scalixte-mdsol
Copy link

#dibs

@brahmaroutu
Copy link
Contributor

@scalixte-mdsol I already worked on this. Please see the PR above.

brahmaroutu added a commit to brahmaroutu/docker that referenced this issue Mar 27, 2015
Closes moby#11641

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
brahmaroutu added a commit to brahmaroutu/docker that referenced this issue Mar 27, 2015
Closes moby#11641

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
@rrarunan
Copy link

@brahmaroutu when you do a PR, can you please add fixes or closes keyword to it? Thanks!

@brahmaroutu
Copy link
Contributor

@rrarunan Does it not say Closes?

@rrarunan
Copy link

@brahmaroutu It was just a friendly reminder without looking at the PR themselves. You did good 👍

brahmaroutu added a commit to brahmaroutu/docker that referenced this issue Apr 1, 2015
Closes moby#11641

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
brahmaroutu added a commit to brahmaroutu/docker that referenced this issue Apr 22, 2015
Closes moby#11641

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
brahmaroutu added a commit to brahmaroutu/docker that referenced this issue Apr 22, 2015
Closes moby#11641

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
brahmaroutu added a commit to brahmaroutu/docker that referenced this issue Apr 22, 2015
Closes moby#11641

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
brahmaroutu added a commit to brahmaroutu/docker that referenced this issue Apr 22, 2015
Closes moby#11641

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
brahmaroutu added a commit to brahmaroutu/docker that referenced this issue Apr 23, 2015
Closes moby#11641

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
brahmaroutu added a commit to brahmaroutu/docker that referenced this issue Apr 23, 2015
Closes moby#11641

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
brahmaroutu added a commit to brahmaroutu/docker that referenced this issue Apr 23, 2015
Closes moby#11641

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
brahmaroutu added a commit to brahmaroutu/docker that referenced this issue Apr 23, 2015
Closes moby#11641

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
brahmaroutu added a commit to brahmaroutu/docker that referenced this issue Apr 23, 2015
Closes moby#11641

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
brahmaroutu added a commit to brahmaroutu/docker that referenced this issue Apr 23, 2015
Closes moby#11641

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants