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

2475 Коммитов

Автор SHA1 Сообщение Дата
Doug Davis 58c049595f Merge pull request #18767 from wenchma/add_checkduplicate_test
Add network create api test on CheckDuplicate
2015-12-19 10:46:11 -05:00
Wen Cheng Ma 5649dae89b Add network create api test on CheckDuplicate
Signed-off-by: Wen Cheng Ma <wenchma@cn.ibm.com>
2015-12-19 22:29:30 +08:00
Aditi Rajagopal 278e75800c pkg/version.Version: use the new String() method
Resolves #18750

Signed-off-by: Aditi Rajagopal <arajagopal@us.ibm.com>
2015-12-18 15:29:32 -05:00
Antonio Murdaca 5a64c8027e 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>
2015-12-18 16:29:01 +01:00
David Calavera 406da8616c Merge pull request #18716 from clnperez/fix-blkio-tests
Update TestRunWithBlkioInvalidDevice Tests
2015-12-17 10:23:59 -08:00
Antonio Murdaca 98be580794 Merge pull request #18590 from aaronlehmann/limit-v1-fallbacks
Limit v1 protocol fallbacks
2015-12-17 14:44:05 +01:00
Sebastiaan van Stijn 5baa93c04e Merge pull request #18662 from runcom/pkg-authZ-response
pkg: authorization: add Err to tweak response status code
2015-12-17 11:12:27 +01:00
Antonio Murdaca 46e3a249a1 pkg: authorization: add Err to tweak response status code
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-12-17 11:08:47 +01:00
Vincent Demeester 0f749ad55a Merge pull request #18559 from ahmetalpbalkan/return-container-networks
Proposal: Add container networks list to /containers/json
2015-12-17 10:11:18 +01:00
Aaron Lehmann a57478d65f Do not fall back to the V1 protocol when we know we are talking to a V2 registry
If we detect a Docker-Distribution-Api-Version header indicating that
the registry speaks the V2 protocol, no fallback to V1 should take
place.

The same applies if a V2 registry operation succeeds while attempting a
push or pull.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-12-16 15:02:03 -08:00
David Calavera 905f3336b2 Merge pull request #15964 from duglin/APIVersion
Add a DOCKER_API_VERSION env var
2015-12-16 14:23:47 -08:00
Tonis Tiigi 15d84a3a48 Improve reference parse errors
Fixes #18093

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-12-16 11:58:53 -08:00
Brian Goff ebb1d56ecb Merge pull request #18705 from runcom/cleanups
Cleanups
2015-12-16 12:40:31 -05:00
Christy Perez 2236ecddfb Update TestRunWithBlkioInvalidDevice Tests
/dev/sda wasn't an invalid device and this test failed, so, hopefully
/dev/sdX isn't going to exist in other envs.

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
2015-12-16 10:58:31 -06:00
Antonio Murdaca baba1a8493 reorder imports with goimports
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-12-16 16:50:25 +01:00
Antonio Murdaca bb2c92355c Merge pull request #18655 from dmcgowan/fix-docker-inspect-container
Add metadata function to layer store
2015-12-16 12:23:41 +01:00
David Calavera e98cae4919 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>
2015-12-15 18:13:26 -05:00
David Calavera 27220ecc6b 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>
2015-12-15 14:56:14 -05:00
Brian Goff ce0b1841c8 Merge pull request #17034 from rhvgoyal/volume-propagation
Capability to specify per volume mount propagation mode
2015-12-15 12:14:41 -05:00
Alexander Morozov 812a7c204a Merge pull request #18531 from coolljt0725/update_container_networking_on_create
fix docker inspect return unconsistent network settings  of created container and stopped container
2015-12-15 08:47:54 -08:00
Ahmet Alp Balkan 755f8609f6 Add containers’ networks to /containers/json
After addition of multi-host networking in Docker 1.9, Docker Remote
API is still returning only the network specified during creation
of the container in the “List Containers” (`/containers/json`) endpoint:

    ...
    "HostConfig": {
      "NetworkMode": "default"
    },

The list of networks containers are attached to is only available at
Get Container (`/containers/<id>/json`) endpoint.
This does not allow applications utilizing multi-host networking to
be built on top of Docker Remote API.

Therefore I added a simple `"NetworkSettings"` section to the
`/containers/json` endpoint. This is not identical to the NetworkSettings
returned in Get Container (`/containers/<id>/json`) endpoint. It only
contains a single field `"Networks"`, which is essentially the same
value shown in inspect output of a container.

This change adds the following section to the `/containers/json`:

    "NetworkSettings": {
      "Networks": {
        "bridge": {
          "EndpointID": "2cdc4edb1ded3631c81f57966563e...",
          "Gateway": "172.17.0.1",
          "IPAddress": "172.17.0.2",
          "IPPrefixLen": 16,
          "IPv6Gateway": "",
          "GlobalIPv6Address": "",
          "GlobalIPv6PrefixLen": 0,
          "MacAddress": "02:42:ac:11:00:02"
        }
      }
    }

This is of type `SummaryNetworkSettings` type, a minimal version of
`api/types#NetworkSettings`.

Actually all I need is the network name and the IPAddress fields. If folks
find this addition too big, I can create a `SummaryEndpointSettings` field
as well, containing just the IPAddress field.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-12-14 19:03:23 -08:00
Derek McGowan a7e0968321 Add metadata function to layer store
Add function to get metadata from layer store for a mutable layer

fixes #18614

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-12-14 16:52:15 -08:00
Alexander Morozov 260cbb19c9 Merge pull request #18486 from aboch/vnd
Vendoring libnetwork bbd6e6d8ca1e7c9b42f6f53277b0bde72847ff90
2015-12-14 13:32:01 -08:00
Doug Davis 6287ec9095 Add a DOCKER_API_VERSION env var
Closes: #11486

Just for @ahmetalpbalkan  :-)

Fixed some comment formatting too while in there.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-12-14 12:45:34 -08:00
Vivek Goyal f988c98ff3 Add some unit and integration tests
Add a unit test and couple of integration tests for volume propagation.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2015-12-14 10:39:53 -05:00
Daehyeok Mun ba6b69adc2 Change TestRunNonRootUserResolvName Fail log.
Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
2015-12-13 19:59:51 -07:00
Justas Brazauskas 927b334ebf Fix typos found across repository
Signed-off-by: Justas Brazauskas <brazauskasjustas@gmail.com>
2015-12-13 18:04:12 +02:00
Lei Jitang c427131c94 update network settings on container creating
To make docker inspect return a consistent result of networksettings
for created container and stopped container, it's bettew to update
the network settings on container creating.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-12-13 02:34:44 -05:00
Antonio Murdaca 1fffc0270f Merge pull request #15365 from twistlock/14674-docker-authz
Docker authorization plug-in infrastructure
2015-12-12 12:30:33 +01:00
David Calavera a3056f9f72 Log events stream when TestEventStreaming fails.
Let the tag event some more time to be emitted.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-11 17:20:40 -05:00
Liron Levin de4ffdfe48 Change authz plugin argument name
Signed-off-by: Liron Levin <liron@twistlock.com>
2015-12-11 20:59:15 +02:00
David Calavera b89676bead Merge pull request #18580 from tophj-ibm/fix-typo-blkio-invalid-device
Fix typo in named test and docs.
2015-12-10 15:19:41 -08:00
Alexander Morozov ac453a310b Merge pull request #18353 from aaronlehmann/transfer-manager
Improved push and pull with upload manager and download manager
2015-12-10 14:52:48 -08:00
Christopher Jones 7c077c2c34 Fixed typo change deivce to device.
This changes deivce to device in daemon, test and docs.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2015-12-10 15:23:05 -06:00
Lei Jitang 0e16eacad4 Probably fix flaky test TestExecTTY
sleep 2 seconds before exec exit to make sure
the output of `cat /foo` will be read

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-12-10 04:13:58 -05:00
Aaron Lehmann 572ce80230 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>
2015-12-09 19:13:35 -08:00
Daniel Nephin efda9618db Move networking api types to the api/types/networking package.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-12-09 13:55:59 -08:00
Alessandro Boch 8fe6b3835c Vendoring libnetwork bbd6e6d8ca1e7c9b42f6f53277b0bde72847ff90
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-12-09 13:48:24 -08:00
Tibor Vass 375f754f49 Merge pull request #18472 from calavera/api_client_lib
Api client lib
2015-12-09 19:17:11 +01:00
David Calavera 57b6796304 Implement all inspect commands with the new inspector interface.
It makes the behavior completely consistent across commands.
It adds tests to check that execution stops when an element is not
found.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-09 12:05:01 -05:00
David Calavera 0876742646 Implement docker logs with standalone client lib.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-09 12:04:55 -05:00
Qiang Huang 2347f98003 Check minimum kernel memory limit to be 4M
Fixes: #18405

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-12-09 14:26:41 +08:00
Derek McGowan e8a0e126f7 Merge pull request #18503 from aaronlehmann/test-pull-all-tags
Fix flaky test TestPullAllTagsFromCentralRegistry
2015-12-08 14:15:55 -08:00
Aaron Lehmann d17669999f Fix flaky test TestPullAllTagsFromCentralRegistry
This test was directly comparing lines of output from "docker images".
Sometimes, when busybox had been pushed to the hub recently, the
relative creation times would differ like this:

... obtained []string = []string{"busybox", "latest", "d9551b4026f0", "27", "minutes", "ago", "1.113", "MB"}
... expected []string = []string{"busybox", "latest", "d9551b4026f0", "26", "minutes", "ago", "1.113", "MB"}

Fixing by removing the time-since-creation fields from the comparison.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-12-08 11:23:04 -08:00
Liron Levin f28230d35c Rebase from master
Signed-off-by: Liron Levin <liron@twistlock.com>
2015-12-08 19:45:22 +02:00
Alexander Morozov adb19755e1 Merge pull request #18479 from aaronlehmann/flaky-logs-test
Fix flaky test TestLogsSince
2015-12-08 09:03:39 -08:00
Liron Levin 75c353f0ad 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
2015-12-08 17:34:15 +02:00
Phil Estes 0433e38915 Allow non-seccomp platforms to pass integration-cli tests
Since seccomp is still a configurable build-tag, add a requirements
entry for seccomp, as well as move seccomp tests to "_unix" given it
won't be applicable to other platforms at this time.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-12-07 20:14:52 -05:00
Aaron Lehmann 7ab0f9bf61 Fix flaky test TestLogsSince
This test can fail if it is run close to a second boundary:

    FAIL: docker_cli_logs_test.go:169: DockerSuite.TestLogsSince

    docker_cli_logs_test.go:183:
        c.Assert(out, checker.Not(checker.Contains), v,
    check.Commentf("unexpected log message returned, since=%v", since))
    ... obtained string = "" +
    ...     "2015-12-07T19:54:45.000551883Z 1449518084 log2\n" +
    ...     "2015-12-07T19:54:47.001310929Z 1449518086 log3\n"
    ... substring string = "log2"
    ... unexpected log message returned, since=1449518085

The problem is that it generates log lines using date +%s and uses that
timestamp as a reference for log filtering with (--since) later on in
the test. However, the timestamp that date +%s generates may not match
the log timestamp.

This commit changes the test to parse the log timestamp itself instead
of relying on a parallel timestamp.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-12-07 13:26:30 -08:00
Tibor Vass 1f8efc687c Merge pull request #18123 from aidanhs/aphs-fail-on-broken-tar
Ensure adding a broken tar doesn't silently fail
2015-12-07 14:38:21 +01:00