提交 26771306 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!32 lcr: compatible with older versions of creation

Merge pull request !32 from wangkang101/master
......@@ -270,6 +270,22 @@ out_free:
free(path);
}
bool lcr_create_from_ocidata(const char *name, const char *lcrpath, const void *oci_json_data)
{
oci_runtime_spec *oci_spec = NULL;
bool ret = true;
if (!container_parse(NULL, oci_json_data, &oci_spec)) {
ret = false;
goto out_free;
}
ret = lcr_create(name, lcrpath, oci_spec);
out_free:
free_oci_runtime_spec(oci_spec);
return ret;
}
static bool lcr_create_spec(struct lxc_container *c, oci_runtime_spec *oci_spec)
{
// Translate oci config
......
......@@ -139,10 +139,17 @@ void lcr_containers_info_free(struct lcr_container_info **info_arr, size_t size)
/*
* Create a container
* param name : container name
* param lcrpath: container path
* param rootfs : the path of rootfs used for the container
* param oci_config_data : json string of oci config data
* param name : container name
* param lcrpath : container path
* param oci_json_data : json string of oci config data
*/
bool lcr_create_from_ocidata(const char *name, const char *lcrpath, const void *oci_json_data);
/*
* Create a container
* param name : container name
* param lcrpath : container path
* param oci_config : pointer of struct oci config
*/
bool lcr_create(const char *name, const char *lcrpath, void *oci_config);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册