Commit Graph

29 Commits

Author SHA1 Message Date
5506a9a27c Remove subdirectories MAINTAINERS files
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 89bdaa35e04b74b7c6528783e0f7b8154b2a3d31
Component: engine
2015-03-06 18:21:51 -08:00
913aff3176 pkg/units: fix size_test.go compilation
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: e59aad9cd387bf20dc0f4664afdd5c55b394cb5b
Component: engine
2014-12-19 18:38:12 +02:00
c7d1f45ca3 Merge pull request #9233 from inatatsu/fix-pkg-units-size-for-gccgo
Fix to avoid a compile error due to float to int truncation with GCCGO
Upstream-commit: 2acb856dff848bd69c5e971f6352854a26362164
Component: engine
2014-12-18 18:33:01 -08:00
7662fb34f6 Fix to avoid a compile error due to float to int truncation with GCCGO
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: c16e41245ebaf426a5ad27ebe82597647c7743a3
Component: engine
2014-12-17 22:44:55 +00:00
3388d83b40 Fix to avoid a compilation error of size_test.go with GCCGO due to float to int truncation
Signed-off-by: Tatsushi Inagaki <e29253@jp.ibm.com>
Upstream-commit: 82a5cd0d3701fc559fb92290ed6bc2974a9d8b6d
Component: engine
2014-11-25 18:12:22 +09:00
132b9f8479 Revert "Fix to avoid a compile error due to float to int truncation with GCCGO"
This reverts commit 967a42f116d23051c862a3b4983925de2016f83c.

Signed-off-by: Tatsushi Inagaki <e29253@jp.ibm.com>

Roll back the change to fix the parameter of HumanSize from int64 to float64
Upstream-commit: 36560a76d71f1222122c9e6c82f76a609da564e9
Component: engine
2014-11-25 16:48:09 +09:00
bff9ea9dff Fix to avoid a compile error due to float to int truncation with GCCGO
Signed-off-by: Tatsushi Inagaki <e29253@jp.ibm.com>
Upstream-commit: 967a42f116d23051c862a3b4983925de2016f83c
Component: engine
2014-11-19 15:06:49 +09:00
54a35eb340 Merge pull request #8198 from jfrazelle/add-jessie-to-various-maintainers
Adding self to various maintainers files.
Upstream-commit: f0327c99dd6fb7353d76726e0adb67a1b5a98451
Component: engine
2014-10-28 19:35:28 -07:00
d1d44d2d21 Merge pull request #8423 from unclejack/lint_changes
lint changes part 1
Upstream-commit: 9df3e45ba985a6ed7e9a07b308d56d694d1c13ad
Component: engine
2014-10-21 12:15:58 -04:00
456ba41de5 add BytesSize in pkg/units
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: ae4689f14d59ece06bbd2a08a9687dc075e42d6d
Component: engine
2014-10-14 03:54:32 +00:00
5b14fa9a40 pkg/units: lint
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: d202ff2ece6812f90af60292b88a9a20adb807ee
Component: engine
2014-10-06 22:19:41 +03:00
8734c910c3 Adding self to various maintainers files.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 6c60e8c7849742c111a2b0a5ad4ff88fc8e960ef
Component: engine
2014-09-29 15:43:07 -07:00
b4607092ee Refactor all pre-compiled regexp to package level vars
Addresses #8057

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Upstream-commit: 4119c9d7d955757092adc3410da8d75f972bd3c1
Component: engine
2014-09-16 12:57:44 -04:00
f378b5d004 pkg/units: Updated tests with unit constants
Also, now that I was at it, gave them a small refactor.

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
Upstream-commit: 81c7d28b842844778a652b7353f52332f4276afb
Component: engine
2014-07-26 20:00:18 -07:00
3b6e93d717 pkg/units: Unit constants directly int64
int64 seems sufficient

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
Upstream-commit: c7a2e86b5186acb58999d7b2b3a85a9bb4421b1f
Component: engine
2014-07-26 20:00:08 -07:00
81918c582c pkg/units: including suggestions and enhancements
Docker-DCO-1.1-Signed-off-by: fcarriedo <fcarriedo@gmail.com> (github: fcarriedo)
Upstream-commit: 2fb63aba0bf991873d56888f244d6aeee0c5fc57
Component: engine
2014-07-25 09:33:04 -07:00
f664c76057 pkg/units: Updated Compile() to MustCompile()
We were doing exactly what `regexp.MustCompile()` already does.

Docker-DCO-1.1-Signed-off-by: fcarriedo <fcarriedo@gmail.com> (github: fcarriedo)
Upstream-commit: c765134ac954f54f8b6aca6df25cf5e28911b563
Component: engine
2014-07-24 13:19:20 -07:00
22e53a9bae pkg/units: Refactored common code to single func
Both functions perform the same logic and they just vary on the base
multiplication units. We can refactor the common code into a single
place.

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
Upstream-commit: 386d300a6e07c99380a0814497cf0bc672df1e63
Component: engine
2014-07-24 00:03:59 -07:00
088f734e5e pkg/units: Moved 'units' out of function
No need to initialize every time the function executes since it works as
a catalog.

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
Upstream-commit: e4ab996b9d0d97089b076cfef32405f5f3fedc7c
Component: engine
2014-07-24 00:03:59 -07:00
23fcdf4f5e pkg/units: Compacted var declaration and initialization
No need to have two lines. The type is even explicit when type casting
to `float64(size)`

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
Upstream-commit: d512294382c9013dee2820745db02ab63dc2ecdd
Component: engine
2014-07-24 00:03:40 -07:00
9cee4d41c4 pkg/units: Refactor regexp.Compile to init()
No need to recompile a fixed regular expression each time the function
executes. Abstracting it to the `init()` method.

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
Upstream-commit: a4d57d8a851bf288804215b39c9d56a51550a228
Component: engine
2014-07-23 23:45:03 -07:00
fc192c453a pkg/units: Standardized supported sizes
May make sense that both `FromHumanSize()` and `RAMInBytes()` support
the same units. Added 'PB' to the RAMInBytes regex.

Also updated tests.

Note: int64 is overflowed on quantities >= EB

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
Upstream-commit: 0fd37bd7ac0f92eda0a55cf2bedf77f1996b8472
Component: engine
2014-07-23 23:37:06 -07:00
1e857dc998 pkg/units: Using 'case' instead of trickled ifs
Seems the perfect case for 'case' ;).

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
Upstream-commit: 03697f0a93b04122a5039db915afddf60ccec448
Component: engine
2014-07-23 20:38:36 -07:00
204cff966e pkg/units: Better to not use error as var name
Better to not use `error` as var name (might eclipse the error type) for
clarity and to prevent subtle bugs.

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
Upstream-commit: ea7b8ea03f5c2222060afe435e907c1ab855a44b
Component: engine
2014-07-22 15:39:59 -07:00
10f00b2b3a pkg/units: Remove unused named returns
Remove named returns since not used in function body.  Might prevent
potential subtle bugs.

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
Upstream-commit: 588090c49bf2ec077626d89196515e6bef1f7a69
Component: engine
2014-07-22 12:16:50 -07:00
64c32c0b31 pkg/units: Increased test coverage. Closes #7159.
Increased coverage:

  * Added test cases to size_test.go
  * Added coverage for duration.go

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
Upstream-commit: c47ab1425f0cf08168af7e5561e39ff2e39625e0
Component: engine
2014-07-22 09:56:58 -07:00
d61150b2d4 devmapper: use RAMInBytes() rather than FromHumanSize()
Device Mapper needs device sizes in binary (1024) multiples.  Otherwise
kernel checks can find that the specified thin-pool device sizes aren't
a multiple of the specified thin-pool blocksize.

The name for "RAMInBytes" is likely too narrow given the new consumers
but... Also add "tebibyte" support to RAMInBytes.

Docker-DCO-1.1-Signed-off-by: Mike Snitzer <snitzer@redhat.com> (github: snitm)
Upstream-commit: 2470a5ed999d9dc8d4b9bd250727ac13964db5b3
Component: engine
2014-06-24 12:10:14 -04:00
82966c0798 pkg/units: Add FromHumanSize
This does the "reverse" of HumanSize, i.e. maps a string to an int64
using SI prefixes for the extension.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 13f07b636f014331a5d5dc0eac40d6ac9e5c9263
Component: engine
2014-06-05 10:02:37 +02:00
d39f282a2b Move duration and size to units pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: d33b4655c4339dcbbf9f78948598e216ac3c06b4
Component: engine
2014-05-12 17:05:07 -07:00