@Test public void testSetTag() { assertEquals("nginx:latest", ImageName.setTag("nginx@sha256:00000000", "latest")); assertEquals("nginx:latest", ImageName.setTag("nginx", "latest")); assertEquals("nginx:latest", ImageName.setTag("nginx:0.00.1", "latest")); }
public static String setTag(String image, String tag) { assertName(image); if (!StringUtils.hasText(tag)) { return image; } int tagStart = getTagStart(image); return image.substring(0, tagStart) + ":" + tag; }
ImageName { public static String setTag(String image, String tag) { assertName(image); if (!StringUtils.hasText(tag)) { return image; } int tagStart = getTagStart(image); return image.substring(0, tagStart) + ":" + tag; } }
ImageName { public static String setTag(String image, String tag) { assertName(image); if (!StringUtils.hasText(tag)) { return image; } int tagStart = getTagStart(image); return image.substring(0, tagStart) + ":" + tag; } ImageName(String registry, String name, String tag, String id); private  ImageName(String src, String id); }
ImageName { public static String setTag(String image, String tag) { assertName(image); if (!StringUtils.hasText(tag)) { return image; } int tagStart = getTagStart(image); return image.substring(0, tagStart) + ":" + tag; } ImageName(String registry, String name, String tag, String id); private  ImageName(String src, String id); String getId(); String getFullName(); String getTag(); String getRegistry(); String getName(); static ImageName parse(String src); static boolean isRegistry(String registry); static String getName(String name, String imageId); static String nameFromId(String imageId); static String nameWithId(String name, String id); static boolean isId(String image); static void assertName(String image); static String withoutTag(String name); static String withoutTagOrNull(String name); static String setTag(String image, String tag); }
ImageName { public static String setTag(String image, String tag) { assertName(image); if (!StringUtils.hasText(tag)) { return image; } int tagStart = getTagStart(image); return image.substring(0, tagStart) + ":" + tag; } ImageName(String registry, String name, String tag, String id); private  ImageName(String src, String id); String getId(); String getFullName(); String getTag(); String getRegistry(); String getName(); static ImageName parse(String src); static boolean isRegistry(String registry); static String getName(String name, String imageId); static String nameFromId(String imageId); static String nameWithId(String name, String id); static boolean isId(String image); static void assertName(String image); static String withoutTag(String name); static String withoutTagOrNull(String name); static String setTag(String image, String tag); static final String TAG_LATEST; static final String NONE; static final String NONE_NAME; static final int NAME_ID_LEN; }