Commit Graph

23 Commits

Author SHA1 Message Date
Aarni Koskela d50cc429c2 Enable Ruff I (import sort), autofix
Signed-off-by: Aarni Koskela <akx@iki.fi>
2024-01-03 21:28:56 +02:00
Aarni Koskela 601476733c Enable Ruff C rules and autofix
Signed-off-by: Aarni Koskela <akx@iki.fi>
2023-08-15 13:36:53 +03:00
Anthony Sottile 5fcc293ba2 use python3.6+ constructs
Signed-off-by: Anthony Sottile <asottile@umich.edu>
2021-07-05 18:30:07 -04:00
aiordache cec152db5f Set image default tag on pull
Signed-off-by: aiordache <anca.iordache@docker.com>
2020-09-16 17:36:50 +02:00
Sebastiaan van Stijn 940805dde6
Fix ImageCollectionTest.test_pull_multiple flakiness
The ImageCollectionTest.test_pull_multiple test performs a `docker pull` without
a `:tag` specified) to pull all tags of the given repository (image).

After pulling the image, the image(s) pulled are checked to verify if the list
of images contains the `:latest` tag.

However, the test assumes that all tags of the image are tags for the same
version of the image (same digest), and thus a *single* image is returned, which
is not always the case.

Currently, the `hello-world:latest` and `hello-world:linux` tags point to a
different digest, therefore the `client.images.pull()` returns multiple images:
one image for digest, making the test fail:

    =================================== FAILURES ===================================
    ____________________ ImageCollectionTest.test_pull_multiple ____________________
    tests/integration/models_images_test.py:90: in test_pull_multiple
        assert len(images) == 1
    E   AssertionError: assert 2 == 1
    E    +  where 2 = len([<Image: 'hello-world:linux'>, <Image: 'hello-world:latest'>])

This patch updates the test to not assume a single image is returned, and instead
loop through the list of images and check if any of the images contains the
`:latest` tag.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-01-06 13:46:23 +01:00
Sebastiaan van Stijn 54b48a9b7a
Update alpine version to 3.10, and rename BUSYBOX variable
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-10 19:11:58 +02:00
Joffrey F e237c0ea16 Add named parameter to image.save to identify which repository name to use in the resulting tarball
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-06 14:46:37 -08:00
Joffrey F cc455d7fd5 Fix DockerClient pull bug when pulling image by digest
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-02-20 14:51:49 -08:00
Joffrey F 17aa31456d Properly support pulling all tags in DockerClient.images.pull
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-01-30 16:47:04 -08:00
Joffrey F 3422211309 Use pytest asserts
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-01-30 14:26:24 -08:00
Joffrey F 5728eebf79
Merge pull request #1874 from docker/1774-export-methods
Update save / export methods to return data generators
2018-01-29 16:19:45 -08:00
Joffrey F 388f291b13 Update save / export methods to return data generators
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-01-26 16:23:55 -08:00
Joffrey F 631cc3c121 ImageCollection.build now also returns build logs along with the built image reference
BuildError.build_logs has a copy of the logs generator

Signed-off-by: Joffrey F <joffrey@docker.com>
2018-01-26 15:59:46 -08:00
Joffrey F 8b5a52ae0c Error handling in ImageCollection.load
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-01-26 14:34:20 -08:00
Joffrey F bb82bcf784 Merge pull request #1626 from datwiz/images-build-error-1625
fix #1625 where ImageCollection.build() could return with incorrect image id
2017-06-19 15:20:17 -07:00
Olivier Sallou d638829f73 Closes #1588, image.tag does not return anything
This patch returns the check made against api when tagging an image as stated in documentation

Signed-off-by: Olivier Sallou <olivier.sallou@irisa.fr>
2017-06-16 17:49:43 +02:00
Chris Ottinger 1223fc144f new integration task linting for #1625
Signed-off-by: Chris Ottinger <chris.ottinger@team.telstra.com>
2017-05-27 11:24:58 +10:00
Chris Ottinger 6ef9d426eb added integration test for #1625 for ImageCollection.build() that verfies that the build method uses the last success message for extracting the image id
Signed-off-by: Chris Ottinger <chris.ottinger@team.telstra.com>
2017-05-27 10:29:36 +10:00
Joffrey F c6ddea469f Include tag in images.get after pulling if provided separately
Signed-off-by: Joffrey F <joffrey@docker.com>
2017-05-09 12:24:40 -07:00
Aaron Cowdin 7dffc46234 Add integration tests
Signed-off-by: Aaron Cowdin <aaron.cowdin@gmail.com>
2017-05-02 17:01:34 -07:00
Joffrey F a1d550a14c Allow configuring API version for integration test with env var
Signed-off-by: Joffrey F <joffrey@docker.com>
2017-01-25 16:52:26 -08:00
Joffrey F 738cfdcdf9 Update code and tests for Engine 1.13 compatibility
Makefile now runs tests against Docker 1.13 RC

Signed-off-by: Joffrey F <joffrey@docker.com>
2016-12-07 14:51:14 -08:00
Ben Firshman 1984f68730
Add new user-focused API
See #1086

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2016-11-22 17:05:43 +00:00