mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-08-30 05:50:12 +03:00
import/pull: fix pulling by image digest
When pulling by image digest the identifiers that were produced by parsing image digest were later overwritten by code parsing image tag. This resulted in invalid identifiers being used when contacting the remote endpoint, resulting in 404. Reported here: http://lists.freedesktop.org/archives/systemd-devel/2015-June/033039.html
This commit is contained in:
@ -245,8 +245,7 @@ static int pull_dkr(int argc, char *argv[], void *userdata) {
|
||||
if (digest) {
|
||||
reference = digest + 1;
|
||||
name = strndupa(argv[1], digest - argv[1]);
|
||||
}
|
||||
|
||||
} else {
|
||||
reference = strchr(argv[1], ':');
|
||||
if (reference) {
|
||||
name = strndupa(argv[1], reference - argv[1]);
|
||||
@ -255,6 +254,7 @@ static int pull_dkr(int argc, char *argv[], void *userdata) {
|
||||
name = argv[1];
|
||||
reference = "latest";
|
||||
}
|
||||
}
|
||||
|
||||
if (!dkr_name_is_valid(name)) {
|
||||
log_error("Remote name '%s' is not valid.", name);
|
||||
|
Reference in New Issue
Block a user