Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

ImageRef.parseRegistryUrl:112 #389

Open
chenkaishui opened this issue Oct 25, 2021 · 1 comment
Open

ImageRef.parseRegistryUrl:112 #389

chenkaishui opened this issue Oct 25, 2021 · 1 comment
Labels

Comments

@chenkaishui
Copy link

static String parseRegistryUrl(final String url) {
if (url.equals("docker.io") || url.equals("index.docker.io")) {
return DEFAULT_REGISTRY_URL;
} else if (url.matches("(^|(\w+)\.)gcr\.io$") || url.equals("gcr.kubernetes.io")) {
// GCR uses https
return "https://" + url;
} else if (url.equals("quay.io")) {
// Quay doesn't use any protocol in credentials file
return "quay.io";
} else if (!url.contains("http://") && !url.contains("https://")) {
// Assume https
return "https://" + url;
} else {
return url; **//this may not run anytime,because:line 55,56 **
}
}

public ImageRef(final String image){
55: final String[] parts = image.split("/", 2)
56:if (parts.length > 1 && isRegistry(parts[0])) ** It's sure image not contains "http://" or "https://"**
this.registry = parts[0];
this.registryUrl = parseRegistryUrl(parts[0]);
} else {
this.registry = DEFAULT_REGISTRY;
this.registryUrl = DEFAULT_REGISTRY_URL;
}
}

private static boolean isRegistry(String part) {
return part.contains(".");
}

com.spotify dockerfile-maven 1.4.14-SNAPSHOT dockerfile-maven-plugin maven-plugin
@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant