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

!431 Enhance health check configuration verification

Merge pull request !431 from JingWoo/masterx
......@@ -69,7 +69,7 @@ static int copy_image_health_check_config(const isula::Image &gimage, struct ima
int ret = 0;
defs_health_check *health_check = nullptr;
if (!gimage.has_healthcheck()) {
if (!gimage.has_healthcheck() || gimage.healthcheck().test_size() == 0) {
return 0;
}
......
......@@ -300,15 +300,10 @@ static int oci_image_merge_health_check(const defs_health_check *image_health_ch
{
int ret = 0;
if (image_health_check == NULL) {
if (image_health_check == NULL || image_health_check->test_len == 0) {
return 0;
}
if (image_health_check->test_len == 0) {
ERROR("health check commands required");
return -1;
}
if (container_spec->health_check == NULL) {
if (dup_health_check_from_image(image_health_check, container_spec) != 0) {
ret = -1;
......
......@@ -404,7 +404,7 @@ TEST(oci_config_merge_llt, test_oci_image_merge_config)
custom_config = (container_config *) util_common_calloc_s(sizeof(container_config));
ASSERT_TRUE(custom_config != NULL);
ASSERT_NE(oci_image_merge_config(tool_image, custom_config), 0);
ASSERT_EQ(oci_image_merge_config(tool_image, custom_config), 0);
free_imagetool_image(tool_image);
tool_image = NULL;
......
#! /bin/bash
#set -xe
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2019. All rights reserved.
# - iSulad licensed under the Mulan PSL v2.
......@@ -12,9 +15,7 @@
##- @Author: wujing
##- @Create: 2019-04-25
#######################################################################
#! /bin/bash
#set -xe
function usage()
{
......
#!/bin/bash
#
# This script is the implementation portal for the iSulad project Personal level build static check.
# set -euxo pipefail
#######################################################################
##- @Copyright (C) Huawei Technologies., Ltd. 2019. All rights reserved.
# - iSulad licensed under the Mulan PSL v2.
......@@ -12,10 +16,6 @@
##- @Author: wujing
##- @Create: 2019-04-25
#######################################################################
#!/bin/bash
#
# This script is the implementation portal for the iSulad project Personal level build static check.
# set -euxo pipefail
CURRENT_PATH=$(pwd)
CI_TOOLS_PROJECT="/root/workspace/ci_tools"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册