Skip to content

Commit 5b39e70

Browse files
committed
Bump Docker Engine API to v1.42
1 parent 0983de5 commit 5b39e70

File tree

163 files changed

+21961
-2964
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+21961
-2964
lines changed

.jane-openapi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ return [
44
'date-prefer-interface' => true,
55
'directory' => __DIR__ . '/src',
66
'namespace' => 'Docker\\API',
7-
'openapi-file' => __DIR__ . '/spec/v1.41.json',
7+
'openapi-file' => __DIR__ . '/spec/v1.42.json',
88
'reference' => true,
99
'strict' => false,
1010
'date-input-format' => 'Y-m-d\TH:i:s.uuP',

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
},
6060
"extra": {
6161
"branch-alias": {
62-
"dev-main": "7.1.41.x-dev",
62+
"dev-main": "7.1.42.x-dev",
63+
"7.1.41": "7.1.41.x-dev",
6364
"6.1.41": "6.1.41.x-dev",
6465
"6.1.36": "6.1.36.x-dev"
6566
}

spec/v1.42.json

Lines changed: 16631 additions & 0 deletions
Large diffs are not rendered by default.

src/Client.php

Lines changed: 128 additions & 47 deletions
Large diffs are not rendered by default.

src/Endpoint/ContainerArchiveInfo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $re
7979
if (200 === $status) {
8080
}
8181
if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) {
82-
throw new \Docker\API\Exception\ContainerArchiveInfoBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ContainersIdArchiveHeadJsonResponse400', 'json'), $response);
82+
throw new \Docker\API\Exception\ContainerArchiveInfoBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
8383
}
8484
if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) {
8585
throw new \Docker\API\Exception\ContainerArchiveInfoNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);

src/Endpoint/ContainerAttach.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ class ContainerAttach extends \Docker\API\Runtime\Client\BaseEndpoint implements
6464
* ### Stream format
6565
*
6666
* When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate),
67-
* the stream over the hijacked connected is multiplexed to separate out
67+
* the HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream
68+
* and the stream over the hijacked connected is multiplexed to separate out
6869
* `stdout` and `stderr`. The stream consists of a series of frames, each
6970
* containing a header and a payload.
7071
*
@@ -125,7 +126,7 @@ class ContainerAttach extends \Docker\API\Runtime\Client\BaseEndpoint implements
125126
* @var bool $stderr Attach to `stderr`
126127
* }
127128
*
128-
* @param array $accept Accept content header application/vnd.docker.raw-stream|application/json
129+
* @param array $accept Accept content header application/vnd.docker.raw-stream|application/vnd.docker.multiplexed-stream|application/json
129130
*/
130131
public function __construct(string $id, array $queryParameters = [], array $accept = [])
131132
{
@@ -152,7 +153,7 @@ public function getBody(\Symfony\Component\Serializer\SerializerInterface $seria
152153
public function getExtraHeaders(): array
153154
{
154155
if (empty($this->accept)) {
155-
return ['Accept' => ['application/vnd.docker.raw-stream', 'application/json']];
156+
return ['Accept' => ['application/vnd.docker.raw-stream', 'application/vnd.docker.multiplexed-stream', 'application/json']];
156157
}
157158

158159
return $this->accept;

src/Endpoint/ContainerCreate.php

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,22 @@ class ContainerCreate extends \Docker\API\Runtime\Client\BaseEndpoint implements
1313
*
1414
* @var string $name Assign the specified name to the container. Must match
1515
* `/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`.
16+
* @var string $platform Platform in the format `os[/arch[/variant]]` used for image lookup.
17+
*
18+
* When specified, the daemon checks if the requested image is present
19+
* in the local image cache with the given OS and Architecture, and
20+
* otherwise returns a `404` status.
21+
*
22+
* If the option is not set, the host's native OS and Architecture are
23+
* used to look up the image in the image cache. However, if no platform
24+
* is passed and the given image does exist in the local image cache,
25+
* but its OS or architecture does not match, the container is created
26+
* with the available image, and a warning is added to the `Warnings`
27+
* field in the response, for example;
28+
*
29+
* WARNING: The requested image's platform (linux/arm64/v8) does not
30+
* match the detected host platform (linux/amd64) and no
31+
* specific platform was requested
1632
*
1733
* }
1834
*/
@@ -52,10 +68,11 @@ public function getExtraHeaders(): array
5268
protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver\OptionsResolver
5369
{
5470
$optionsResolver = parent::getQueryOptionsResolver();
55-
$optionsResolver->setDefined(['name']);
71+
$optionsResolver->setDefined(['name', 'platform']);
5672
$optionsResolver->setRequired([]);
5773
$optionsResolver->setDefaults([]);
5874
$optionsResolver->addAllowedTypes('name', ['string']);
75+
$optionsResolver->addAllowedTypes('platform', ['string']);
5976

6077
return $optionsResolver;
6178
}
@@ -66,14 +83,14 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver
6683
* @throws \Docker\API\Exception\ContainerCreateConflictException
6784
* @throws \Docker\API\Exception\ContainerCreateInternalServerErrorException
6885
*
69-
* @return \Docker\API\Model\ContainersCreatePostResponse201|null
86+
* @return \Docker\API\Model\ContainerCreateResponse|null
7087
*/
7188
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null)
7289
{
7390
$status = $response->getStatusCode();
7491
$body = (string) $response->getBody();
7592
if ((null === $contentType) === false && (201 === $status && false !== mb_strpos($contentType, 'application/json'))) {
76-
return $serializer->deserialize($body, 'Docker\\API\\Model\\ContainersCreatePostResponse201', 'json');
93+
return $serializer->deserialize($body, 'Docker\\API\\Model\\ContainerCreateResponse', 'json');
7794
}
7895
if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) {
7996
throw new \Docker\API\Exception\ContainerCreateBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);

src/Endpoint/ContainerKill.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ class ContainerKill extends \Docker\API\Runtime\Client\BaseEndpoint implements \
1717
* @param string $id ID or name of the container
1818
* @param array $queryParameters {
1919
*
20-
* @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`)
21-
* }
20+
* @var string $signal Signal to send to the container as an integer or string (e.g. `SIGINT`).
21+
*
22+
* }
2223
*
2324
* @param array $accept Accept content header application/json|text/plain
2425
*/

src/Endpoint/ContainerList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver
8989
* @throws \Docker\API\Exception\ContainerListBadRequestException
9090
* @throws \Docker\API\Exception\ContainerListInternalServerErrorException
9191
*
92-
* @return \Docker\API\Model\ContainerSummaryItem[]|null
92+
* @return \Docker\API\Model\ContainerSummary[]|null
9393
*/
9494
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null)
9595
{
9696
$status = $response->getStatusCode();
9797
$body = (string) $response->getBody();
9898
if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) {
99-
return $serializer->deserialize($body, 'Docker\\API\\Model\\ContainerSummaryItem[]', 'json');
99+
return $serializer->deserialize($body, 'Docker\\API\\Model\\ContainerSummary[]', 'json');
100100
}
101101
if ((null === $contentType) === false && (400 === $status && false !== mb_strpos($contentType, 'application/json'))) {
102102
throw new \Docker\API\Exception\ContainerListBadRequestException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);

src/Endpoint/ContainerLogs.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ContainerLogs extends \Docker\API\Runtime\Client\BaseEndpoint implements \
3030
*
3131
* }
3232
*
33-
* @param array $accept Accept content header application/json|text/plain
33+
* @param array $accept Accept content header application/vnd.docker.raw-stream|application/vnd.docker.multiplexed-stream|application/json
3434
*/
3535
public function __construct(string $id, array $queryParameters = [], array $accept = [])
3636
{
@@ -57,7 +57,7 @@ public function getBody(\Symfony\Component\Serializer\SerializerInterface $seria
5757
public function getExtraHeaders(): array
5858
{
5959
if (empty($this->accept)) {
60-
return ['Accept' => ['application/json', 'text/plain']];
60+
return ['Accept' => ['application/vnd.docker.raw-stream', 'application/vnd.docker.multiplexed-stream', 'application/json']];
6161
}
6262

6363
return $this->accept;
@@ -82,22 +82,19 @@ protected function getQueryOptionsResolver(): \Symfony\Component\OptionsResolver
8282

8383
/**
8484
* @throws \Docker\API\Exception\ContainerLogsNotFoundException
85-
* @throws \Docker\API\Exception\ContainerLogsInternalServerErrorException
8685
*
8786
* @return null
8887
*/
8988
protected function transformResponseBody(\Psr\Http\Message\ResponseInterface $response, \Symfony\Component\Serializer\SerializerInterface $serializer, string $contentType = null)
9089
{
9190
$status = $response->getStatusCode();
9291
$body = (string) $response->getBody();
93-
if ((null === $contentType) === false && (200 === $status && false !== mb_strpos($contentType, 'application/json'))) {
94-
return json_decode($body);
92+
if (200 === $status) {
9593
}
9694
if ((null === $contentType) === false && (404 === $status && false !== mb_strpos($contentType, 'application/json'))) {
97-
throw new \Docker\API\Exception\ContainerLogsNotFoundException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
95+
throw new \Docker\API\Exception\ContainerLogsNotFoundException($response);
9896
}
99-
if ((null === $contentType) === false && (500 === $status && false !== mb_strpos($contentType, 'application/json'))) {
100-
throw new \Docker\API\Exception\ContainerLogsInternalServerErrorException($serializer->deserialize($body, 'Docker\\API\\Model\\ErrorResponse', 'json'), $response);
97+
if (500 === $status) {
10198
}
10299
}
103100

0 commit comments

Comments
 (0)