summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Odvody <podvody@redhat.com>2015-06-17 13:25:06 +0200
committerPavel Odvody <podvody@redhat.com>2015-06-18 12:04:30 +0200
commit4764a54439e51cc3d3d0858a94a2d03a352a628c (patch)
treeca9c7e69208de6e1e58887782724baa702031389
parentafc4290e2c48b8a0803247880b6382d639990504 (diff)
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
-rw-r--r--src/import/pull.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/import/pull.c b/src/import/pull.c
index ca33d2f3fa..ca7be6be85 100644
--- a/src/import/pull.c
+++ b/src/import/pull.c
@@ -245,15 +245,15 @@ static int pull_dkr(int argc, char *argv[], void *userdata) {
if (digest) {
reference = digest + 1;
name = strndupa(argv[1], digest - argv[1]);
- }
-
- reference = strchr(argv[1], ':');
- if (reference) {
- name = strndupa(argv[1], reference - argv[1]);
- reference++;
} else {
- name = argv[1];
- reference = "latest";
+ reference = strchr(argv[1], ':');
+ if (reference) {
+ name = strndupa(argv[1], reference - argv[1]);
+ reference++;
+ } else {
+ name = argv[1];
+ reference = "latest";
+ }
}
if (!dkr_name_is_valid(name)) {