Commit graph

1674 commits

Author SHA1 Message Date
Kristina Zabunova
a5efa69750 unit test refactor in pkg/httputils as suggested by vdemeester; using pattern if x := …; x == nil {}
Signed-off-by: Kristina Zabunova <triara.xiii@gmail.com>
(cherry picked from commit c3f1b2a5bd4a4330bcbad401c316af90925b99ad)
2015-08-28 10:41:19 -04:00
Kristina Zabunova
46454090b6 Increased test coverage of httputils to 70 %
Signed-off-by: Kristina Zabunova <triara.xiii@gmail.com>
(cherry picked from commit d71817464e859cd323d6cdaf4dec5a9dd530f57e)
2015-08-28 10:41:19 -04:00
Sven Dowideit
6270b081d5 Exploring the code using unit tests - these 2 functions do not work consistently
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-08-28 10:29:52 +00:00
Aaron Lehmann
b8c40573a4 Clean up ProgressStatus
- Rename to Broadcaster

- Document exported types

- Change Wait function to just wait. Writing a message to the writer and
  adding the writer to the observers list are now handled by separate
  function calls.

- Avoid importing logrus (the condition where it was used should never
  happen, anyway).

- Make writes non-blocking

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-08-27 13:22:08 -07:00
Sam Abed
6a0ffc4aa2 Show pull progress in terminal for inflight pull requests
Based on #12874 from Sam Abed <sam.abed@gmail.com>. His original commit
was brought up to date by manually porting the changes in pull.go into
the new code in pull_v1.go and pull_v2.go.

Fixes #8385

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-08-27 11:18:40 -07:00
Alexander Morozov
7e6418c6b1 Merge pull request #15493 from stevvooe/no-buffer-on-push
Avoid buffering to tempfile when pushing with V2
2015-08-26 13:59:01 -07:00
Alexander Morozov
ebdb3bedd2 Merge pull request #15865 from Microsoft/10662-isabs
Windows: Fix use of IsAbs check
2015-08-26 13:29:24 -07:00
John Howard
e92906f717 Windows: Fix use of IsAbs check
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-08-26 12:38:28 -07:00
Brian Goff
1858b15498 Add volume API/CLI
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-08-26 13:37:52 -04:00
Vincent Batts
01fe6537f1 tarsum: add a big fat warning
Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-08-25 16:50:08 -04:00
Stephen J Day
fd5edd5df3 Avoid buffering to tempfile when pushing with V2
The practice of buffering to a tempfile during a pushing contributes massively
to slow V2 push performance perception. The protocol was actually designed to
avoid precalculation, supporting cut-through data push. This means we can
assemble the layer, calculate its digest and push to the remote endpoint, all
at the same time.

This should increase performance massively on systems with slow disks or IO
bottlenecks.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-08-24 18:08:05 -07:00
Jessie Frazelle
066a0b3b75 Merge pull request #15393 from azurezk/exportImage-toplevel
change exportImage to top-level func
2015-08-24 14:35:55 -07:00
Jessie Frazelle
48cce1cd42 Merge pull request #14006 from hqhq/hq_add_kmem_limit
Add support for kernel memory limit
2015-08-21 14:34:27 -07:00
Jessie Frazelle
94a39da482 Merge pull request #15125 from WeiZhang555/golint-stdcopy-system
fix golint warnings/errors on pkg/system and pkg/stdcopy
2015-08-21 14:27:59 -07:00
Jessie Frazelle
ad9d2d1723 Merge pull request #15218 from calavera/gender_unbiased_names
Add more amazing women to the names generator.
2015-08-21 14:24:49 -07:00
Andrew Gerrand
3a41b3f1ce Use a slice instead of a map of io.WriteClosers in broadcastwriter
Maps rely on the keys being comparable.
Using an interface type as the map key is dangerous,
because some interface types are not comparable.
I talked about this in my "Stupid Gopher Tricks" talk:
	https://talks.golang.org/2015/tricks.slide

In this case, if the user-provided writer is backed by a slice
(such as io.MultiWriter) then the code will panic at run time.

Signed-off-by: Andrew Gerrand <adg@golang.org>
2015-08-21 14:08:04 +01:00
Icaro Seara
82a251318a Fix typo, "fil" -> "fill"
Signed-off-by: Icaro Seara <icaro.seara@gmail.com>
2015-08-19 21:50:54 -03:00
Brian Goff
6461996c9a Merge pull request #15684 from ibuildthecloud/dont-sync
Don't globally lock on driver initialization
2015-08-19 12:48:14 -04:00
Qiang Huang
3803847429 Add support for kernel memory limit
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-08-19 23:56:55 +08:00
Sebastiaan van Stijn
ad91ec8c4b Merge pull request #12927 from lindenlab/custom-host-port-ranges
Proposal: Change --publish=SPEC to allow binding to custom host port ranges
2015-08-19 17:04:23 +02:00
Darren Shepherd
bf81718eba Don't globally lock on driver initialization
This patch makes it such that plugin initialization is synchronized
based on the plugin name and not globally

Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-08-18 22:25:30 -07:00
Alexandre Beslic
f192bc6f68 Merge pull request #15380 from calavera/remove_sys_info_pointers
Remove pointers from the SysInfo struct.
2015-08-17 18:40:54 -07:00
Don Kjer
e22508c702 Adding support to publish on custom host port ranges
Signed-off-by: Don Kjer <don.kjer@gmail.com>

Changing vendor/src/github.com/docker/libnetwork to match lindenlab/libnetwork custom-host-port-ranges-1.7 branch
2015-08-15 02:41:29 +00:00
Zhang Wei
d846b54292 fix golint warnings/errors on pkg/system and pkg/stdcopy
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2015-08-13 18:47:13 +08:00
Stefan J. Wernli
1c1d0c5f6f Fixing Tar functions to support Windows long paths.
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
2015-08-11 16:07:36 -07:00
Alexander Morozov
732af35366 Merge pull request #15404 from vbatts/vbatts-dm-zero-sized-field
devicemapper: fix zero-sized field access
2015-08-10 09:16:11 -07:00
Vincent Batts
25b0312e8c devicemapper: fix zero-sized field access
Fixes: #15279

Due to
7904946eeb
the devices field is dropped.

This solution works on go1.4 and go1.5

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-08-10 11:11:58 -04:00
Kun Zhang
0fbf03ce5f change exportImage to top-level func
Signed-off-by: Kun Zhang <zkazure@gmail.com>

remove useless FIXME

Signed-off-by: Kun Zhang <zkazure@gmail.com>

fix

Signed-off-by: Kun Zhang <zkazure@gmail.com>
2015-08-10 22:18:57 +08:00
Brian Goff
2441d6e0f1 Merge pull request #15074 from coolljt0725/14756_enable_golint_2
Enable golint in pkg/jsonlog and pkg/jsonmessage part of #14756
2015-08-08 07:14:53 -04:00
Lei Jitang
520fe05c54 Enable golint in pkg/jsonlog and pkg/jsonmessage.
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-08-08 11:28:22 +08:00
Veres Lajos
0f78f158aa typofix - https://github.com/vlajos/misspell_fixer
Signed-off-by: Veres Lajos <vlajos@gmail.com>
2015-08-07 23:25:49 +01:00
Arnaud Porterie
bad3b47438 Merge pull request #15141 from Microsoft/10662-cp
Windows [TP3] - make docker cp functional
2015-08-06 17:15:09 -07:00
David Calavera
482c54a691 Remove pointers from the SysInfo struct.
Because they can just be values.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-08-06 15:57:21 -07:00
Antonio Murdaca
826c468f2c Move sysinfo out of daemon struct
sysinfo struct was initialized at daemon startup to make sure
kernel configs such as device cgroup are present and error out if not.
The struct was embedded in daemon struct making impossible to detect
if some system config is changed at daemon runtime (i.e. someone
umount the memory cgroup). This leads to container's starts failure if
some config is changed at daemon runtime.
This patch moves sysinfo out of daemon and initilize and check it when
needed (daemon startup, containers creation, contaienrs startup for
now).

Signed-off-by: Antonio Murdaca <runcom@linux.com>
(cherry picked from commit 472b6f66e03f9a85fe8d23098dac6f55a87456d8)
2015-08-06 15:46:09 -07:00
David Calavera
ef9b1b6b70 Merge pull request #15320 from hqhq/hq_add_cgroup_check
Check sysinfo for Cpuset cpu.shares and blkio
2015-08-06 14:23:37 -07:00
John Howard
f5727e08d4 Windows - make docker cp functional
Signed-off-by: John Howard <jhoward@microsoft.com>

Conflicts:
	pkg/archive/copy.go

Make it compile

Signed-off-by: John Howard <jhoward@microsoft.com>
2015-08-06 11:22:38 -07:00
Antonio Murdaca
003529d8c0 Remove pkg/systemd
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-08-06 14:35:00 +02:00
Tibor Vass
04e019f7cc Merge pull request #15252 from coolljt0725/14765_enable_golint_3
Enable golint in pkg/archive
2015-08-05 19:27:48 -04:00
Qiang Huang
3ed5407e61 Check sysinfo for Cpuset cpu.shares and blkio
Carried: #14015

If kernel is compiled with CONFIG_FAIR_GROUP_SCHED disabled cpu.shares
doesn't exist.
If kernel is compiled with CONFIG_CFQ_GROUP_IOSCHED disabled blkio.weight
doesn't exist.
If kernel is compiled with CONFIG_CPUSETS disabled cpuset won't be
supported.

We need to handle these conditions by checking sysinfo and verifying them.

Signed-off-by: Zefan Li <lizefan@huawei.com>
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-08-05 22:35:18 +08:00
Arnaud Porterie
4c56c9f9ba Merge pull request #14921 from aaronlehmann/int64
Fix uses of "int" where "int64" should be used instead
2015-08-04 19:16:13 -07:00
Antonio Murdaca
88443758d5 Merge pull request #14840 from HuKeping/golint-pkg-sysinfo
Fix golint warning on pkg/sysinfo
2015-08-04 20:57:39 +02:00
Lei Jitang
fb58e0d9c2 Enable golint in pkg/arcive
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-08-04 09:52:54 +08:00
David Calavera
91ea0f5368 Add more amazing women to the names generator.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-08-03 17:19:36 -07:00
Brian Goff
fe395e584f Merge pull request #15013 from coolljt0725/14756_enbale_golint_1
Enable golint, part of #14756
2015-08-02 22:14:18 -04:00
Lei Jitang
fcb8d8d48e Enable golint part of #14756
pkg/broadcastwriter
pkg/graphdb
pkg/httputils
pkg/ioutils

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-08-03 09:45:05 +08:00
Hu Keping
001fc3cf5f Fix golint warning on pkg/sysinfo
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-08-01 18:24:49 +08:00
Aaron Lehmann
16b74247fb Fix uses of "int" where "int64" should be used instead
Some structures use int for sizes and UNIX timestamps. On some
platforms, int is 32 bits, so this can lead to the year 2038 issues and
overflows when dealing with large containers or layers.

Consistently use int64 to store sizes and UNIX timestamps in
api/types/types.go. Update related to code accordingly (i.e.
strconv.FormatInt instead of strconv.Itoa).

Use int64 in progressreader package to avoid integer overflow when
dealing with large quantities. Update related code accordingly.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-31 16:31:40 -07:00
David Calavera
8cd8bc1365 Merge pull request #15207 from calavera/fix_index_locking
Remove read index that causes dead lock.
2015-07-31 14:55:00 -07:00
David Calavera
02963b85e4 Remove read index that causes dead lock.
Let the iterator to lock the index when it needs it.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-31 13:53:17 -07:00
Manfred Touron
6ab7a44610 pkg/namesgenerator: add a 'names-generator' binary
Signed-off-by: Manfred Touron <m@42.am>
2015-07-31 13:07:40 +02:00