Skip to content

Commit 61172cb

Browse files
committed
Fix create image by allowing input stream as the image content
1 parent fe50c05 commit 61172cb

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/Manager/ImageManager.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ public function build($inputStream, $parameters = [], $fetch = self::FETCH_OBJEC
6060
*
6161
* @return \Psr\Http\Message\ResponseInterface|CreateImageInfo[]|CreateImageStream
6262
*/
63-
public function create($parameters = [], $fetch = self::FETCH_OBJECT)
63+
public function create($inputStream = null, $parameters = [], $fetch = self::FETCH_OBJECT)
6464
{
65-
$response = parent::create($parameters, self::FETCH_RESPONSE);
65+
$response = parent::create($inputStream, $parameters, self::FETCH_RESPONSE);
6666

6767
if (200 === $response->getStatusCode()) {
6868
if (self::FETCH_STREAM === $fetch) {

tests/Manager/ContainerManagerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ private function getManager()
2323
*/
2424
public static function setUpBeforeClass()
2525
{
26-
self::getDocker()->getImageManager()->create([
26+
self::getDocker()->getImageManager()->create(null, [
2727
'fromImage' => 'busybox:latest'
2828
]);
2929
}

tests/Manager/ImageManagerTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function testBuildObject()
5858

5959
public function testCreateStream()
6060
{
61-
$createImageStream = $this->getManager()->create([
61+
$createImageStream = $this->getManager()->create(null, [
6262
'fromImage' => 'registry:latest'
6363
], ImageManager::FETCH_STREAM);
6464

@@ -78,7 +78,7 @@ public function testCreateStream()
7878

7979
public function testCreateObject()
8080
{
81-
$createImagesInfos = $this->getManager()->create([
81+
$createImagesInfos = $this->getManager()->create(null, [
8282
'fromImage' => 'registry:latest'
8383
], ImageManager::FETCH_OBJECT);
8484

tests/Manager/MiscManagerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testGetEventsStream()
3030
$lastEvent = $event;
3131
});
3232

33-
$this->getDocker()->getImageManager()->create([
33+
$this->getDocker()->getImageManager()->create(null, [
3434
'fromImage' => 'busybox:latest'
3535
]);
3636
$stream->wait();

0 commit comments

Comments
 (0)