Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Consider already existing images as successful pulls. #2335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
eddumelendez marked this conversation as resolved.
Show resolved Hide resolved
);
}
}
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
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"status":"Already exists"}
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.