Граф коммитов

1433 Коммитов

Автор SHA1 Сообщение Дата
Jessie Frazelle 9bd8a9b66b 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 ecff4badcd 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 008a8ffdd2 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 31cbf76d0c 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 997ba4b0da Fix typo, "fil" -> "fill"
Signed-off-by: Icaro Seara <icaro.seara@gmail.com>
2015-08-19 21:50:54 -03:00
Brian Goff 7f46dc03d5 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 b6f1b4ad35 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 59e49e1db0 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 164208fde5 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 f1da5edc8b 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 47272f9cc5 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 7e420ad850 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 230cfc6ed2 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 6f89a8ee1b 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 f83d05c3be 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
Brian Goff 764aa1a583 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 5220f3b535 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 5146232723 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 04cd81401a Merge pull request #15141 from Microsoft/10662-cp
Windows [TP3] - make docker cp functional
2015-08-06 17:15:09 -07:00
David Calavera c2bc637a03 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 b2d06b6fba 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 9ce0a20c01 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 2a237615c0 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 931645c460 Remove pkg/systemd
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-08-06 14:35:00 +02:00
Tibor Vass 8534090476 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 b7599d58cb 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 7374852be9 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 23dab01ed2 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 ba332b7d12 Enable golint in pkg/arcive
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-08-04 09:52:54 +08:00
David Calavera 85a0f56fe7 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 dce1488ae5 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 27a8f9937e 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 7390cc5300 Fix golint warning on pkg/sysinfo
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-08-01 18:24:49 +08:00
Aaron Lehmann 1f61084d83 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 3e0b0c59e6 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 5ed84009b3 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 0800650665
pkg/namesgenerator: add a 'names-generator' binary
Signed-off-by: Manfred Touron <m@42.am>
2015-07-31 13:07:40 +02:00
Tibor Vass 9a9a12b351 Merge pull request #15123 from ewindisch/seed-pkgrand-cryptorand
Prefer crypto rand seed for pkg/rand
2015-07-30 22:41:17 -04:00
Tibor Vass 8d2739df98 Merge pull request #15146 from kolyshkin/mkdirall
Simplify and fix MkdirAll usage
2015-07-30 22:40:57 -04:00
Alexander Morozov 8505183252 Merge pull request #14950 from ottok/master
Multiple fixes to 'docker stats' output
2015-07-30 14:02:35 -07:00
David Calavera 030f61df3d Merge pull request #14885 from jlhawn/fix_cp_symlink
Fix copying of symlinks in containers
2015-07-30 13:42:40 -07:00
Alexander Morozov 9431acbc0a Merge pull request #15169 from Microsoft/10662-tidydiff
Tidy platform common bits in diff
2015-07-30 13:42:27 -07:00
John Howard 5ab9654bc4 Tidy platform common bits in diff
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-30 13:04:49 -07:00
Josh Hawn 75f6929b44 Fix `docker cp` Behavior With Symlinks
[pkg/archive] Update archive/copy path handling

  - Remove unused TarOptions.Name field.
  - Add new TarOptions.RebaseNames field.
  - Update some of the logic around path dir/base splitting.
  - Update some of the logic behind archive entry name rebasing.

[api/types] Add LinkTarget field to PathStat

[daemon] Fix stat, archive, extract of symlinks

  These operations *should* resolve symlinks that are in the path but if the
  resource itself is a symlink then it *should not* be resolved. This patch
  puts this logic into a common function `resolvePath` which resolves symlinks
  of the path's dir in scope of the container rootfs but does not resolve the
  final element of the path. Now archive, extract, and stat operations will
  return symlinks if the path is indeed a symlink.

[api/client] Update cp path hanling

[docs/reference/api] Update description of stat

  Add the linkTarget field to the header of the archive endpoint.
  Remove path field.

[integration-cli] Fix/Add cp symlink test cases

  Copying a symlink should do just that: copy the symlink NOT
  copy the target of the symlink. Also, the resulting file from
  the copy should have the name of the symlink NOT the name of
  the target file.

  Copying to a symlink should copy to the symlink target and not
  modify the symlink itself.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-07-30 12:14:28 -07:00
Brian Goff b149d9d0d9 Merge pull request #15156 from duglin/AddErrTruncIndex
Add missing typed error in truncindex
2015-07-30 14:55:40 -04:00
Kir Kolyshkin a83a769347 Simplify and fix os.MkdirAll() usage
TL;DR: check for IsExist(err) after a failed MkdirAll() is both
redundant and wrong -- so two reasons to remove it.

Quoting MkdirAll documentation:

> MkdirAll creates a directory named path, along with any necessary
> parents, and returns nil, or else returns an error. If path
> is already a directory, MkdirAll does nothing and returns nil.

This means two things:

1. If a directory to be created already exists, no error is returned.

2. If the error returned is IsExist (EEXIST), it means there exists
a non-directory with the same name as MkdirAll need to use for
directory. Example: we want to MkdirAll("a/b"), but file "a"
(or "a/b") already exists, so MkdirAll fails.

The above is a theory, based on quoted documentation and my UNIX
knowledge.

3. In practice, though, current MkdirAll implementation [1] returns
ENOTDIR in most of cases described in #2, with the exception when
there is a race between MkdirAll and someone else creating the
last component of MkdirAll argument as a file. In this very case
MkdirAll() will indeed return EEXIST.

Because of #1, IsExist check after MkdirAll is not needed.

Because of #2 and #3, ignoring IsExist error is just plain wrong,
as directory we require is not created. It's cleaner to report
the error now.

Note this error is all over the tree, I guess due to copy-paste,
or trying to follow the same usage pattern as for Mkdir(),
or some not quite correct examples on the Internet.

[v2: a separate aufs commit is merged into this one]

[1] https://github.com/golang/go/blob/f9ed2f75/src/os/path.go

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
2015-07-30 11:48:08 -07:00
Tibor Vass c7a04fda2a tlsconfig: better format for error message in tlsconfig
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-07-30 14:15:41 -04:00
Tibor Vass bfccd328be Merge pull request #15100 from calavera/fix_reader_timeout
Fix reset timeout for buffer readers.
2015-07-30 13:18:06 -04:00
Doug Davis 18b1381335 Add missing typed error in truncindex
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-30 07:52:34 -07:00
Otto Kekäläinen b619220ce1 Multiple fixes to 'docker stats' output:
* Add space between values in docker stats output for easier parsing

  Old output could not be parsed easily because there were columns
  that did not have any separator. Also values that are together
  without any space is difficult to read even for humans.

* Update unit.HumanSize comment to match what the does actually does

Signed-off-by: Otto Kekäläinen <otto@seravo.fi>
2015-07-30 10:14:57 +03:00