Commit Graph

1737 Commits

Author SHA1 Message Date
1d3ad033b8 Merge pull request #18810 from runcom/pkg-authz-fixes
pkg: authorization: do not register the same plugin
Upstream-commit: 914fad8b7d3426d9c637bfa07ccb47c141048163
Component: engine
2015-12-23 15:09:06 -08:00
547bf07eca pkg: authorization: do not register the same plugin
This patches avoids registering (and calling) the same plugin more than
once. Using an helper map which indexes by name guarantees this and keeps
the order.
The behavior of overriding the same name in a flag is consistent with,
for instance, the `docker run -v /test -v /test` flag which register
the volume just once.
Adds integration tests.

Without this patch:
```
Dec 20 19:34:52 localhost.localdomain docker[9988]:
time="2015-12-20T19:34:52.080901676+01:00" level=debug msg="Calling
GET
/v1.22/info"
Dec 20 19:34:52 localhost.localdomain docker[9988]:
time="2015-12-20T19:34:52.081213202+01:00" level=debug msg="AuthZ
request using plugin docker-novolume-plugin"
Dec 20 19:34:52 localhost.localdomain docker[9988]:
time="2015-12-20T19:34:52.081268132+01:00" level=debug
msg="docker-novolume-plugin implements: authz"
Dec 20 19:34:52 localhost.localdomain docker[9988]:
time="2015-12-20T19:34:52.081699788+01:00" level=debug msg="AuthZ
request using plugin docker-novolume-plugin"
Dec 20 19:34:52 localhost.localdomain docker[9988]:
time="2015-12-20T19:34:52.081762507+01:00" level=debug
msg="docker-novolume-plugin implements: authz"
Dec 20 19:34:52 localhost.localdomain docker[9988]:
time="2015-12-20T19:34:52.082092480+01:00" level=debug msg="GET
/v1.22/info"
Dec 20 19:34:52 localhost.localdomain docker[9988]:
time="2015-12-20T19:34:52.628691038+01:00" level=debug msg="AuthZ
response using plugin docker-novolume-plugin"
Dec 20 19:34:52 localhost.localdomain docker[9988]:
time="2015-12-20T19:34:52.629880930+01:00" level=debug msg="AuthZ
response using plugin docker-novolume-plugin"
```

With this patch:
```
Dec 20 19:37:32 localhost.localdomain docker[16620]:
time="2015-12-20T19:37:32.376523958+01:00" level=debug msg="Calling
GET
/v1.22/info"
Dec 20 19:37:32 localhost.localdomain docker[16620]:
time="2015-12-20T19:37:32.376715483+01:00" level=debug msg="AuthZ
request using plugin docker-novolume-plugin"
Dec 20 19:37:32 localhost.localdomain docker[16620]:
time="2015-12-20T19:37:32.376771230+01:00" level=debug
msg="docker-novolume-plugin implements: authz"
Dec 20 19:37:32 localhost.localdomain docker[16620]:
time="2015-12-20T19:37:32.377698897+01:00" level=debug msg="GET
/v1.22/info"
Dec 20 19:37:32 localhost.localdomain docker[16620]:
time="2015-12-20T19:37:32.951016441+01:00" level=debug msg="AuthZ
response using plugin docker-novolume-plugin"
```

Also removes a somehow duplicate debug statement (leaving only the
second one as it's a loop of plugin's manifest):
```
Dec 20 19:52:30 localhost.localdomain docker[25767]:
time="2015-12-20T19:52:30.544090518+01:00" level=debug
msg="docker-novolume-plugin's manifest: &{[authz]}"
Dec 20 19:52:30 localhost.localdomain docker[25767]:
time="2015-12-20T19:52:30.544170677+01:00" level=debug
msg="docker-novolume-plugin implements: authz"
```

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: c28fc06e002e06deed3437da76bc213b7bd752ba
Component: engine
2015-12-23 21:08:40 +01:00
1cfbdcfe91 Remove package pkg/ulimit, use go-units instead.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 83237aab2b9430a88790467867505cc9a5147f3e
Component: engine
2015-12-23 13:27:58 -05:00
0c8c982991 Remove unused parser functions that were replaced by go-connections/nat.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: b8659da2147293b6ecb49e05927ddbc6ef6b8cc4
Component: engine
2015-12-22 19:06:49 -05:00
143c9b690b Merge pull request #18762 from calavera/runconfig_to_types
Move container configuration types to api/types/container.
Upstream-commit: 030347c3c9505fa80eed0ecfde5d1e9af05c3cbc
Component: engine
2015-12-22 14:22:08 -08:00
a9fe9a6c5b Merge pull request #18857 from calavera/catch_pipeline_error
Catch command pipeline error.
Upstream-commit: 9f228b37fc1108bee544973841513ffd0d06035c
Component: engine
2015-12-22 13:34:56 -08:00
608da884be Catch command pipeline error.
Rather than ignoring errors in the pipeline, return an execution error
and do not proceed with the latest command in the pipeline.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: f38257308b12ecf6de7ce72895a6430d6a3dc775
Component: engine
2015-12-22 15:17:15 -05:00
47e00eae65 No options to tmpfs is valid
If you run a

docker run command with --tmpfs /mountpoint:noexec

Or certain options that get translated into mount options, the mount command can get passed "" for mount data.
So this should be valid.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Upstream-commit: 89a775d2dc596b9ac86873edf447fff2f7012ef3
Component: engine
2015-12-22 14:15:07 -05:00
b006691148 Replace usage of pkg/nat with go-connections/nat.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 056e7449039af522fa0a1567ef67916eaa0de93e
Component: engine
2015-12-22 13:31:46 -05:00
3b25d376dd Move blkiodev package to types.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 0aab83d996f645a2e1e28b1e2c03b530c13a5fc1
Component: engine
2015-12-22 13:31:46 -05:00
7e8fcbf740 Move StrSlice to types.
This is a very docker concept that nobody elses need.
We only maintain it to keep the API backwards compatible.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: f9b857a200696b07b67e6a7f94ede32487f5649d
Component: engine
2015-12-22 13:31:43 -05:00
161c03c6c1 Merge pull request #15879 from Mashimiao/add-support-blkio_throtte_iops
Add support for blkio read/write iops device
Upstream-commit: 312c82677bdc86d50b483d642ad8c61f1c840c55
Component: engine
2015-12-21 23:45:18 +01:00
a04e1f9592 Add support for blkio read/write iops device
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Upstream-commit: 843084b08b521a70baf9284ec4e23e941ab38367
Component: engine
2015-12-21 09:14:49 +08:00
4b736dc17f Merge pull request #18651 from vbatts/dm-cleanup
loopback (and devicemapper) cleanup
Upstream-commit: 54f945994a0eb79c43c8c34fc77625dc56c0c421
Component: engine
2015-12-18 15:13:28 -08:00
8b5a2050f9 loopback: separate loop logic from devicemapper
The loopback logic is not technically exclusive to the devicemapper
driver. This reorganizes the code such that the loopback code is usable
outside of the devicemapper package and driver.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: af597527121c0ad973e9d0ae4f9cf970da1513cc
Component: engine
2015-12-18 10:57:43 -05:00
e963d775a7 devicemapper: remove unused type mapping
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: a292c04c01cbe4a6c9f74e7cf3b0315249ed8993
Component: engine
2015-12-18 10:44:06 -05:00
d63981ab4d authZ: more fixes
- fix naming and formatting
- provide more context when erroring auth
- do not capitalize errors
- fix wrong documentation
- remove ugly remoteError{}

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 5a64c8027ecd2bebe773c9abd2e73c2fd7d23de1
Component: engine
2015-12-18 16:29:01 +01:00
0f2a0bed09 Merge pull request #18744 from runcom/plugins-deadcode
pkg: plugins: remove dead code
Upstream-commit: 5553aab705d7ffed1bee94b8df860a36af767a20
Component: engine
2015-12-17 10:50:04 -08:00
fb0251b9a3 Merge pull request #18745 from runcom/pkg-version-String
pkg: version: add String method
Upstream-commit: 9681f0f0d4457f0e8dfb0c0473557a97e0cfef2b
Component: engine
2015-12-17 16:58:41 +01:00
babed83c58 pkg: version: add String method
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 0d9f1e344a629e5abcd6a385952d22d19555f125
Component: engine
2015-12-17 11:52:23 +01:00
98eeaeab93 pkg: authorization: add Err to tweak response status code
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 46e3a249a1971f8697ca338c9b02e27d36ddab12
Component: engine
2015-12-17 11:08:47 +01:00
6862b2ec45 pkg: plugins: remove dead code
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 1d2b62ceae17238f842bb2a7febf1bead8a982d5
Component: engine
2015-12-17 11:05:50 +01:00
bc3565cc24 Merge pull request #18695 from dnephin/move_parse_link
Move ParseLink and validators into runconfig.parse where they are used
Upstream-commit: 3805c2909948c3827f242b1a8843320bddde9796
Component: engine
2015-12-16 16:15:52 -05:00
85ba54f0f4 Merge pull request #18722 from calavera/remove_unused_packages
Remove timeoutconn package, it's not used anywhere
Upstream-commit: cf7ccaf370b62fdf6d5b872f3c582370793656a9
Component: engine
2015-12-16 20:56:43 +01:00
e0a503a757 Merge pull request #18518 from MHBauer/spurious-timing
adjust test sleep timing to avoid spurious failure
Upstream-commit: 8ec00e6d0ecc49454e84d8bc67d9aeb9f1430e3f
Component: engine
2015-12-16 20:45:55 +01:00
f8a7e2bc3a Move ParseLink and validators into runconfig.parse where they are used.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 233a4fc33ccaf279cc5a0ad1842ef5b053cccde7
Component: engine
2015-12-16 14:22:54 -05:00
3ec2752189 Remove timeoutconn package.
It's not used anywhere.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 4d8ce0ef4a1ebf992906056f46b3f664b0bd30a4
Component: engine
2015-12-16 13:51:56 -05:00
4738f86f62 Merge pull request #18682 from calavera/replace_units_package
Replace pkg/units with docker/go-units.
Upstream-commit: b44b5bbc8ba48f50343602a21e7d44c017c1e23d
Component: engine
2015-12-16 10:48:59 -08:00
cdad225d64 Merge pull request #18693 from dnephin/move_parse_docker_host
Move ParseDockerDaemonHost to opts/ package
Upstream-commit: c2276c1fe30f53f6a86ad8da916934defe39f55d
Component: engine
2015-12-16 19:05:07 +01:00
3d517a11e5 Replace pkg/units with docker/go-units.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 4fef42ba206ac90346e6e0fe25bead3f77dc4b0f
Component: engine
2015-12-16 12:26:49 -05:00
b790e177cc pkg: authorization: cleanup
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 8435ea52893ef69c5a264bfbf0a1d3472f377ba2
Component: engine
2015-12-16 12:01:04 +01:00
9393471e47 Move ParseDockerDaemonHost to opts/ package.
This function was only being used from a single place opts/opts.go. This
change moves it from a incohesive package (parsers) to the single place it
is used.

Also made a bunch of the helper methods private because they are not used
by any external modules.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 9b9959105499248ab6cdbfde2277ed1bd83233e3
Component: engine
2015-12-15 20:53:17 -05:00
b1147e3d7d Move filters package to the API.
These filters are only use to interchange data between clients and daemons.
They don't belong to the parsers package.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: e98cae4919da69dc6f9ae46527792cf2012cc7f2
Component: engine
2015-12-15 18:13:26 -05:00
7cc80752fd Merge pull request #18685 from calavera/remove_timeutils
Move timeutils functions to the only places where they are used.
Upstream-commit: 52fd30079a8f9a56402d4c4f1666c96bd9af98da
Component: engine
2015-12-15 15:11:18 -08:00
cbdc74599e Merge pull request #18677 from runcom/fix-plugins-error
pkg: plugins: fix and better handle errors
Upstream-commit: d3fbd434327e8081de318646bc44d3973814965b
Component: engine
2015-12-15 14:17:52 -08:00
1afa237e22 adjust test sleep timing to avoid spurious failure
- refactor ConsumeWithSpeed
 - documentation

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
Upstream-commit: 81c334fa56eab0f9e85c9f6745efa34bbb1b444b
Component: engine
2015-12-15 13:27:24 -08:00
7f43cd332d Move timeutils functions to the only places where they are used.
- Move time json marshaling to the jsonlog package: this is a docker
  internal hack that we should not promote as a library.
- Move Timestamp encoding/decoding functions to the API types: This is
  only used there. It could be a standalone library but I don't this
it's worth having a separated repo for this. It could introduce more
complexity than it solves.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 27220ecc6b1eedf650ca9cf94965cb0dc2054efd
Component: engine
2015-12-15 14:56:14 -05:00
dcc0a93ee4 pkg: plugins: fix and better handle errors
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 4133dc22122c6a032276adb073d651bc6aca181b
Component: engine
2015-12-15 17:51:48 +01:00
bf2423fe8a builder: remove container package dependency
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: c70f8b3c9c7a6dc6a219354acaa2e650d1403ecf
Component: engine
2015-12-15 17:24:07 +01:00
ba9d0503c4 Make pkg/devicemapper/ log messages with a common, consistent prefix.
Closes #16667

Uses the prefix "devicemapper:" for all the fmt and logrus error, debug, and info messages.

Signed-off-by: Chris Dituri <csdituri@gmail.com>
Upstream-commit: 9b584781ad9c810bc9060448f391a3ae6a7d7cbb
Component: engine
2015-12-14 21:35:15 -06:00
86409751de utils: move git functions to pkg/gitutils
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 135cca6f52c7862f13f50c30ccf5925038ba40a9
Component: engine
2015-12-14 14:59:52 +01:00
3c4fcf6b7a Fix typos found across repository
Signed-off-by: Justas Brazauskas <brazauskasjustas@gmail.com>
Upstream-commit: 927b334ebfc786276a039e45ec097e71bf9a104c
Component: engine
2015-12-13 18:04:12 +02:00
1d681e5873 Merge pull request #15365 from twistlock/14674-docker-authz
Docker authorization plug-in infrastructure
Upstream-commit: 1fffc0270ffb56d99a8440a10a0effdb3acd934d
Component: engine
2015-12-12 12:30:33 +01:00
9847131043 Merge pull request #18353 from aaronlehmann/transfer-manager
Improved push and pull with upload manager and download manager
Upstream-commit: ac453a310bac6bdd7cd9d780a63d4168064570d1
Component: engine
2015-12-10 14:52:48 -08:00
547342d777 Improved push and pull with upload manager and download manager
This commit adds a transfer manager which deduplicates and schedules
transfers, and also an upload manager and download manager that build on
top of the transfer manager to provide high-level interfaces for uploads
and downloads. The push and pull code is modified to use these building
blocks.

Some benefits of the changes:

- Simplification of push/pull code
- Pushes can upload layers concurrently
- Failed downloads and uploads are retried after backoff delays
- Cancellation is supported, but individual transfers will only be
  cancelled if all pushes or pulls using them are cancelled.
- The distribution code is decoupled from Docker Engine packages and API
  conventions (i.e. streamformatter), which will make it easier to split
  out.

This commit also includes unit tests for the new distribution/xfer
package. The tests cover 87.8% of the statements in the package.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 572ce802306a4e919802e5b77cbeca94acda7c0a
Component: engine
2015-12-09 19:13:35 -08:00
4abf2d4ba4 Merge pull request #18538 from estesp/aufs-whiteout-userns-fix
Skip aufs whiteout files on userns translation to container
Upstream-commit: 8b6132aa15367456b04cf659045e7996252df1f0
Component: engine
2015-12-09 14:47:01 -05:00
a984ad154d Remove redundant check
jm.ID is already checked in the outer "if",
so theres no reason to check it again here.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 7a6f5d9b3186de2116686d5e2c40eff673dae6ec
Component: engine
2015-12-09 17:38:06 +01:00
439d751051 Skip aufs whiteout files on userns translation to container
aufs kernel module creates whiteout files on upper layer delete (and
other situations) and those files already are 'translated' regarding
ownership in host terms (e.g. they are already "0:0" owned), so when
these layers are copied around with pkg/archive we don't want to try and
translate these files regarding ownership.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 1626c9dae0f285185e3ef4c1e2be55a807e8c0ed
Component: engine
2015-12-09 10:11:32 -05:00
1c96ff9a0b Fixing documentation according to comments by @moxiegirl and @thaJeztah
Signed-off-by: Dima Stopel <dima@twistlock.com>
Upstream-commit: 8cc0892269fb532f117aadc0e8acf7a173fe4e1b
Component: engine
2015-12-08 17:34:15 +02:00
2491643ccf Docker authorization plug-in infrastructure enables extending the functionality of the Docker daemon with respect to user authorization. The infrastructure enables registering a set of external authorization plug-in. Each plug-in receives information about the user and the request and decides whether to allow or deny the request. Only in case all plug-ins allow accessing the resource the access is granted.
Each plug-in operates as a separate service, and registers with Docker
through general (plug-ins API)
[https://blog.docker.com/2015/06/extending-docker-with-plugins/]. No
Docker daemon recompilation is required in order to add / remove an
authentication plug-in. Each plug-in is notified twice for each
operation: 1) before the operation is performed and, 2) before the
response is returned to the client. The plug-ins can modify the response
that is returned to the client.

The authorization depends on the authorization effort that takes place
in parallel [https://github.com/docker/docker/issues/13697].

This is the official issue of the authorization effort:
https://github.com/docker/docker/issues/14674

(Here)[https://github.com/rhatdan/docker-rbac] you can find an open
document that discusses a default RBAC plug-in for Docker.

Signed-off-by: Liron Levin <liron@twistlock.com>
Added container create flow test and extended the verification for ps
Upstream-commit: 75c353f0ad73bd83ed18e92857dd99a103bb47e3
Component: engine
2015-12-08 17:34:15 +02:00