@@ -256,17 +256,19 @@ public static void downloadMarkerLayer(String repo, String imageName, String ima
256
256
}
257
257
258
258
/**
259
- * @param imagePath - path to an image in artifactory without proxy e.g. image/image-tag
260
- * @param repo - target repo to search
261
- * @param cmd - docker push cmd/ docker pull cmd
259
+ * @param imagePath - path to an image in artifactory without proxy e.g. hello-world/latest.
260
+ * @param repo - The repository to use for searching.
261
+ * @param cmd - docker push cmd/ docker pull cmd.
262
262
* @return All possible paths in Artifactory in order to find image manifest using proxy.
263
263
*/
264
264
public static List <String > getArtManifestPath (String imagePath , String repo , CommandType cmd ) {
265
265
ArrayList <String > paths = new ArrayList <>();
266
- // Assuming reverse proxy e.g. ecosysjfrog-docker-local.jfrog.io.
266
+ // If the docker tag is reverse proxy, e.g. ecosysjfrog-docker-local.jfrog.io/hello-world:latest
267
+ // then the correct path is: repo = docker-local, imagePath = hello-world:latest
267
268
paths .add (repo + "/" + imagePath );
268
269
269
- // Assuming proxy-less e.g. orgab.jfrog.team/docker-local.
270
+ // If the docker tag is proxy-less e.g. orgab.jfrog.team/docker-local/hello-world:latest
271
+ // hen the correct path is: imagePath = docker-local/hello-world/latest
270
272
paths .add (imagePath );
271
273
272
274
int totalSlash = org .apache .commons .lang3 .StringUtils .countMatches (imagePath , "/" );
@@ -277,7 +279,7 @@ public static List<String> getArtManifestPath(String imagePath, String repo, Com
277
279
paths .add (repo + "/library/" + imagePath );
278
280
279
281
// Assume proxy-less - this time with 'library' as part of the path.
280
- int secondSlash = StringUtils .ordinalIndexOf (imagePath , "/" , 2 );
282
+ int secondSlash = StringUtils .ordinalIndexOf (imagePath , "/" , 1 );
281
283
paths .add (repo + "/library/" + imagePath .substring (secondSlash + 1 ));
282
284
283
285
return paths ;
0 commit comments