summaryrefslogtreecommitdiffstats
path: root/src/rest.c
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2022-05-25 17:33:36 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-05-26 15:15:52 +0200
commitc0573b9ef05bc1c22a6b5b71c2f73ba18a8696f1 (patch)
treea872689bc46cba3dd52a4bf3ace35d5d7a440c10 /src/rest.c
parentb86b6e1443a6dfd21fa1520f7c4421a44d3595f3 (diff)
#915 Set repository on image creation
Assign to the image the repository indicated in the JSON body instead of a default one.
Diffstat (limited to 'src/rest.c')
-rw-r--r--src/rest.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rest.c b/src/rest.c
index b5fcda7..5f6d3ec 100644
--- a/src/rest.c
+++ b/src/rest.c
@@ -2127,7 +2127,9 @@ int og_json_parse_create_image(json_t *element,
sizeof(params->image.name));
params->flags |= OG_REST_PARAM_NAME;
} else if (!strcmp(key, "repository")) {
- err = og_json_parse_string(value, &params->repository);
+ err = og_json_parse_string_copy(value,
+ (char *)&params->image.repo_ip,
+ sizeof(params->image.repo_ip));
params->flags |= OG_REST_PARAM_REPO;
} else if (!strcmp(key, "clients")) {
err = og_json_parse_clients(value, params);