FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Consider already existing images as successful pulls. by n-g · Pull Request #2335 · docker-java/docker-java · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (3) .json  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class PullResponseItem extends ResponseItem {

private static final String DOWNLOADED_SWARM = ": downloaded";

private static final String ALREADY_EXISTS = "Already exists";

/**
* Returns whether the status indicates a successful pull operation
*
Expand All @@ -34,7 +36,8 @@ public boolean isPullSuccessIndicated() {
getStatus().contains(IMAGE_UP_TO_DATE) ||
getStatus().contains(DOWNLOADED_NEWER_IMAGE) ||
getStatus().contains(LEGACY_REGISTRY) ||
getStatus().contains(DOWNLOADED_SWARM)
getStatus().contains(DOWNLOADED_SWARM) ||
getStatus().contains(ALREADY_EXISTS)
);
}
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@
* @author Zach Marshall
*/
public class PullResponseItemTest {
@Test
public void imageAlreadyExists() throws IOException {
PullResponseItem response = testRoundTrip(PullResponseJSONSamples.pullImageResponse_alreadyExists,
PullResponseItem.class);
assertTrue(response.isPullSuccessIndicated());
assertFalse(response.isErrorIndicated());
}

@Test
public void pullNewerImage() throws IOException {
PullResponseItem response = testRoundTrip(PullResponseJSONSamples.pullImageResponse_newerImage,
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
* @author Zach Marshall
*/
public enum PullResponseJSONSamples implements JSONResourceRef {
pullImageResponse_legacy, pullImageResponse_error, pullImageResponse_newerImage, pullImageResponse_upToDate;
pullImageResponse_legacy, pullImageResponse_error,
pullImageResponse_newerImage, pullImageResponse_upToDate,
pullImageResponse_alreadyExists;

@Override
public String getFileName() {
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"status":"Already exists"}

Back | FazBrowse Home | New Git URL