diff --git a/src/connect/client/grpc/grpc_isula_image_client.cc b/src/connect/client/grpc/grpc_isula_image_client.cc index b968dba66ed1d2f9155e21b329b56380789a7ed4..688f98d4b381790d1ba933613634bf496fbdce72 100644 --- a/src/connect/client/grpc/grpc_isula_image_client.cc +++ b/src/connect/client/grpc/grpc_isula_image_client.cc @@ -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; } diff --git a/src/image/oci/oci_config_merge.c b/src/image/oci/oci_config_merge.c index 911429d322d95baeb5378e8f2970ec5ccca43c79..bc2029d7f1b055349649b4c24af0319808f4fa0a 100644 --- a/src/image/oci/oci_config_merge.c +++ b/src/image/oci/oci_config_merge.c @@ -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; diff --git a/test/image/oci/oci_config_merge/oci_config_merge_llt.cc b/test/image/oci/oci_config_merge/oci_config_merge_llt.cc index 6aeb3a192046fe48d9ceb947ecb6af42f64a4f09..d7f7b72bb28e320aca374948173087c367ce8779 100644 --- a/test/image/oci/oci_config_merge/oci_config_merge_llt.cc +++ b/test/image/oci/oci_config_merge/oci_config_merge_llt.cc @@ -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; diff --git a/test/test.sh b/test/test.sh index 4568fdd1a8c4eee97ab8acea2633b31c4469f799..38e59ad172bdc094b82e3524d4d86e81a40de6d6 100755 --- a/test/test.sh +++ b/test/test.sh @@ -1,3 +1,6 @@ +#! /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() { diff --git a/tools/static_check b/tools/static_check index 51c4b018ec35fd5647624246629d917f892f89f3..5a1c4703cf0e385b21d02cc63e92f448659d9f9e 100755 --- a/tools/static_check +++ b/tools/static_check @@ -1,3 +1,7 @@ +#!/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"