Skip to content
This repository was archived by the owner on Jan 17, 2024. It is now read-only.

Commit d52ec6d

Browse files
committed
FIX Force default maxRetries to 1
1 parent ae5bd37 commit d52ec6d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/main/java/com/gpuopenanalytics/jenkins/remotedocker/job/DockerImageConfiguration.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public DockerImageConfiguration(List<ConfigItem> configItemList,
6060
this.forcePull = forcePull;
6161
this.maxRetries = maxRetries;
6262
}
63-
63+
6464
public boolean isForcePull() {
6565
return forcePull;
6666
}
@@ -69,8 +69,13 @@ public String getImage() {
6969
return image;
7070
}
7171

72-
public String getRetries() {
73-
return maxRetries;
72+
public @Nonnull String getRetries() {
73+
if(StringUtils.isEmpty(maxRetries)) {
74+
//Default to 1
75+
return "1";
76+
} else {
77+
return maxRetries;
78+
}
7479
}
7580

7681
@Override
@@ -109,7 +114,7 @@ public void setupImage(AbstractDockerLauncher launcher,
109114
.stderr(launcher.getListener().getLogger())
110115
.stdout(launcher.getListener());
111116
status = proc.join();
112-
117+
113118
while (retries < numRetries && status != 0) {
114119
retries += 1;
115120
String message = "Docker pull failed, retry " + Integer.toString(retries) +

0 commit comments

Comments
 (0)