diff --git a/CMakeLists.txt b/CMakeLists.txt index 4988768..d71ced1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,13 +9,7 @@ include(cmake/set_build_flags.cmake) #set(CMAKE_C_COMPILER "gcc" CACHE PATH "c compiler") -# Get the latest abbreviated commit hash of the working branch -execute_process( - COMMAND git rev-parse HEAD - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE GIT_COMMIT_HASH - OUTPUT_STRIP_TRAILING_WHITESPACE -) +set(GIT_COMMIT_HASH "d03048c03e5f83d8de4e6f164f354a9cb8316362") message("-- commit id: " ${GIT_COMMIT_HASH}) add_definitions(-DISULAD_GIT_COMMIT="${GIT_COMMIT_HASH}") diff --git a/Dockerfile b/Dockerfile index aac2062..dbf786b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ ####################################################################### ##- @Copyright (C) Huawei Technologies., Ltd. 2019. All rights reserved. -# - lcr licensed under the Mulan PSL v1. -# - You can use this software according to the terms and conditions of the Mulan PSL v1. -# - You may obtain a copy of Mulan PSL v1 at: -# - http://license.coscl.org.cn/MulanPSL +# - lcr licensed under the Mulan PSL v2. +# - You can use this software according to the terms and conditions of the Mulan PSL v2. +# - You may obtain a copy of Mulan PSL v2 at: +# - http://license.coscl.org.cn/MulanPSL2 # - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR # - IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR # - PURPOSE. -# - See the Mulan PSL v1 for more details. +# - See the Mulan PSL v2 for more details. ##- @Description: prepare compile container envrionment ##- @Author: lifeng ##- @Create: 2020-01-10 diff --git a/README.md b/README.md index 5faa3b3..8939e3c 100644 --- a/README.md +++ b/README.md @@ -71,4 +71,4 @@ iSulad follows the kernel coding conventions. You can find a detailed introducti ## Licensing -iSulad is licensed under the Mulan PSL v1. +iSulad is licensed under the Mulan PSL v2. diff --git a/iSulad.spec b/iSulad.spec index dd8b594..d8e7dde 100644 --- a/iSulad.spec +++ b/iSulad.spec @@ -1,5 +1,5 @@ %global _version 2.0.0 -%global _release 20200321.032232.gitaec8336d +%global _release 20200406.224614.gitd03048c0 %global is_systemd 1 %global debug_package %{nil} @@ -7,7 +7,7 @@ Name: iSulad Version: %{_version} Release: %{_release} Summary: Lightweight Container Runtime Daemon -License: Mulan PSL v1 +License: Mulan PSL v2 URL: isulad Source: iSulad-2.0.tar.gz BuildRoot: {_tmppath}/iSulad-%{version} diff --git a/src/api/image_client/isula_image.proto b/src/api/image_client/isula_image.proto index 4a01932..5dec0da 100644 --- a/src/api/image_client/isula_image.proto +++ b/src/api/image_client/isula_image.proto @@ -1,13 +1,13 @@ // ####################################################################### // ##- @Copyright (C) Huawei Technologies., Ltd. 2019-2020. All rights reserved. -// # - iSulad licensed under the Mulan PSL v1. -// # - You can use this software according to the terms and conditions of the Mulan PSL v1. -// # - You may obtain a copy of Mulan PSL v1 at: -// # - http://license.coscl.org.cn/MulanPSL +// # - iSulad licensed under the Mulan PSL v2. +// # - You can use this software according to the terms and conditions of the Mulan PSL v2. +// # - You may obtain a copy of Mulan PSL v2 at: +// # - http://license.coscl.org.cn/MulanPSL2 // # - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR // # - IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR // # - PURPOSE. -// # - See the Mulan PSL v1 for more details. +// # - See the Mulan PSL v2 for more details. // ##- @Description: generate grpc // ##- @Author: wujing // ##- @Create: 2020-01-26 @@ -78,6 +78,9 @@ service ImageService { // get status of graphdriver rpc GraphdriverStatus(GraphdriverStatusRequest) returns (GraphdriverStatusResponse) {} + // get metadata of graphdriver + rpc GraphdriverMetadata(GraphdriverMetadataRequest) returns (GraphdriverMetadataResponse) {} + // login registry rpc Login(LoginRequest) returns (LoginResponse) {} // logout registry @@ -85,6 +88,9 @@ service ImageService { // health check service rpc HealthCheck(HealthCheckRequest) returns (HealthCheckResponse) {} + + // Add a tag to the image + rpc TagImage(TagImageRequest) returns (TagImageResponse) {} } message HealthCheckRequest {} @@ -146,6 +152,17 @@ message GraphdriverStatusResponse { uint32 cc = 3; } +message GraphdriverMetadataRequest { + string name_id = 1; +} + +message GraphdriverMetadataResponse { + map metadata = 1; + string name = 2; + string errmsg = 3; + uint32 cc = 4; +} + message ContainerFsUsageRequest { string name_id = 1; } @@ -412,6 +429,15 @@ message ListImagesRequest { bool check = 2; } +message HealthCheck { + repeated string test = 1; + int64 interval = 2; + int64 timeout = 3; + int64 start_period = 4; + int32 retries = 5; + bool exit_on_unhealthy = 6; +} + // Basic information about a container image. message Image { // ID of the image. @@ -438,6 +464,9 @@ message Image { // oci image spec ImageSpec spec = 9; + + // Health check + HealthCheck healthcheck = 10; } message ListImagesResponse { @@ -557,3 +586,13 @@ message ImageFsInfoResponse { string errmsg = 2; uint32 cc = 3; } + +message TagImageRequest { + ImageSpec srcName = 1; + ImageSpec destName = 2; +} + +message TagImageResponse { + string errmsg = 1; + uint32 cc = 2; +} diff --git a/src/api/services/containers/container.proto b/src/api/services/containers/container.proto index c1a1beb..8b76753 100644 --- a/src/api/services/containers/container.proto +++ b/src/api/services/containers/container.proto @@ -1,13 +1,13 @@ // ####################################################################### // ##- @Copyright (C) Huawei Technologies., Ltd. 2019. All rights reserved. -// # - iSulad licensed under the Mulan PSL v1. -// # - You can use this software according to the terms and conditions of the Mulan PSL v1. -// # - You may obtain a copy of Mulan PSL v1 at: -// # - http://license.coscl.org.cn/MulanPSL +// # - iSulad licensed under the Mulan PSL v2. +// # - You can use this software according to the terms and conditions of the Mulan PSL v2. +// # - You may obtain a copy of Mulan PSL v2 at: +// # - http://license.coscl.org.cn/MulanPSL2 // # - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR // # - IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR // # - PURPOSE. -// # - See the Mulan PSL v1 for more details. +// # - See the Mulan PSL v2 for more details. // ##- @Description: generate grpc // ##- @Author: wujing // ##- @Create: 2019-04-25 @@ -324,7 +324,8 @@ message RemoteExecRequest { } message RemoteExecResponse { bytes stdout = 1; - bool finish = 2; + bytes stderr = 2; + bool finish = 3; } message AttachRequest { diff --git a/src/api/services/containers/rest/container.rest.h b/src/api/services/containers/rest/container.rest.h index f848e55..72305fa 100644 --- a/src/api/services/containers/rest/container.rest.h +++ b/src/api/services/containers/rest/container.rest.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-22 * Description: provide container rest definition diff --git a/src/api/services/health/health.proto b/src/api/services/health/health.proto index 84cf357..a3d3537 100644 --- a/src/api/services/health/health.proto +++ b/src/api/services/health/health.proto @@ -1,13 +1,13 @@ // ####################################################################### // ##- @Copyright (C) Huawei Technologies., Ltd. 2019-2020. All rights reserved. -// # - iSulad licensed under the Mulan PSL v1. -// # - You can use this software according to the terms and conditions of the Mulan PSL v1. -// # - You may obtain a copy of Mulan PSL v1 at: -// # - http://license.coscl.org.cn/MulanPSL +// # - iSulad licensed under the Mulan PSL v2. +// # - You can use this software according to the terms and conditions of the Mulan PSL v2. +// # - You may obtain a copy of Mulan PSL v2 at: +// # - http://license.coscl.org.cn/MulanPSL2 // # - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR // # - IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR // # - PURPOSE. -// # - See the Mulan PSL v1 for more details. +// # - See the Mulan PSL v2 for more details. // ##- @Description: generate grpc // ##- @Author: tanyifeng // ##- @Create: 2020-01-16 diff --git a/src/api/services/images/images.proto b/src/api/services/images/images.proto index 3d86722..c93a4f4 100644 --- a/src/api/services/images/images.proto +++ b/src/api/services/images/images.proto @@ -1,13 +1,13 @@ // ####################################################################### // ##- @Copyright (C) Huawei Technologies., Ltd. 2019-2020. All rights reserved. -// # - iSulad licensed under the Mulan PSL v1. -// # - You can use this software according to the terms and conditions of the Mulan PSL v1. -// # - You may obtain a copy of Mulan PSL v1 at: -// # - http://license.coscl.org.cn/MulanPSL +// # - iSulad licensed under the Mulan PSL v2. +// # - You can use this software according to the terms and conditions of the Mulan PSL v2. +// # - You may obtain a copy of Mulan PSL v2 at: +// # - http://license.coscl.org.cn/MulanPSL2 // # - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR // # - IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR // # - PURPOSE. -// # - See the Mulan PSL v1 for more details. +// # - See the Mulan PSL v2 for more details. // ##- @Description: generate grpc // ##- @Author: wujing // ##- @Create: 2020-01-16 @@ -70,6 +70,9 @@ service ImagesService { // Logout from a Docker registry rpc Logout(LogoutRequest) returns (LogoutResponse); + + // Add a tag to the image + rpc Tag(TagImageRequest) returns (TagImageResponse); } message Image { @@ -126,6 +129,16 @@ message DeleteImageResponse { string errmsg = 3; } +message TagImageRequest { + string src_name = 1; + string dest_name = 2; +} + +message TagImageResponse { + uint32 cc = 1; + string errmsg = 2; +} + message LoadImageRequest { string file = 1; string type = 2; diff --git a/src/api/services/images/rest/image.rest.h b/src/api/services/images/rest/image.rest.h index 872a132..3359d39 100644 --- a/src/api/services/images/rest/image.rest.h +++ b/src/api/services/images/rest/image.rest.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2017-11-22 * Description: provide container image rest definition diff --git a/src/api/types/descriptor.proto b/src/api/types/descriptor.proto index 5323f00..38b9d19 100644 --- a/src/api/types/descriptor.proto +++ b/src/api/types/descriptor.proto @@ -1,13 +1,13 @@ // ####################################################################### // ##- @Copyright (C) Huawei Technologies., Ltd. 2019-2020. All rights reserved. -// # - iSulad licensed under the Mulan PSL v1. -// # - You can use this software according to the terms and conditions of the Mulan PSL v1. -// # - You may obtain a copy of Mulan PSL v1 at: -// # - http://license.coscl.org.cn/MulanPSL +// # - iSulad licensed under the Mulan PSL v2. +// # - You can use this software according to the terms and conditions of the Mulan PSL v2. +// # - You may obtain a copy of Mulan PSL v2 at: +// # - http://license.coscl.org.cn/MulanPSL2 // # - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR // # - IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR // # - PURPOSE. -// # - See the Mulan PSL v1 for more details. +// # - See the Mulan PSL v2 for more details. // ##- @Description: generate grpc // ##- @Author: wujing // ##- @Create: 2019-01-16 diff --git a/src/cmd/commander.c b/src/cmd/commander.c index cfd1b18..307552e 100644 --- a/src/cmd/commander.c +++ b/src/cmd/commander.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide command functions diff --git a/src/cmd/commander.h b/src/cmd/commander.h index a7b13de..e849bea 100644 --- a/src/cmd/commander.h +++ b/src/cmd/commander.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide command definition diff --git a/src/cmd/isula/arguments.c b/src/cmd/isula/arguments.c index 853239f..5c96033 100644 --- a/src/cmd/isula/arguments.c +++ b/src/cmd/isula/arguments.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2017-11-22 * Description: provide container client arguments functions diff --git a/src/cmd/isula/arguments.h b/src/cmd/isula/arguments.h index fcf57ae..001d4c3 100644 --- a/src/cmd/isula/arguments.h +++ b/src/cmd/isula/arguments.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2017-11-22 * Description: provide container client arguments definition diff --git a/src/cmd/isula/base/create.c b/src/cmd/isula/base/create.c index 0a662d6..43951b8 100644 --- a/src/cmd/isula/base/create.c +++ b/src/cmd/isula/base/create.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2017-11-22 * Description: provide container create functions diff --git a/src/cmd/isula/base/create.h b/src/cmd/isula/base/create.h index bbfa53c..ca514e9 100644 --- a/src/cmd/isula/base/create.h +++ b/src/cmd/isula/base/create.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2017-11-22 * Description: provide container create definition diff --git a/src/cmd/isula/base/kill.c b/src/cmd/isula/base/kill.c index 62d00dc..7786003 100644 --- a/src/cmd/isula/base/kill.c +++ b/src/cmd/isula/base/kill.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container kill functions diff --git a/src/cmd/isula/base/kill.h b/src/cmd/isula/base/kill.h index 8b08786..eb28c3c 100644 --- a/src/cmd/isula/base/kill.h +++ b/src/cmd/isula/base/kill.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container kill definition diff --git a/src/cmd/isula/base/rename.c b/src/cmd/isula/base/rename.c index 1eaf970..9e4c103 100644 --- a/src/cmd/isula/base/rename.c +++ b/src/cmd/isula/base/rename.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container stop functions diff --git a/src/cmd/isula/base/rename.h b/src/cmd/isula/base/rename.h index 2f9c211..cdd75fa 100644 --- a/src/cmd/isula/base/rename.h +++ b/src/cmd/isula/base/rename.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container rename definition diff --git a/src/cmd/isula/base/restart.c b/src/cmd/isula/base/restart.c index f7b283e..5a906ae 100644 --- a/src/cmd/isula/base/restart.c +++ b/src/cmd/isula/base/restart.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container restart functions diff --git a/src/cmd/isula/base/restart.h b/src/cmd/isula/base/restart.h index 0f1e00c..805d03d 100644 --- a/src/cmd/isula/base/restart.h +++ b/src/cmd/isula/base/restart.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container restart definition diff --git a/src/cmd/isula/base/rm.c b/src/cmd/isula/base/rm.c index 25e016d..808ad1e 100644 --- a/src/cmd/isula/base/rm.c +++ b/src/cmd/isula/base/rm.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container remove functions diff --git a/src/cmd/isula/base/rm.h b/src/cmd/isula/base/rm.h index c89d7cf..9d73ad7 100644 --- a/src/cmd/isula/base/rm.h +++ b/src/cmd/isula/base/rm.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container remove definition diff --git a/src/cmd/isula/base/run.c b/src/cmd/isula/base/run.c index 7e846ba..be20c15 100644 --- a/src/cmd/isula/base/run.c +++ b/src/cmd/isula/base/run.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container run functions diff --git a/src/cmd/isula/base/run.h b/src/cmd/isula/base/run.h index 1589a2b..e1ba13d 100644 --- a/src/cmd/isula/base/run.h +++ b/src/cmd/isula/base/run.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container run definition diff --git a/src/cmd/isula/base/start.c b/src/cmd/isula/base/start.c index fc98e8a..0859084 100644 --- a/src/cmd/isula/base/start.c +++ b/src/cmd/isula/base/start.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2018-11-08 * Description: provide container start functions diff --git a/src/cmd/isula/base/start.h b/src/cmd/isula/base/start.h index 69945cc..be2c3ed 100644 --- a/src/cmd/isula/base/start.h +++ b/src/cmd/isula/base/start.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2018-11-08 * Description: provide container start definition diff --git a/src/cmd/isula/base/stop.c b/src/cmd/isula/base/stop.c index 201b012..d113953 100644 --- a/src/cmd/isula/base/stop.c +++ b/src/cmd/isula/base/stop.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container stop functions diff --git a/src/cmd/isula/base/stop.h b/src/cmd/isula/base/stop.h index 9b6fdcb..5572ad1 100644 --- a/src/cmd/isula/base/stop.h +++ b/src/cmd/isula/base/stop.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container stop definition diff --git a/src/cmd/isula/commands.c b/src/cmd/isula/commands.c index 558427e..0c6c1ef 100644 --- a/src/cmd/isula/commands.c +++ b/src/cmd/isula/commands.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2017-11-22 * Description: provide container command functions diff --git a/src/cmd/isula/commands.h b/src/cmd/isula/commands.h index 06f6cf3..0effdfb 100644 --- a/src/cmd/isula/commands.h +++ b/src/cmd/isula/commands.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2017-11-22 * Description: provide container commands definition diff --git a/src/cmd/isula/extend/events.c b/src/cmd/isula/extend/events.c index 9516238..6cd582c 100644 --- a/src/cmd/isula/extend/events.c +++ b/src/cmd/isula/extend/events.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container events functions diff --git a/src/cmd/isula/extend/events.h b/src/cmd/isula/extend/events.h index 0943526..6829344 100644 --- a/src/cmd/isula/extend/events.h +++ b/src/cmd/isula/extend/events.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container events definition diff --git a/src/cmd/isula/extend/export.c b/src/cmd/isula/extend/export.c index d5765a5..961e305 100644 --- a/src/cmd/isula/extend/export.c +++ b/src/cmd/isula/extend/export.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wangfengtu * Create: 2019-04-04 * Description: provide container export functions diff --git a/src/cmd/isula/extend/export.h b/src/cmd/isula/extend/export.h index dada33f..5ba0fe7 100644 --- a/src/cmd/isula/extend/export.h +++ b/src/cmd/isula/extend/export.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wangfengtu * Create: 2019-04-04 * Description: provide container resume definition diff --git a/src/cmd/isula/extend/pause.c b/src/cmd/isula/extend/pause.c index 8f12d4b..89ceb8a 100644 --- a/src/cmd/isula/extend/pause.c +++ b/src/cmd/isula/extend/pause.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container pause functions diff --git a/src/cmd/isula/extend/pause.h b/src/cmd/isula/extend/pause.h index 1facb0e..88f3877 100644 --- a/src/cmd/isula/extend/pause.h +++ b/src/cmd/isula/extend/pause.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container pause definition diff --git a/src/cmd/isula/extend/resume.c b/src/cmd/isula/extend/resume.c index 7e6bb52..d849cef 100644 --- a/src/cmd/isula/extend/resume.c +++ b/src/cmd/isula/extend/resume.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container resume functions diff --git a/src/cmd/isula/extend/resume.h b/src/cmd/isula/extend/resume.h index 1aff634..e00907e 100644 --- a/src/cmd/isula/extend/resume.h +++ b/src/cmd/isula/extend/resume.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container resume definition diff --git a/src/cmd/isula/extend/stats.c b/src/cmd/isula/extend/stats.c index 02131d1..dd14075 100644 --- a/src/cmd/isula/extend/stats.c +++ b/src/cmd/isula/extend/stats.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container stats functions diff --git a/src/cmd/isula/extend/stats.h b/src/cmd/isula/extend/stats.h index 5634d3b..5de99bc 100644 --- a/src/cmd/isula/extend/stats.h +++ b/src/cmd/isula/extend/stats.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container stats definition diff --git a/src/cmd/isula/extend/update.c b/src/cmd/isula/extend/update.c index 8e25bca..a903f78 100644 --- a/src/cmd/isula/extend/update.c +++ b/src/cmd/isula/extend/update.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container update functions diff --git a/src/cmd/isula/extend/update.h b/src/cmd/isula/extend/update.h index b026800..9a23839 100644 --- a/src/cmd/isula/extend/update.h +++ b/src/cmd/isula/extend/update.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container update definition diff --git a/src/cmd/isula/images/images.c b/src/cmd/isula/images/images.c index b6eee35..6670b14 100644 --- a/src/cmd/isula/images/images.c +++ b/src/cmd/isula/images/images.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container image functions diff --git a/src/cmd/isula/images/images.h b/src/cmd/isula/images/images.h index 9e46bbe..34a89d3 100644 --- a/src/cmd/isula/images/images.h +++ b/src/cmd/isula/images/images.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container images definition diff --git a/src/cmd/isula/images/load.c b/src/cmd/isula/images/load.c index 1279d19..1be5bd7 100644 --- a/src/cmd/isula/images/load.c +++ b/src/cmd/isula/images/load.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container load functions diff --git a/src/cmd/isula/images/load.h b/src/cmd/isula/images/load.h index 372716b..1818b2f 100644 --- a/src/cmd/isula/images/load.h +++ b/src/cmd/isula/images/load.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container load definition diff --git a/src/cmd/isula/images/login.c b/src/cmd/isula/images/login.c index 3b68059..a688ab3 100644 --- a/src/cmd/isula/images/login.c +++ b/src/cmd/isula/images/login.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wangfengtu * Create: 2019-6-18 * Description: provide login diff --git a/src/cmd/isula/images/login.h b/src/cmd/isula/images/login.h index d250334..701c32e 100644 --- a/src/cmd/isula/images/login.h +++ b/src/cmd/isula/images/login.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wangfengtu * Description: provide login definition ******************************************************************************/ diff --git a/src/cmd/isula/images/logout.c b/src/cmd/isula/images/logout.c index eaab5e2..7cab74c 100644 --- a/src/cmd/isula/images/logout.c +++ b/src/cmd/isula/images/logout.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wangfengtu * Create: 2019-6-18 * Description: provide logout diff --git a/src/cmd/isula/images/logout.h b/src/cmd/isula/images/logout.h index d3ee77b..2e34b7d 100644 --- a/src/cmd/isula/images/logout.h +++ b/src/cmd/isula/images/logout.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wangfengtu * Description: provide logout definition ******************************************************************************/ diff --git a/src/cmd/isula/images/pull.c b/src/cmd/isula/images/pull.c index f9b76e3..2aaa01e 100644 --- a/src/cmd/isula/images/pull.c +++ b/src/cmd/isula/images/pull.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2019-3-29 * Description: provide pull image diff --git a/src/cmd/isula/images/pull.h b/src/cmd/isula/images/pull.h index 3cab4e4..6e319fe 100644 --- a/src/cmd/isula/images/pull.h +++ b/src/cmd/isula/images/pull.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2019-3-29 * Description: provide pull image diff --git a/src/cmd/isula/images/rmi.c b/src/cmd/isula/images/rmi.c index 98625bd..3d3e3fa 100644 --- a/src/cmd/isula/images/rmi.c +++ b/src/cmd/isula/images/rmi.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container remove functions diff --git a/src/cmd/isula/images/rmi.h b/src/cmd/isula/images/rmi.h index d2962e7..b6848d9 100644 --- a/src/cmd/isula/images/rmi.h +++ b/src/cmd/isula/images/rmi.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container remove definition diff --git a/src/cmd/isula/images/tag.c b/src/cmd/isula/images/tag.c new file mode 100644 index 0000000..505aa60 --- /dev/null +++ b/src/cmd/isula/images/tag.c @@ -0,0 +1,123 @@ +/****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR + * PURPOSE. + * See the Mulan PSL v2 for more details. + * Author: wangfengtu + * Create: 2020-04-15 + * Description: provide image tag functions + ******************************************************************************/ +#include "tag.h" +#include +#include +#include +#include + +#include "utils.h" +#include "arguments.h" +#include "isula_connect.h" +#include "log.h" + +const char g_cmd_tag_desc[] = "Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE"; +const char g_cmd_tag_usage[] = "tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]"; + +struct client_arguments g_cmd_tag_args = {}; + +/* + * Add a tag to the image + */ +static int client_tag(const struct client_arguments *args) +{ + isula_connect_ops *ops = NULL; + struct isula_tag_request request = { 0 }; + struct isula_tag_response *response = NULL; + client_connect_config_t config = { 0 }; + int ret = 0; + + response = util_common_calloc_s(sizeof(struct isula_tag_response)); + if (response == NULL) { + ERROR("Out of memory"); + return -1; + } + + request.src_name = args->image_name; + request.dest_name = args->tag; + + ops = get_connect_client_ops(); + if (ops == NULL || !ops->image.tag) { + ERROR("Unimplemented ops"); + ret = -1; + goto out; + } + config = get_connect_config(args); + ret = ops->image.tag(&request, response, &config); + if (ret) { + client_print_error(response->cc, response->server_errono, response->errmsg); + if (response->server_errono) { + ret = ESERVERERROR; + } + goto out; + } +out: + isula_tag_response_free(response); + return ret; +} + +int cmd_tag_main(int argc, const char **argv) +{ + struct log_config lconf = { 0 }; + int exit_code = 1; + command_t cmd; + struct command_option options[] = { + LOG_OPTIONS(lconf), + COMMON_OPTIONS(g_cmd_tag_args), + }; + + set_default_command_log_config(argv[0], &lconf); + if (client_arguments_init(&g_cmd_tag_args)) { + COMMAND_ERROR("client arguments init failed"); + exit(ECOMMON); + } + g_cmd_tag_args.progname = argv[0]; + command_init(&cmd, options, sizeof(options) / sizeof(options[0]), argc, (const char **)argv, g_cmd_tag_desc, + g_cmd_tag_usage); + if (command_parse_args(&cmd, &g_cmd_tag_args.argc, &g_cmd_tag_args.argv)) { + exit(exit_code); + } + if (log_init(&lconf)) { + COMMAND_ERROR("RMI: log init failed"); + exit(exit_code); + } + + if (g_cmd_tag_args.argc != 2) { + COMMAND_ERROR("\"tag\" requires exactly 2 arguments."); + exit(exit_code); + } + + g_cmd_tag_args.image_name = g_cmd_tag_args.argv[0]; + g_cmd_tag_args.tag = g_cmd_tag_args.argv[1]; + + if (!util_valid_image_name(g_cmd_tag_args.image_name)) { + COMMAND_ERROR("%s is not a valid image name", g_cmd_tag_args.image_name); + exit(exit_code); + } + + if (!util_valid_tag(g_cmd_tag_args.tag)) { + COMMAND_ERROR("%s is not a valid tag", g_cmd_tag_args.tag); + exit(exit_code); + } + + int ret = client_tag(&g_cmd_tag_args); + if (ret != 0) { + COMMAND_ERROR("Tag image \"%s\" to \"%s\" failed", g_cmd_tag_args.image_name, g_cmd_tag_args.tag); + exit(exit_code); + } + + exit(EXIT_SUCCESS); +} + diff --git a/src/cmd/isula/images/tag.h b/src/cmd/isula/images/tag.h new file mode 100644 index 0000000..bb36cbd --- /dev/null +++ b/src/cmd/isula/images/tag.h @@ -0,0 +1,34 @@ +/****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR + * PURPOSE. + * See the Mulan PSL v2 for more details. + * Author: wangfengtu + * Create: 2020-04-15 + * Description: provide image tag definition + ******************************************************************************/ +#ifndef __CMD_TAG_IMAGE_H +#define __CMD_TAG_IMAGE_H + +#include "arguments.h" + +#ifdef __cplusplus +extern "C" { +#endif + +extern const char g_cmd_tag_desc[]; +extern const char g_cmd_tag_usage[]; +extern struct client_arguments g_cmd_tag_args; +int cmd_tag_main(int argc, const char **argv); + +#ifdef __cplusplus +} +#endif + +#endif /* __CMD_TAG_IMAGE_H */ + diff --git a/src/cmd/isula/information/health.c b/src/cmd/isula/information/health.c index 1596526..7078e97 100644 --- a/src/cmd/isula/information/health.c +++ b/src/cmd/isula/information/health.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container health functions diff --git a/src/cmd/isula/information/health.h b/src/cmd/isula/information/health.h index bc6919a..ad11b0e 100644 --- a/src/cmd/isula/information/health.h +++ b/src/cmd/isula/information/health.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container health definition diff --git a/src/cmd/isula/information/info.c b/src/cmd/isula/information/info.c index bcb81f8..60630dd 100644 --- a/src/cmd/isula/information/info.c +++ b/src/cmd/isula/information/info.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2018-11-08 * Description: provide container info functions diff --git a/src/cmd/isula/information/info.h b/src/cmd/isula/information/info.h index 19eb055..525df46 100644 --- a/src/cmd/isula/information/info.h +++ b/src/cmd/isula/information/info.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2018-11-08 * Description: provide container info definition diff --git a/src/cmd/isula/information/inspect.c b/src/cmd/isula/information/inspect.c index 81c1144..492a210 100644 --- a/src/cmd/isula/information/inspect.c +++ b/src/cmd/isula/information/inspect.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container inspect functions diff --git a/src/cmd/isula/information/inspect.h b/src/cmd/isula/information/inspect.h index dfe4252..3c7a28e 100644 --- a/src/cmd/isula/information/inspect.h +++ b/src/cmd/isula/information/inspect.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container inspect definition diff --git a/src/cmd/isula/information/logs.c b/src/cmd/isula/information/logs.c index a93b53b..0f5c10d 100644 --- a/src/cmd/isula/information/logs.c +++ b/src/cmd/isula/information/logs.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container logs functions diff --git a/src/cmd/isula/information/logs.h b/src/cmd/isula/information/logs.h index dfcfb11..5c3f6b0 100644 --- a/src/cmd/isula/information/logs.h +++ b/src/cmd/isula/information/logs.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container logs definition diff --git a/src/cmd/isula/information/ps.c b/src/cmd/isula/information/ps.c index bea4c3a..db16732 100644 --- a/src/cmd/isula/information/ps.c +++ b/src/cmd/isula/information/ps.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container ps functions diff --git a/src/cmd/isula/information/ps.h b/src/cmd/isula/information/ps.h index 1e76c6b..b405cff 100644 --- a/src/cmd/isula/information/ps.h +++ b/src/cmd/isula/information/ps.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container ps definition diff --git a/src/cmd/isula/information/top.c b/src/cmd/isula/information/top.c index 5d48e48..3c7fa27 100644 --- a/src/cmd/isula/information/top.c +++ b/src/cmd/isula/information/top.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container remove functions diff --git a/src/cmd/isula/information/top.h b/src/cmd/isula/information/top.h index 6078195..9674a12 100644 --- a/src/cmd/isula/information/top.h +++ b/src/cmd/isula/information/top.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container top definition diff --git a/src/cmd/isula/information/version.c b/src/cmd/isula/information/version.c index 6b42b2b..c4b61a6 100644 --- a/src/cmd/isula/information/version.c +++ b/src/cmd/isula/information/version.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container version functions diff --git a/src/cmd/isula/information/version.h b/src/cmd/isula/information/version.h index be23446..d67b8d1 100644 --- a/src/cmd/isula/information/version.h +++ b/src/cmd/isula/information/version.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container version definition diff --git a/src/cmd/isula/information/wait.c b/src/cmd/isula/information/wait.c index e66dffa..72697ca 100644 --- a/src/cmd/isula/information/wait.c +++ b/src/cmd/isula/information/wait.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container wait functions diff --git a/src/cmd/isula/information/wait.h b/src/cmd/isula/information/wait.h index 594d538..50e2cd9 100644 --- a/src/cmd/isula/information/wait.h +++ b/src/cmd/isula/information/wait.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container wait definition diff --git a/src/cmd/isula/main.c b/src/cmd/isula/main.c index c8d9ef0..6458a35 100644 --- a/src/cmd/isula/main.c +++ b/src/cmd/isula/main.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide init process of isula @@ -28,6 +28,7 @@ #include "run.h" #include "images.h" #include "rmi.h" +#include "tag.h" #include "wait.h" #include "restart.h" #include "pause.h" @@ -190,6 +191,10 @@ struct command g_commands[] = { // `logout` sub-command "logout", cmd_logout_main, g_cmd_logout_desc, NULL, &g_cmd_logout_args }, + { + // `tag` sub-command + "tag", cmd_tag_main, g_cmd_tag_desc, NULL, &g_cmd_tag_args + }, #endif { NULL, NULL, NULL, NULL, NULL } // End of the list }; diff --git a/src/cmd/isula/stream/attach.c b/src/cmd/isula/stream/attach.c index d599d9b..269fa5d 100644 --- a/src/cmd/isula/stream/attach.c +++ b/src/cmd/isula/stream/attach.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2017-11-22 * Description: provide container attach functions diff --git a/src/cmd/isula/stream/attach.h b/src/cmd/isula/stream/attach.h index 41147d0..32457e8 100644 --- a/src/cmd/isula/stream/attach.h +++ b/src/cmd/isula/stream/attach.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2017-11-22 * Description: provide container attach definition diff --git a/src/cmd/isula/stream/cp.c b/src/cmd/isula/stream/cp.c index ecccba1..b5bef1b 100644 --- a/src/cmd/isula/stream/cp.c +++ b/src/cmd/isula/stream/cp.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2019-04-17 * Description: provide container cp functions diff --git a/src/cmd/isula/stream/cp.h b/src/cmd/isula/stream/cp.h index c94a694..7da435c 100644 --- a/src/cmd/isula/stream/cp.h +++ b/src/cmd/isula/stream/cp.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2019-04-17 * Description: provide container cp definition diff --git a/src/cmd/isula/stream/exec.c b/src/cmd/isula/stream/exec.c index 140c166..5494caf 100644 --- a/src/cmd/isula/stream/exec.c +++ b/src/cmd/isula/stream/exec.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container exec functions @@ -422,10 +422,8 @@ int cmd_exec_main(int argc, const char **argv) custom_cfg = &g_cmd_exec_args.custom_conf; - custom_cfg->tty = true; - custom_cfg->open_stdin = true; custom_cfg->attach_stdout = true; - custom_cfg->attach_stderr = false; + custom_cfg->attach_stderr = true; custom_cfg->attach_stdin = custom_cfg->open_stdin; if (g_cmd_exec_args.detach) { diff --git a/src/cmd/isula/stream/exec.h b/src/cmd/isula/stream/exec.h index 37e4cd6..93db54d 100644 --- a/src/cmd/isula/stream/exec.h +++ b/src/cmd/isula/stream/exec.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container exec definition diff --git a/src/cmd/isulad-shim/common.c b/src/cmd/isulad-shim/common.c index abbc67c..779870e 100644 --- a/src/cmd/isulad-shim/common.c +++ b/src/cmd/isulad-shim/common.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: leizhongkai * Create: 2020-1-21 * Description: common functions of isulad-shim diff --git a/src/cmd/isulad-shim/common.h b/src/cmd/isulad-shim/common.h index 2a6c914..9892be9 100644 --- a/src/cmd/isulad-shim/common.h +++ b/src/cmd/isulad-shim/common.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: leizhongkai * Create: 2020-1-20 * Description: common definition of isulad-shim diff --git a/src/cmd/isulad-shim/main.c b/src/cmd/isulad-shim/main.c index 7591832..d27060a 100644 --- a/src/cmd/isulad-shim/main.c +++ b/src/cmd/isulad-shim/main.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: leizhongkai * Create: 2020-1-20 * Description: main process of isulad-shim diff --git a/src/cmd/isulad-shim/process.c b/src/cmd/isulad-shim/process.c index e0498f8..a35dff8 100644 --- a/src/cmd/isulad-shim/process.c +++ b/src/cmd/isulad-shim/process.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: leizhongkai * Create: 2020-1-20 * Description: process operation encapsulation diff --git a/src/cmd/isulad-shim/process.h b/src/cmd/isulad-shim/process.h index 6033dbc..d24c651 100644 --- a/src/cmd/isulad-shim/process.h +++ b/src/cmd/isulad-shim/process.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: leizhongkai * Create: 2020-1-20 * Description: process definition diff --git a/src/cmd/isulad-shim/terminal.c b/src/cmd/isulad-shim/terminal.c index 6b261eb..068a15a 100644 --- a/src/cmd/isulad-shim/terminal.c +++ b/src/cmd/isulad-shim/terminal.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: gaohuatao * Create: 2020-3-9 * Description: container logs ops diff --git a/src/cmd/isulad-shim/terminal.h b/src/cmd/isulad-shim/terminal.h index 2f2ed4e..71162eb 100644 --- a/src/cmd/isulad-shim/terminal.h +++ b/src/cmd/isulad-shim/terminal.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: gaohuatao * Create: 2020-3-9 * Description: container logs ops diff --git a/src/cmd/isulad/arguments.c b/src/cmd/isulad/arguments.c index 3f116db..44ebef1 100644 --- a/src/cmd/isulad/arguments.c +++ b/src/cmd/isulad/arguments.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2017-11-22 * Description: provide container server arguments functions diff --git a/src/cmd/isulad/arguments.h b/src/cmd/isulad/arguments.h index 0833457..a943199 100644 --- a/src/cmd/isulad/arguments.h +++ b/src/cmd/isulad/arguments.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2017-11-22 * Description: provide container server arguments definition diff --git a/src/cmd/isulad/commands.c b/src/cmd/isulad/commands.c index 7873027..4d19955 100644 --- a/src/cmd/isulad/commands.c +++ b/src/cmd/isulad/commands.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2017-11-22 * Description: provide container commands functions diff --git a/src/cmd/isulad/commands.h b/src/cmd/isulad/commands.h index f3228bf..6ef3044 100644 --- a/src/cmd/isulad/commands.h +++ b/src/cmd/isulad/commands.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2017-11-22 * Description: provide container commands definition diff --git a/src/cmd/isulad/main.c b/src/cmd/isulad/main.c index bb8a252..dfdc6f5 100644 --- a/src/cmd/isulad/main.c +++ b/src/cmd/isulad/main.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2017-11-22 * Description: provide init process of isulad diff --git a/src/config/isulad_config.c b/src/config/isulad_config.c index d5c3953..98bfb73 100644 --- a/src/config/isulad_config.c +++ b/src/config/isulad_config.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container configure definition diff --git a/src/config/isulad_config.h b/src/config/isulad_config.h index e06559b..8f754ac 100644 --- a/src/config/isulad_config.h +++ b/src/config/isulad_config.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container configure definition diff --git a/src/connect/client/connect.h b/src/connect/client/connect.h index e2ca451..7db0c8a 100644 --- a/src/connect/client/connect.h +++ b/src/connect/client/connect.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-12 * Description: provide isula connect command definition diff --git a/src/connect/client/grpc/client_base.h b/src/connect/client/grpc/client_base.h index dabf0e4..a9f960f 100644 --- a/src/connect/client/grpc/client_base.h +++ b/src/connect/client/grpc/client_base.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container client base functions diff --git a/src/connect/client/grpc/grpc_client.cc b/src/connect/client/grpc/grpc_client.cc index 154bebf..93f341c 100644 --- a/src/connect/client/grpc/grpc_client.cc +++ b/src/connect/client/grpc/grpc_client.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide grpc ops functions diff --git a/src/connect/client/grpc/grpc_client.h b/src/connect/client/grpc/grpc_client.h index bf0ae37..e59966a 100644 --- a/src/connect/client/grpc/grpc_client.h +++ b/src/connect/client/grpc/grpc_client.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2018-11-08 * Description: provide grpc client definition diff --git a/src/connect/client/grpc/grpc_containers_client.cc b/src/connect/client/grpc/grpc_containers_client.cc index 6050ba6..a9cdbf2 100644 --- a/src/connect/client/grpc/grpc_containers_client.cc +++ b/src/connect/client/grpc/grpc_containers_client.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide grpc containers client functions @@ -1004,7 +1004,12 @@ out: if (stream_response.finish()) { break; } - std::cout << stream_response.stdout() << std::flush; + if (!stream_response.stdout().empty()) { + std::cout << stream_response.stdout() << std::flush; + } + if (!stream_response.stderr().empty()) { + std::cerr << stream_response.stderr() << std::flush; + } } write_task.stop(); stream->WritesDone(); diff --git a/src/connect/client/grpc/grpc_containers_client.h b/src/connect/client/grpc/grpc_containers_client.h index ee9affd..bbdc3de 100644 --- a/src/connect/client/grpc/grpc_containers_client.h +++ b/src/connect/client/grpc/grpc_containers_client.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container grpc client definition diff --git a/src/connect/client/grpc/grpc_images_client.cc b/src/connect/client/grpc/grpc_images_client.cc index 3c924ed..f293f87 100644 --- a/src/connect/client/grpc/grpc_images_client.cc +++ b/src/connect/client/grpc/grpc_images_client.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide grpc container service functions @@ -167,6 +167,62 @@ public: } }; +class ImageTag : public ClientBase { +public: + explicit ImageTag(void *args) + : ClientBase(args) + { + } + ~ImageTag() = default; + + int request_to_grpc(const isula_tag_request *request, TagImageRequest *grequest) override + { + if (request == nullptr) { + return -1; + } + + if (request->src_name != nullptr) { + grequest->set_src_name(request->src_name); + } + if (request->dest_name != nullptr) { + grequest->set_dest_name(request->dest_name); + } + + return 0; + } + + int response_from_grpc(TagImageResponse *gresponse, isula_tag_response *response) override + { + response->server_errono = (uint32_t)gresponse->cc(); + + if (!gresponse->errmsg().empty()) { + response->errmsg = util_strdup_s(gresponse->errmsg().c_str()); + } + + return 0; + } + + int check_parameter(const TagImageRequest &req) override + { + if (req.src_name().empty()) { + ERROR("Missing source image name in the request"); + return -1; + } + if (req.dest_name().empty()) { + ERROR("Missing destition image name in the request"); + return -1; + } + + return 0; + } + + Status grpc_call(ClientContext *context, const TagImageRequest &req, TagImageResponse *reply) override + { + return stub_->Tag(context, req, reply); + } +}; + class ImagesLoad : public ClientBase { public: @@ -468,6 +524,7 @@ int grpc_images_client_ops_init(isula_connect_ops *ops) ops->image.inspect = container_func; ops->image.login = container_func; ops->image.logout = container_func; + ops->image.tag = container_func; return 0; } diff --git a/src/connect/client/grpc/grpc_images_client.h b/src/connect/client/grpc/grpc_images_client.h index 966fb87..aff6832 100644 --- a/src/connect/client/grpc/grpc_images_client.h +++ b/src/connect/client/grpc/grpc_images_client.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide grpc image client definition diff --git a/src/connect/client/grpc/grpc_isula_image_client.cc b/src/connect/client/grpc/grpc_isula_image_client.cc index a7f6c60..4187d29 100644 --- a/src/connect/client/grpc/grpc_isula_image_client.cc +++ b/src/connect/client/grpc/grpc_isula_image_client.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-12 * Description: provide isula connect command definition @@ -64,6 +64,44 @@ int copy_image_digests_metadata(const isula::Image &gimage, struct image_metadat return 0; } +static int copy_image_health_check_config(const isula::Image &gimage, struct image_metadata *metadata) +{ + int ret = 0; + defs_health_check *health_check = nullptr; + + if (!gimage.has_healthcheck()) { + return 0; + } + + health_check = (defs_health_check *)util_common_calloc_s(sizeof(defs_health_check)); + if (health_check == nullptr) { + ERROR("Out of memory"); + ret = -1; + goto out; + } + health_check->test = (char **)util_common_calloc_s(gimage.healthcheck().test_size() * sizeof(char *)); + if (health_check->test == nullptr) { + ERROR("Out of memory"); + ret = -1; + goto out; + } + for (int i {0}; i < gimage.healthcheck().test_size(); i++) { + health_check->test[i] = util_strdup_s(gimage.healthcheck().test(i).c_str()); + } + health_check->test_len = gimage.healthcheck().test_size(); + health_check->interval = (int64_t)gimage.healthcheck().interval(); + health_check->timeout = (int64_t)gimage.healthcheck().timeout(); + health_check->retries = (int)gimage.healthcheck().retries(); + health_check->exit_on_unhealthy = gimage.healthcheck().exit_on_unhealthy(); + + metadata->health_check = health_check; + health_check = nullptr; + +out: + free_defs_health_check(health_check); + return ret; +} + int copy_image_metadata(const isula::Image &gimage, struct image_metadata **metadata) { struct image_metadata *tmp_data = (struct image_metadata *)util_common_calloc_s(sizeof(struct image_metadata)); @@ -105,8 +143,14 @@ int copy_image_metadata(const isula::Image &gimage, struct image_metadata **meta if (gimage.has_spec() && !gimage.spec().image().empty()) { tmp_data->oci_spec = util_strdup_s(gimage.spec().image().c_str()); } + + if (copy_image_health_check_config(gimage, tmp_data) != 0) { + goto err_out; + } + *metadata = tmp_data; return 0; + err_out: free_image_metadata(tmp_data); return -1; @@ -633,6 +677,62 @@ public: } }; +class ISulaTag : public ClientBase { +public: + explicit ISulaTag(void *args) : ClientBase(args) + { + } + ~ISulaTag() = default; + + int request_to_grpc(const isula_tag_request *req, isula::TagImageRequest *grequest) override + { + if (req == nullptr) { + return -1; + } + if (req->src_name == nullptr || req->src_name->image == nullptr || + req->dest_name == nullptr || req->dest_name->image == nullptr) { + return -1; + } + isula::ImageSpec *src_image = new (std::nothrow) isula::ImageSpec; + isula::ImageSpec *dest_image = new (std::nothrow) isula::ImageSpec; + if (src_image == nullptr || dest_image == nullptr) { + ERROR("Out of memory"); + return -1; + } + src_image->set_image(req->src_name->image); + dest_image->set_image(req->dest_name->image); + grequest->set_allocated_srcname(src_image); + grequest->set_allocated_destname(dest_image); + return 0; + } + + int response_from_grpc(isula::TagImageResponse *gresp, isula_tag_response *resp) override + { + if (!gresp->errmsg().empty()) { + resp->errmsg = util_strdup_s(gresp->errmsg().c_str()); + } + resp->server_errono = gresp->cc(); + return 0; + } + + int check_parameter(const isula::TagImageRequest &req) override + { + if (req.has_srcname() && !req.srcname().image().empty() && + req.has_destname() && !req.destname().image().empty()) { + return 0; + } + ERROR("Image name is required."); + return -1; + } + + Status grpc_call(ClientContext *context, const isula::TagImageRequest &req, + isula::TagImageResponse *reply) override + { + return stub_->TagImage(context, req, reply); + } +}; + class ISulaLoad : public ClientBase { public: @@ -875,6 +975,63 @@ public: } }; +class ISulaStorageMetadata : public + ClientBase { +public: + explicit ISulaStorageMetadata(void *args) : ClientBase(args) + { + } + ~ISulaStorageMetadata() = default; + + int request_to_grpc(const isula_storage_metadata_request *req, isula::GraphdriverMetadataRequest *grequest) override + { + if (req == nullptr) { + isulad_set_error_message("unvalid export request"); + return -1; + } + if (req->container_id != nullptr) { + grequest->set_name_id(req->container_id); + } + return 0; + } + + int response_from_grpc(isula::GraphdriverMetadataResponse *gresp, isula_storage_metadata_response *resp) override + { + int metadata_len = gresp->metadata_size(); + if (metadata_len > 0) { + resp->metadata = (json_map_string_string *)util_common_calloc_s(sizeof(json_map_string_string)); + if (resp->metadata == nullptr) { + ERROR("Out of memory"); + return -1; + } + for (const auto &iter : gresp->metadata()) { + if (append_json_map_string_string(resp->metadata, iter.first.c_str(), iter.second.c_str()) != 0) { + ERROR("Out of memory"); + return -1; + } + } + } + + if (!gresp->name().empty()) { + resp->name = util_strdup_s(gresp->name().c_str()); + } + + if (!gresp->errmsg().empty()) { + resp->errmsg = util_strdup_s(gresp->errmsg().c_str()); + } + resp->server_errono = gresp->cc(); + + return 0; + } + + Status grpc_call(ClientContext *context, const isula::GraphdriverMetadataRequest &req, + isula::GraphdriverMetadataResponse *reply) override + { + return stub_->GraphdriverMetadata(context, req, reply); + } +}; + class ISulaContainerFsUsage : public ClientBase { @@ -1040,6 +1197,7 @@ int grpc_isula_image_client_ops_init(isula_image_ops *ops) ops->pull = container_func; ops->rmi = container_func; + ops->tag = container_func; ops->load = container_func; ops->login = container_func; ops->logout = container_func; @@ -1060,6 +1218,8 @@ int grpc_isula_image_client_ops_init(isula_image_ops *ops) ops->storage_status = container_func; + ops->storage_metadata = container_func; ops->health_check = container_func; diff --git a/src/connect/client/grpc/grpc_isula_image_client.h b/src/connect/client/grpc/grpc_isula_image_client.h index 0b48f90..98fa772 100644 --- a/src/connect/client/grpc/grpc_isula_image_client.h +++ b/src/connect/client/grpc/grpc_isula_image_client.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-12 * Description: provide isula connect command definition diff --git a/src/connect/client/isula_connect.c b/src/connect/client/isula_connect.c index 90d5acd..6835e20 100644 --- a/src/connect/client/isula_connect.c +++ b/src/connect/client/isula_connect.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2018-11-08 * Description: provide isula connect command definition diff --git a/src/connect/client/isula_connect.h b/src/connect/client/isula_connect.h index 67d2ba7..c62d4c2 100644 --- a/src/connect/client/isula_connect.h +++ b/src/connect/client/isula_connect.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2018-11-08 * Description: provide isula connect command definition @@ -119,6 +119,8 @@ typedef struct { struct isula_login_response *response, void *arg); int(*logout)(const struct isula_logout_request *request, struct isula_logout_response *response, void *arg); + int(*tag)(const struct isula_tag_request *request, + struct isula_tag_response *response, void *arg); } image_ops; typedef struct { diff --git a/src/connect/client/isula_image_connect.c b/src/connect/client/isula_image_connect.c index e276730..00fb1cd 100644 --- a/src/connect/client/isula_image_connect.c +++ b/src/connect/client/isula_image_connect.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-12 * Description: provide isula image connect command definition @@ -224,6 +224,8 @@ void free_image_metadata(struct image_metadata *data) data->loaded = NULL; free(data->oci_spec); data->oci_spec = NULL; + free_defs_health_check(data->health_check); + data->health_check = NULL; free(data); } @@ -300,6 +302,28 @@ void free_isula_rmi_response(struct isula_rmi_response *ptr) free(ptr); } +void free_isula_tag_request(struct isula_tag_request *ptr) +{ + if (ptr == NULL) { + return; + } + free_image_spec(ptr->src_name); + ptr->src_name = NULL; + free_image_spec(ptr->dest_name); + ptr->dest_name = NULL; + free(ptr); +} + +void free_isula_tag_response(struct isula_tag_response *ptr) +{ + if (ptr == NULL) { + return; + } + free(ptr->errmsg); + ptr->errmsg = NULL; + free(ptr); +} + void free_isula_load_request(struct isula_load_request *ptr) { if (ptr == NULL) { @@ -470,6 +494,20 @@ void free_isula_storage_status_response(struct isula_storage_status_response *pt free(ptr); } +void free_isula_storage_metadata_response(struct isula_storage_metadata_response *ptr) +{ + if (ptr == NULL) { + return; + } + free_json_map_string_string(ptr->metadata); + ptr->metadata = NULL; + free(ptr->name); + ptr->name = NULL; + free(ptr->errmsg); + ptr->errmsg = NULL; + free(ptr); +} + void free_isula_health_check_request(struct isula_health_check_request *ptr) { if (ptr == NULL) { diff --git a/src/connect/client/isula_image_connect.h b/src/connect/client/isula_image_connect.h index 9e1ae29..e977de4 100644 --- a/src/connect/client/isula_image_connect.h +++ b/src/connect/client/isula_image_connect.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-12 * Description: provide isula image connect command definition @@ -19,6 +19,7 @@ #include #include "json_common.h" +#include "defs.h" #ifdef __cplusplus extern "C" { @@ -116,6 +117,8 @@ struct image_metadata { char *loaded; char *oci_spec; + + defs_health_check *health_check; }; struct isula_status_request { @@ -157,6 +160,17 @@ struct isula_rmi_response { uint32_t server_errono; }; +struct isula_tag_request { + struct image_spec *src_name; + struct image_spec *dest_name; +}; + +struct isula_tag_response { + char *errmsg; + uint32_t cc; + uint32_t server_errono; +}; + struct isula_load_request { char *file; char *tag; @@ -230,6 +244,19 @@ struct isula_storage_status_response { uint32_t server_errono; }; +struct isula_storage_metadata_request { + char *container_id; +}; + +struct isula_storage_metadata_response { + json_map_string_string *metadata; + char *name; + + char *errmsg; + uint32_t cc; + uint32_t server_errono; +}; + struct isula_container_fs_usage_request { char *name_id; }; @@ -283,6 +310,7 @@ typedef struct { int (*prepare)(const struct isula_prepare_request *req, struct isula_prepare_response *resp, void *arg); int (*remove)(const struct isula_remove_request *req, struct isula_remove_response *resp, void *arg); + int (*tag)(const struct isula_tag_request *req, struct isula_tag_response *resp, void *arg); int (*mount)(const struct isula_mount_request *req, struct isula_mount_response *resp, void *arg); int (*umount)(const struct isula_umount_request *req, struct isula_umount_response *resp, void *arg); int (*containers_list)(const struct isula_containers_list_request *req, struct isula_containers_list_response *resp, @@ -297,6 +325,10 @@ typedef struct { int (*storage_status)(const struct isula_storage_status_request *req, struct isula_storage_status_response *resp, void *arg); + int (*storage_metadata)(const struct isula_storage_metadata_request *req, + struct isula_storage_metadata_response *resp, + void *arg); + int (*health_check)(const struct isula_health_check_request *req, struct isula_health_check_response *resp, void *arg); } isula_image_ops; @@ -316,6 +348,8 @@ void free_isula_prepare_request(struct isula_prepare_request *req); void free_isula_prepare_response(struct isula_prepare_response *resp); void free_isula_remove_request(struct isula_remove_request *req); void free_isula_remove_response(struct isula_remove_response *resp); +void free_isula_tag_request(struct isula_tag_request *req); +void free_isula_tag_response(struct isula_tag_response *resp); void free_isula_mount_request(struct isula_mount_request *req); void free_isula_mount_response(struct isula_mount_response *resp); void free_isula_umount_request(struct isula_umount_request *req); @@ -355,6 +389,8 @@ void free_isula_container_fs_usage_response(struct isula_container_fs_usage_resp void free_isula_storage_status_request(struct isula_storage_status_request *ptr); void free_isula_storage_status_response(struct isula_storage_status_response *ptr); +void free_isula_storage_metadata_response(struct isula_storage_metadata_response *ptr); + void free_isula_health_check_request(struct isula_health_check_request *ptr); void free_isula_health_check_response(struct isula_health_check_response *ptr); diff --git a/src/connect/client/rest/rest_client.c b/src/connect/client/rest/rest_client.c index 5bfc26f..ab5e5f4 100644 --- a/src/connect/client/rest/rest_client.c +++ b/src/connect/client/rest/rest_client.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2018-11-08 * Description: provide rest client diff --git a/src/connect/client/rest/rest_client.h b/src/connect/client/rest/rest_client.h index c87cd33..d215d1f 100644 --- a/src/connect/client/rest/rest_client.h +++ b/src/connect/client/rest/rest_client.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container restful client definition diff --git a/src/connect/client/rest/rest_containers_client.c b/src/connect/client/rest/rest_containers_client.c index 09d7135..28b2e12 100644 --- a/src/connect/client/rest/rest_containers_client.c +++ b/src/connect/client/rest/rest_containers_client.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container restful functions @@ -427,6 +427,7 @@ static int unpack_container_info_for_list_response(container_list_response *cres util_strdup_s(cresponse->containers[i]->finishat) : util_strdup_s("-"); summary_info[i]->exit_code = cresponse->containers[i]->exit_code; summary_info[i]->restart_count = (unsigned int)cresponse->containers[i]->restartcount; + summary_info[i]->created = cresponse->containers[i]->created; } return 0; diff --git a/src/connect/client/rest/rest_containers_client.h b/src/connect/client/rest/rest_containers_client.h index 54d8bcf..91ed599 100644 --- a/src/connect/client/rest/rest_containers_client.h +++ b/src/connect/client/rest/rest_containers_client.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide rest containers client definition diff --git a/src/connect/client/rest/rest_images_client.c b/src/connect/client/rest/rest_images_client.c index aaa71bc..734037f 100644 --- a/src/connect/client/rest/rest_images_client.c +++ b/src/connect/client/rest/rest_images_client.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide image restful client functions diff --git a/src/connect/client/rest/rest_images_client.h b/src/connect/client/rest/rest_images_client.h index 1cec7e3..5600ff7 100644 --- a/src/connect/client/rest/rest_images_client.h +++ b/src/connect/client/rest/rest_images_client.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide image restful client definition diff --git a/src/connect/service/grpc/grpc_containers_service.cc b/src/connect/service/grpc/grpc_containers_service.cc index 1dfe1ac..779f3f7 100644 --- a/src/connect/service/grpc/grpc_containers_service.cc +++ b/src/connect/service/grpc/grpc_containers_service.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide grpc container functions @@ -616,7 +616,7 @@ Status ContainerServiceImpl::Exec(ServerContext *context, const ExecRequest *req return Status::CANCELLED; } - ret = cb->container.exec(container_req, &container_res, -1, nullptr); + ret = cb->container.exec(container_req, &container_res, -1, nullptr, nullptr); tret = exec_response_to_grpc(container_res, reply); free_container_exec_request(container_req); @@ -629,7 +629,7 @@ Status ContainerServiceImpl::Exec(ServerContext *context, const ExecRequest *req return Status::OK; } -ssize_t WriteExecResponseToRemoteClient(void *context, const void *data, size_t len) +ssize_t WriteExecStdoutResponseToRemoteClient(void *context, const void *data, size_t len) { if (context == nullptr || data == nullptr || len == 0) { return 0; @@ -644,11 +644,36 @@ ssize_t WriteExecResponseToRemoteClient(void *context, const void *data, size_t return (ssize_t)len; } +ssize_t WriteExecStderrResponseToRemoteClient(void *context, const void *data, size_t len) +{ + if (context == nullptr || data == nullptr || len == 0) { + return 0; + } + auto stream = static_cast *>(context); + RemoteExecResponse response; + response.set_stderr((char *)data, len); + if (!stream->Write(response)) { + ERROR("Failed to write request to grpc client"); + return -1; + } + return (ssize_t)len; +} + class RemoteExecReceiveFromClientTask : public StoppableThread { public: + RemoteExecReceiveFromClientTask() = default; RemoteExecReceiveFromClientTask(ServerReaderWriter *stream, int read_pipe_fd) : m_stream(stream), m_read_pipe_fd(read_pipe_fd) {} ~RemoteExecReceiveFromClientTask() = default; + void SetStream(ServerReaderWriter *stream) + { + m_stream = stream; + } + + void SetReadPipeFd(int read_pipe_fd) + { + m_read_pipe_fd = read_pipe_fd; + } void run() { @@ -688,44 +713,60 @@ Status ContainerServiceImpl::RemoteExec(ServerContext *context, return Status(StatusCode::UNIMPLEMENTED, "Unimplemented callback"); } - int read_pipe_fd[2] = { -1, -1 }; - if ((pipe2(read_pipe_fd, O_NONBLOCK | O_CLOEXEC)) < 0) { - ERROR("create read pipe(grpc server to lxc pipe) fail!"); - return Status(StatusCode::UNIMPLEMENTED, "Unimplemented callback"); - } std::string errmsg; if (remote_exec_request_from_stream(context, &container_req, errmsg) != 0) { ERROR("Failed to transform grpc request!"); return Status(StatusCode::UNKNOWN, errmsg); } - RemoteExecReceiveFromClientTask receive_task(stream, read_pipe_fd[1]); - std::thread command_writer([&]() { - receive_task.run(); - }); + int read_pipe_fd[2] = { -1, -1 }; + RemoteExecReceiveFromClientTask receive_task; + std::thread command_writer; + if (container_req->attach_stdin) { + if ((pipe2(read_pipe_fd, O_NONBLOCK | O_CLOEXEC)) < 0) { + ERROR("create read pipe(grpc server to lxc pipe) fail!"); + return Status(StatusCode::UNIMPLEMENTED, "Unimplemented callback"); + } - struct io_write_wrapper stringWriter = { 0 }; - stringWriter.context = (void *)stream; - stringWriter.write_func = WriteExecResponseToRemoteClient; - stringWriter.close_func = nullptr; - (void)cb->container.exec(container_req, &container_res, read_pipe_fd[0], &stringWriter); + receive_task.SetStream(stream); + receive_task.SetReadPipeFd(read_pipe_fd[1]); + command_writer = std::thread([&]() { + receive_task.run(); + }); + } + + struct io_write_wrapper StdoutstringWriter = { 0 }; + StdoutstringWriter.context = (void *)stream; + StdoutstringWriter.write_func = WriteExecStdoutResponseToRemoteClient; + StdoutstringWriter.close_func = nullptr; + struct io_write_wrapper StderrstringWriter = { 0 }; + StderrstringWriter.context = (void *)stream; + StderrstringWriter.write_func = WriteExecStderrResponseToRemoteClient; + StderrstringWriter.close_func = nullptr; + (void)cb->container.exec(container_req, &container_res, read_pipe_fd[0], &StdoutstringWriter, &StderrstringWriter); RemoteExecResponse finish_response; finish_response.set_finish(true); - receive_task.stop(); + if (container_req->attach_stdin) { + receive_task.stop(); + } if (!stream->Write(finish_response)) { ERROR("Failed to write finish request to grpc client"); return Status(StatusCode::INTERNAL, "Internal errors"); } - command_writer.join(); + if (container_req->attach_stdin) { + command_writer.join(); + } add_exec_trailing_metadata(context, container_res); free_container_exec_request(container_req); free_container_exec_response(container_res); - close(read_pipe_fd[0]); - close(read_pipe_fd[1]); + if (read_pipe_fd[0] != -1) { + close(read_pipe_fd[0]); + close(read_pipe_fd[1]); + } return Status::OK; } diff --git a/src/connect/service/grpc/grpc_containers_service.h b/src/connect/service/grpc/grpc_containers_service.h index 98c3505..f3e59a2 100644 --- a/src/connect/service/grpc/grpc_containers_service.h +++ b/src/connect/service/grpc/grpc_containers_service.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide grpc container functions diff --git a/src/connect/service/grpc/grpc_containers_service_private.cc b/src/connect/service/grpc/grpc_containers_service_private.cc index bc7787e..5842652 100644 --- a/src/connect/service/grpc/grpc_containers_service_private.cc +++ b/src/connect/service/grpc/grpc_containers_service_private.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide grpc container service private functions diff --git a/src/connect/service/grpc/grpc_images_service.cc b/src/connect/service/grpc/grpc_images_service.cc index 3eef061..74ce3c3 100644 --- a/src/connect/service/grpc/grpc_images_service.cc +++ b/src/connect/service/grpc/grpc_images_service.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide grpc images functions @@ -151,6 +151,27 @@ int ImagesServiceImpl::image_remove_request_from_grpc(const DeleteImageRequest * return 0; } +int ImagesServiceImpl::image_tag_request_from_grpc(const TagImageRequest *grequest, + image_tag_image_request **request) +{ + image_tag_image_request *tmpreq = (image_tag_image_request *)util_common_calloc_s( + sizeof(image_tag_image_request)); + if (tmpreq == nullptr) { + ERROR("Out of memory"); + return -1; + } + + if (!grequest->src_name().empty()) { + tmpreq->src_name = util_strdup_s(grequest->src_name().c_str()); + } + if (!grequest->dest_name().empty()) { + tmpreq->dest_name = util_strdup_s(grequest->dest_name().c_str()); + } + *request = tmpreq; + + return 0; +} + int ImagesServiceImpl::image_load_request_from_grpc( const LoadImageRequest *grequest, image_load_image_request **request) { @@ -279,6 +300,39 @@ Status ImagesServiceImpl::Delete(ServerContext *context, const DeleteImageReques return Status::OK; } +Status ImagesServiceImpl::Tag(ServerContext *context, const TagImageRequest *request, TagImageResponse *reply) +{ + auto status = GrpcServerTlsAuth::auth(context, "image_tag"); + if (!status.ok()) { + return status; + } + service_callback_t *cb = get_service_callback(); + if (cb == nullptr || cb->image.tag == nullptr) { + return Status(StatusCode::UNIMPLEMENTED, "Unimplemented callback"); + } + + image_tag_image_request *image_req = nullptr; + int tret = image_tag_request_from_grpc(request, &image_req); + if (tret != 0) { + ERROR("Failed to transform grpc request"); + reply->set_cc(ISULAD_ERR_INPUT); + return Status::OK; + } + + image_tag_image_response *image_res = nullptr; + int ret = cb->image.tag(image_req, &image_res); + tret = response_to_grpc(image_res, reply); + + free_image_tag_image_request(image_req); + free_image_tag_image_response(image_res); + if (tret != 0) { + reply->set_errmsg(util_strdup_s(errno_to_error_message(ISULAD_ERR_INTERNAL))); + reply->set_cc(ISULAD_ERR_INPUT); + ERROR("Failed to translate response to grpc, operation is %s", ret ? "failed" : "success"); + } + return Status::OK; +} + Status ImagesServiceImpl::Load(ServerContext *context, const LoadImageRequest *request, LoadImageResponse *reply) { auto status = GrpcServerTlsAuth::auth(context, "image_load"); diff --git a/src/connect/service/grpc/grpc_images_service.h b/src/connect/service/grpc/grpc_images_service.h index 881bd6b..f854b8a 100644 --- a/src/connect/service/grpc/grpc_images_service.h +++ b/src/connect/service/grpc/grpc_images_service.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide grpc images functions @@ -47,6 +47,8 @@ public: Status Delete(ServerContext *context, const DeleteImageRequest *request, DeleteImageResponse *reply) override; + Status Tag(ServerContext *context, const TagImageRequest *request, TagImageResponse *reply) override; + Status Load(ServerContext *context, const LoadImageRequest *request, LoadImageResponse *reply) override; Status Inspect(ServerContext *context, const InspectImageRequest *request, InspectImageResponse *reply) override; @@ -77,6 +79,8 @@ private: int image_remove_request_from_grpc(const DeleteImageRequest *grequest, image_delete_image_request **request); + int image_tag_request_from_grpc(const TagImageRequest *grequest, image_tag_image_request **request); + int image_load_request_from_grpc(const LoadImageRequest *grequest, image_load_image_request **request); int inspect_request_from_grpc(const InspectImageRequest *grequest, image_inspect_request **request); diff --git a/src/connect/service/grpc/grpc_server_tls_auth.cc b/src/connect/service/grpc/grpc_server_tls_auth.cc index 19c205d..18f2719 100644 --- a/src/connect/service/grpc/grpc_server_tls_auth.cc +++ b/src/connect/service/grpc/grpc_server_tls_auth.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: zhangsong * Create: 2019-04-26 * Description: provide grpc tls request authorization diff --git a/src/connect/service/grpc/grpc_server_tls_auth.h b/src/connect/service/grpc/grpc_server_tls_auth.h index 6163ede..9e38c7d 100644 --- a/src/connect/service/grpc/grpc_server_tls_auth.h +++ b/src/connect/service/grpc/grpc_server_tls_auth.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: zhangsong * Create: 2019-04-26 * Description: provide grpc tls request authorization diff --git a/src/connect/service/grpc/grpc_service.cc b/src/connect/service/grpc/grpc_service.cc index 3e0edb0..084735e 100644 --- a/src/connect/service/grpc/grpc_service.cc +++ b/src/connect/service/grpc/grpc_service.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide grpc server functions diff --git a/src/connect/service/grpc/grpc_service.h b/src/connect/service/grpc/grpc_service.h index 637d8a1..d0eff3b 100644 --- a/src/connect/service/grpc/grpc_service.h +++ b/src/connect/service/grpc/grpc_service.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2018-11-08 * Description: provide grpc service definition diff --git a/src/connect/service/grpc/runtime_image_service.cc b/src/connect/service/grpc/runtime_image_service.cc index 10a0a87..0a7b22f 100644 --- a/src/connect/service/grpc/runtime_image_service.cc +++ b/src/connect/service/grpc/runtime_image_service.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide runtime image functions diff --git a/src/connect/service/grpc/runtime_image_service.h b/src/connect/service/grpc/runtime_image_service.h index e5b5ac9..1f528b6 100644 --- a/src/connect/service/grpc/runtime_image_service.h +++ b/src/connect/service/grpc/runtime_image_service.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide runtime image functions diff --git a/src/connect/service/grpc/runtime_runtime_service.cc b/src/connect/service/grpc/runtime_runtime_service.cc index 62e96a1..6943610 100644 --- a/src/connect/service/grpc/runtime_runtime_service.cc +++ b/src/connect/service/grpc/runtime_runtime_service.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide runtime functions diff --git a/src/connect/service/grpc/runtime_runtime_service.h b/src/connect/service/grpc/runtime_runtime_service.h index 1b5f983..f5c2da6 100644 --- a/src/connect/service/grpc/runtime_runtime_service.h +++ b/src/connect/service/grpc/runtime_runtime_service.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container runtime functions diff --git a/src/connect/service/rest/rest_containers_service.c b/src/connect/service/rest/rest_containers_service.c index ed6c1ce..631b416 100644 --- a/src/connect/service/rest/rest_containers_service.c +++ b/src/connect/service/rest/rest_containers_service.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container restful service functions @@ -945,7 +945,7 @@ static void rest_exec_cb(evhtp_request_t *req, void *arg) goto out; } - (void)cb->container.exec(crequest, &cresponse, -1, NULL); + (void)cb->container.exec(crequest, &cresponse, -1, NULL, NULL); evhtp_send_exec_repsponse(req, cresponse, RESTFUL_RES_OK); out: diff --git a/src/connect/service/rest/rest_containers_service.h b/src/connect/service/rest/rest_containers_service.h index 1547b38..2e0c268 100644 --- a/src/connect/service/rest/rest_containers_service.h +++ b/src/connect/service/rest/rest_containers_service.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container restful service definition diff --git a/src/connect/service/rest/rest_images_service.c b/src/connect/service/rest/rest_images_service.c index d6cb37f..e4f4eda 100644 --- a/src/connect/service/rest/rest_images_service.c +++ b/src/connect/service/rest/rest_images_service.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide image restful service functions diff --git a/src/connect/service/rest/rest_images_service.h b/src/connect/service/rest/rest_images_service.h index c9b2163..6512453 100644 --- a/src/connect/service/rest/rest_images_service.h +++ b/src/connect/service/rest/rest_images_service.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide image restful service definition diff --git a/src/connect/service/rest/rest_service.c b/src/connect/service/rest/rest_service.c index 511633f..b553a05 100644 --- a/src/connect/service/rest/rest_service.c +++ b/src/connect/service/rest/rest_service.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container restful service functions diff --git a/src/connect/service/rest/rest_service.h b/src/connect/service/rest/rest_service.h index 700ccc4..fff2161 100644 --- a/src/connect/service/rest/rest_service.h +++ b/src/connect/service/rest/rest_service.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container restful service definition diff --git a/src/connect/service/rest/rest_service_common.c b/src/connect/service/rest/rest_service_common.c index 06d04c0..12f4a22 100644 --- a/src/connect/service/rest/rest_service_common.c +++ b/src/connect/service/rest/rest_service_common.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container restful service common functions diff --git a/src/connect/service/rest/rest_service_common.h b/src/connect/service/rest/rest_service_common.h index f007c21..1255b28 100644 --- a/src/connect/service/rest/rest_service_common.h +++ b/src/connect/service/rest/rest_service_common.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container restful service common definition diff --git a/src/connect/service/service_common.c b/src/connect/service/service_common.c index 405e6a7..686eae2 100644 --- a/src/connect/service/service_common.c +++ b/src/connect/service/service_common.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2018-11-08 * Description: provide common service definition diff --git a/src/connect/service/service_common.h b/src/connect/service/service_common.h index bd25479..212297d 100644 --- a/src/connect/service/service_common.h +++ b/src/connect/service/service_common.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2018-11-08 * Description: provide common service definition diff --git a/src/console/console.c b/src/console/console.c index 31d975c..b347a27 100644 --- a/src/console/console.c +++ b/src/console/console.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide console definition diff --git a/src/console/console.h b/src/console/console.h index 870bc53..ebfd4c8 100644 --- a/src/console/console.h +++ b/src/console/console.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide console definition diff --git a/src/constants.h b/src/constants.h index 55fb03c..c3930f1 100644 --- a/src/constants.h +++ b/src/constants.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide macro definition diff --git a/src/container_def.c b/src/container_def.c index 32d689c..63275c7 100644 --- a/src/container_def.c +++ b/src/container_def.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container definition diff --git a/src/container_def.h b/src/container_def.h index 16a589f..32cba6d 100644 --- a/src/container_def.h +++ b/src/container_def.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container definition diff --git a/src/contrib/docker b/src/contrib/docker index 7ede4c6..355b9f3 100755 --- a/src/contrib/docker +++ b/src/contrib/docker @@ -1,13 +1,13 @@ ####################################################################### ##- @Copyright (C) Huawei Technologies., Ltd. 2019. All rights reserved. -# - iSulad licensed under the Mulan PSL v1. -# - You can use this software according to the terms and conditions of the Mulan PSL v1. -# - You may obtain a copy of Mulan PSL v1 at: -# - http://license.coscl.org.cn/MulanPSL +# - iSulad licensed under the Mulan PSL v2. +# - You can use this software according to the terms and conditions of the Mulan PSL v2. +# - You may obtain a copy of Mulan PSL v2 at: +# - http://license.coscl.org.cn/MulanPSL2 # - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR # - IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR # - PURPOSE. -# - See the Mulan PSL v1 for more details. +# - See the Mulan PSL v2 for more details. ##- @Description: generate cetification ##- @Author: wujing ##- @Create: 2019-04-25 diff --git a/src/contrib/env_checkconfig b/src/contrib/env_checkconfig index 2528995..227c601 100755 --- a/src/contrib/env_checkconfig +++ b/src/contrib/env_checkconfig @@ -1,13 +1,13 @@ ####################################################################### ##- @Copyright (C) Huawei Technologies., Ltd. 2019. All rights reserved. -# - iSulad licensed under the Mulan PSL v1. -# - You can use this software according to the terms and conditions of the Mulan PSL v1. -# - You may obtain a copy of Mulan PSL v1 at: -# - http://license.coscl.org.cn/MulanPSL +# - iSulad licensed under the Mulan PSL v2. +# - You can use this software according to the terms and conditions of the Mulan PSL v2. +# - You may obtain a copy of Mulan PSL v2 at: +# - http://license.coscl.org.cn/MulanPSL2 # - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR # - IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR # - PURPOSE. -# - See the Mulan PSL v1 for more details. +# - See the Mulan PSL v2 for more details. ##- @Description: generate cetification ##- @Author: wujing ##- @Create: 2019-04-25 diff --git a/src/contrib/sysmonitor/isulad-check.sh b/src/contrib/sysmonitor/isulad-check.sh index d0df9fe..b0dc99a 100755 --- a/src/contrib/sysmonitor/isulad-check.sh +++ b/src/contrib/sysmonitor/isulad-check.sh @@ -1,13 +1,13 @@ ####################################################################### ##- @Copyright (C) Huawei Technologies., Ltd. 2019. All rights reserved. -# - iSulad licensed under the Mulan PSL v1. -# - You can use this software according to the terms and conditions of the Mulan PSL v1. -# - You may obtain a copy of Mulan PSL v1 at: -# - http://license.coscl.org.cn/MulanPSL +# - iSulad licensed under the Mulan PSL v2. +# - You can use this software according to the terms and conditions of the Mulan PSL v2. +# - You may obtain a copy of Mulan PSL v2 at: +# - http://license.coscl.org.cn/MulanPSL2 # - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR # - IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR # - PURPOSE. -# - See the Mulan PSL v1 for more details. +# - See the Mulan PSL v2 for more details. ##- @Description: isulad check ##- @Author: maoweiyong ##- @Create: 2019-02-25 diff --git a/src/cpputils/cxxutils.cc b/src/cpputils/cxxutils.cc index f0d1267..777c52e 100644 --- a/src/cpputils/cxxutils.cc +++ b/src/cpputils/cxxutils.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2019-05-17 * Description: provide c++ common utils functions diff --git a/src/cpputils/cxxutils.h b/src/cpputils/cxxutils.h index b8ff515..d2b6e8d 100644 --- a/src/cpputils/cxxutils.h +++ b/src/cpputils/cxxutils.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Description: c++ common tools. * Author: wujing * Create: 2019-05-17 diff --git a/src/cpputils/stoppable_thread.cc b/src/cpputils/stoppable_thread.cc index 3916a1d..0d15aa0 100644 --- a/src/cpputils/stoppable_thread.cc +++ b/src/cpputils/stoppable_thread.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2019-4-19 * Description: provide stoppable thread functions diff --git a/src/cpputils/stoppable_thread.h b/src/cpputils/stoppable_thread.h index 0482763..c58ac24 100644 --- a/src/cpputils/stoppable_thread.h +++ b/src/cpputils/stoppable_thread.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2019-4-19 * Description: provide stoppable thread definition diff --git a/src/cpputils/url.cc b/src/cpputils/url.cc index 2e66592..fc13fa2 100644 --- a/src/cpputils/url.cc +++ b/src/cpputils/url.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide url functions diff --git a/src/cpputils/url.h b/src/cpputils/url.h index 119b460..d0c37cf 100644 --- a/src/cpputils/url.h +++ b/src/cpputils/url.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Description: Package url parses URLs and implements query escaping. * Author: wujing * Create: 2019-01-02 diff --git a/src/cutils/util_atomic.c b/src/cutils/util_atomic.c index 0c2966c..5f55577 100644 --- a/src/cutils/util_atomic.c +++ b/src/cutils/util_atomic.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: weiwei * Create: 2018-11-1 * Description: provide atomic functions diff --git a/src/cutils/util_atomic.h b/src/cutils/util_atomic.h index c595ed9..997b8b4 100644 --- a/src/cutils/util_atomic.h +++ b/src/cutils/util_atomic.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide atomic function definition diff --git a/src/cutils/utils.c b/src/cutils/utils.c index 092f72e..671b2bb 100644 --- a/src/cutils/utils.c +++ b/src/cutils/utils.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide container utils functions diff --git a/src/cutils/utils.h b/src/cutils/utils.h index 73d6a79..12e1b8e 100644 --- a/src/cutils/utils.h +++ b/src/cutils/utils.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide container sha256 functions diff --git a/src/cutils/utils_array.c b/src/cutils/utils_array.c index 5605956..558e460 100644 --- a/src/cutils/utils_array.c +++ b/src/cutils/utils_array.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide container utils functions diff --git a/src/cutils/utils_array.h b/src/cutils/utils_array.h index ea13988..73734f9 100644 --- a/src/cutils/utils_array.h +++ b/src/cutils/utils_array.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide container sha256 functions diff --git a/src/cutils/utils_convert.c b/src/cutils/utils_convert.c index f94a6f6..ecc40aa 100644 --- a/src/cutils/utils_convert.c +++ b/src/cutils/utils_convert.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide container utils functions diff --git a/src/cutils/utils_convert.h b/src/cutils/utils_convert.h index b6382a5..d21adee 100644 --- a/src/cutils/utils_convert.h +++ b/src/cutils/utils_convert.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide container sha256 functions diff --git a/src/cutils/utils_file.c b/src/cutils/utils_file.c index d63dc3a..bd066ee 100644 --- a/src/cutils/utils_file.c +++ b/src/cutils/utils_file.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide container utils functions diff --git a/src/cutils/utils_file.h b/src/cutils/utils_file.h index 83aead7..a109dc5 100644 --- a/src/cutils/utils_file.h +++ b/src/cutils/utils_file.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide container sha256 functions diff --git a/src/cutils/utils_regex.c b/src/cutils/utils_regex.c index 420f939..8f87ba2 100644 --- a/src/cutils/utils_regex.c +++ b/src/cutils/utils_regex.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2019-10-25 * Description: provide regex patten functions diff --git a/src/cutils/utils_regex.h b/src/cutils/utils_regex.h index 826e370..2b1cd72 100644 --- a/src/cutils/utils_regex.h +++ b/src/cutils/utils_regex.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2019-10-25 * Description: provide regex patten functions diff --git a/src/cutils/utils_string.c b/src/cutils/utils_string.c index 2ba3d1d..9a0b6d4 100644 --- a/src/cutils/utils_string.c +++ b/src/cutils/utils_string.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide container utils functions diff --git a/src/cutils/utils_string.h b/src/cutils/utils_string.h index 65966d8..69547c6 100644 --- a/src/cutils/utils_string.h +++ b/src/cutils/utils_string.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide container sha256 functions diff --git a/src/cutils/utils_verify.c b/src/cutils/utils_verify.c index 01fec49..bf5e7c1 100644 --- a/src/cutils/utils_verify.c +++ b/src/cutils/utils_verify.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide container utils functions @@ -408,6 +408,34 @@ bool util_valid_digest(const char *digest) return util_reg_match(patten, digest) == 0; } +bool util_valid_tag(const char *tag) +{ + char *patten = "^[a-f0-9]{64}$"; + + if (tag == NULL) { + ERROR("invalid NULL param"); + return false; + } + + if (strlen(tag) >= strlen(SHA256_PREFIX) && !strncasecmp(tag, SHA256_PREFIX, strlen(SHA256_PREFIX))) { + ERROR("tag must not prefixed with \"sha256:\""); + return false; + } + + // cannot specify 64-byte hexadecimal strings + if (util_reg_match(patten, tag) == 0) { + ERROR("cannot specify 64-byte hexadecimal strings"); + return false; + } + + if (!util_valid_image_name(tag)) { + ERROR("Not a valid image name"); + return false; + } + + return true; +} + bool util_valid_file(const char *path, uint32_t fmod) { struct stat s; diff --git a/src/cutils/utils_verify.h b/src/cutils/utils_verify.h index 443fe5c..524e5f0 100644 --- a/src/cutils/utils_verify.h +++ b/src/cutils/utils_verify.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide container sha256 functions @@ -56,6 +56,8 @@ bool util_valid_file(const char *path, uint32_t fmod); bool util_valid_digest(const char *digest); +bool util_valid_tag(const char *tag); + bool util_valid_digest_file(const char *path, const char *digest); bool util_valid_key_type(const char *key); diff --git a/src/engines/engine.c b/src/engines/engine.c index 2d08a27..0c7ad01 100644 --- a/src/engines/engine.c +++ b/src/engines/engine.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container engine functions @@ -89,8 +89,9 @@ static int engine_routine_log_init(const struct engine_operation *eop) ret = -1; goto unlock_out; } + // log throught fifo, so we need disable stderr by quiet (set to 1) ret = eop->engine_log_init_op(args->progname, engine_log_path, args->json_confs->log_level, eop->engine_type, - args->quiet, NULL); + 1, NULL); if (ret != 0) { ret = -1; goto unlock_out; diff --git a/src/engines/engine.h b/src/engines/engine.h index 2b52847..f361ae6 100644 --- a/src/engines/engine.h +++ b/src/engines/engine.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container engine definition @@ -124,6 +124,9 @@ typedef struct _engine_exec_request_t { int64_t timeout; const char *suffix; + + bool tty; + bool open_stdin; } engine_exec_request_t; diff --git a/src/engines/lcr/lcr_engine.c b/src/engines/lcr/lcr_engine.c index fec13a3..a2cbc13 100644 --- a/src/engines/lcr/lcr_engine.c +++ b/src/engines/lcr/lcr_engine.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container lcr engine functions diff --git a/src/engines/lcr/lcr_engine.h b/src/engines/lcr/lcr_engine.h index af317fd..a0ae786 100644 --- a/src/engines/lcr/lcr_engine.h +++ b/src/engines/lcr/lcr_engine.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container lcr engine definition diff --git a/src/error.c b/src/error.c index 214980c..e4dc984 100644 --- a/src/error.c +++ b/src/error.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container error functions diff --git a/src/error.h b/src/error.h index d447b8b..b8cca63 100644 --- a/src/error.h +++ b/src/error.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container error definition diff --git a/src/filters.c b/src/filters.c index 1003dc0..478a8c1 100644 --- a/src/filters.c +++ b/src/filters.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-07 * Description: provide filters functions diff --git a/src/filters.h b/src/filters.h index 76095c7..adad053 100644 --- a/src/filters.h +++ b/src/filters.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-07 * Description: provide filters function definition diff --git a/src/http/buffer.c b/src/http/buffer.c index 7489f8d..892fb81 100644 --- a/src/http/buffer.c +++ b/src/http/buffer.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container buffer functions diff --git a/src/http/buffer.h b/src/http/buffer.h index 2a00e7a..5aad00f 100644 --- a/src/http/buffer.h +++ b/src/http/buffer.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container buffer definition diff --git a/src/http/certificate.c b/src/http/certificate.c index 5d71ef8..83a8ed3 100644 --- a/src/http/certificate.c +++ b/src/http/certificate.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2019-06-07 * Description: provide certificate function diff --git a/src/http/certificate.h b/src/http/certificate.h index c854c76..6bafc30 100644 --- a/src/http/certificate.h +++ b/src/http/certificate.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2019-06-07 * Description: provide certificate function diff --git a/src/http/http.c b/src/http/http.c index 8860aad..20bb5ba 100644 --- a/src/http/http.c +++ b/src/http/http.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container http function diff --git a/src/http/http.h b/src/http/http.h index 573a0ae..c6c373d 100644 --- a/src/http/http.h +++ b/src/http/http.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container http function definition diff --git a/src/http/mediatype.h b/src/http/mediatype.h index 195484e..fd883d6 100644 --- a/src/http/mediatype.h +++ b/src/http/mediatype.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container mediatype definition diff --git a/src/http/parser.c b/src/http/parser.c index 92f8de0..f7bc275 100644 --- a/src/http/parser.c +++ b/src/http/parser.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container parser functions diff --git a/src/http/parser.h b/src/http/parser.h index 5372932..64e4d81 100644 --- a/src/http/parser.h +++ b/src/http/parser.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container parser definition diff --git a/src/http/rest_common.c b/src/http/rest_common.c index ba2d441..e56d24e 100644 --- a/src/http/rest_common.c +++ b/src/http/rest_common.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide rest common functions diff --git a/src/http/rest_common.h b/src/http/rest_common.h index e969ece..74c0cf4 100644 --- a/src/http/rest_common.h +++ b/src/http/rest_common.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container restful common function definition diff --git a/src/image/embedded/db/db_all.c b/src/image/embedded/db/db_all.c index 23f106f..7ccfb18 100644 --- a/src/image/embedded/db/db_all.c +++ b/src/image/embedded/db/db_all.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2018-11-07 * Description: provide image functions diff --git a/src/image/embedded/db/db_all.h b/src/image/embedded/db/db_all.h index 01bed46..4975c34 100644 --- a/src/image/embedded/db/db_all.h +++ b/src/image/embedded/db/db_all.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2018-11-07 * Description: provide image function definition diff --git a/src/image/embedded/db/db_common.h b/src/image/embedded/db/db_common.h index 6afd039..2eb04f8 100644 --- a/src/image/embedded/db/db_common.h +++ b/src/image/embedded/db/db_common.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2018-11-07 * Description: provide image definition diff --git a/src/image/embedded/db/db_images_common.h b/src/image/embedded/db/db_images_common.h index e8480dd..28862a3 100644 --- a/src/image/embedded/db/db_images_common.h +++ b/src/image/embedded/db/db_images_common.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2018-11-07 * Description: provide common functions for images diff --git a/src/image/embedded/db/sqlite_common.c b/src/image/embedded/db/sqlite_common.c index 482f36b..3dd8113 100644 --- a/src/image/embedded/db/sqlite_common.c +++ b/src/image/embedded/db/sqlite_common.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2018-11-07 * Description: provide sqlite functions diff --git a/src/image/embedded/db/sqlite_common.h b/src/image/embedded/db/sqlite_common.h index 147fe84..dfe8a7c 100644 --- a/src/image/embedded/db/sqlite_common.h +++ b/src/image/embedded/db/sqlite_common.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2018-11-07 * Description: provide sqlite function definition diff --git a/src/image/embedded/embedded_config_merge.c b/src/image/embedded/embedded_config_merge.c index a73bcd6..21310e4 100644 --- a/src/image/embedded/embedded_config_merge.c +++ b/src/image/embedded/embedded_config_merge.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2018-11-07 * Description: provide embedded image merge config @@ -83,7 +83,7 @@ static int embedded_merge_env(const embedded_config *config, container_config *c } for (j = 0; j < container_spec->env_len; j++) { - custom_kv = util_string_split(container_spec->env[i], '='); + custom_kv = util_string_split(container_spec->env[j], '='); if (custom_kv == NULL) { continue; } @@ -112,8 +112,7 @@ out: static int merge_embedded_config(const embedded_manifest *manifest, container_config *container_spec) { if (manifest->config != NULL) { - if (manifest->config->workdir != NULL) { - free(container_spec->working_dir); + if (container_spec->working_dir == NULL) { container_spec->working_dir = util_strdup_s(manifest->config->workdir); } @@ -175,8 +174,8 @@ static int embedded_append_mounts(char **volumes, size_t volumes_len, container_ int ret = 0; size_t i = 0; size_t new_size = 0; - size_t old_size = 0; char **temp = NULL; + size_t temp_len = 0; if (volumes == NULL || volumes_len == 0) { return 0; @@ -188,21 +187,29 @@ static int embedded_append_mounts(char **volumes, size_t volumes_len, container_ goto out; } new_size = (container_spec->mounts_len + volumes_len) * sizeof(char *); - old_size = container_spec->mounts_len * sizeof(char *); - ret = mem_realloc((void **)&temp, new_size, container_spec->mounts, old_size); - if (ret != 0) { + temp = util_common_calloc_s(new_size); + if (temp == NULL) { ERROR("Failed to realloc memory for mounts"); ret = -1; goto out; } - container_spec->mounts = temp; - for (i = 0; i < volumes_len; i++) { - container_spec->mounts[container_spec->mounts_len] = util_strdup_s(volumes[i]); - container_spec->mounts_len++; + temp[temp_len] = util_strdup_s(volumes[i]); + temp_len++; } + for (i = 0; i < container_spec->mounts_len; i++) { + temp[temp_len] = util_strdup_s(container_spec->mounts[i]); + temp_len++; + free(container_spec->mounts[i]); + container_spec->mounts[i] = NULL; + } + + free(container_spec->mounts); + container_spec->mounts = temp; + container_spec->mounts_len = temp_len; + out: return ret; } @@ -223,8 +230,7 @@ static int embedded_merge_mounts(const embedded_manifest *manifest, container_co goto out; } - ret = util_grow_array(&mounts, &cap, manifest->layers_len, - manifest->layers_len); + ret = util_grow_array(&mounts, &cap, manifest->layers_len, manifest->layers_len); if (ret != 0) { ERROR("grow array failed"); ret = -1; diff --git a/src/image/embedded/embedded_config_merge.h b/src/image/embedded/embedded_config_merge.h index f22cb6b..1a1719d 100644 --- a/src/image/embedded/embedded_config_merge.h +++ b/src/image/embedded/embedded_config_merge.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2018-11-07 * Description: provide embedded image merge config definition diff --git a/src/image/embedded/embedded_image.c b/src/image/embedded/embedded_image.c index c4574fd..aa09ddf 100644 --- a/src/image/embedded/embedded_image.c +++ b/src/image/embedded/embedded_image.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Explanation: provide image functions diff --git a/src/image/embedded/embedded_image.h b/src/image/embedded/embedded_image.h index 626da01..5ab7fbe 100644 --- a/src/image/embedded/embedded_image.h +++ b/src/image/embedded/embedded_image.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Explanation: provide image function definition diff --git a/src/image/embedded/lim.c b/src/image/embedded/lim.c index cdafe32..905cc20 100644 --- a/src/image/embedded/lim.c +++ b/src/image/embedded/lim.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide image list functions diff --git a/src/image/embedded/lim.h b/src/image/embedded/lim.h index 4d2a4b5..adf114a 100644 --- a/src/image/embedded/lim.h +++ b/src/image/embedded/lim.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide image list function definition diff --git a/src/image/embedded/load.c b/src/image/embedded/load.c index c9be5e1..e1630da 100644 --- a/src/image/embedded/load.c +++ b/src/image/embedded/load.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide image load functions diff --git a/src/image/embedded/snapshot/embedded.c b/src/image/embedded/snapshot/embedded.c index b29c6ad..6bd76f8 100644 --- a/src/image/embedded/snapshot/embedded.c +++ b/src/image/embedded/snapshot/embedded.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container embedded functions diff --git a/src/image/embedded/snapshot/embedded.h b/src/image/embedded/snapshot/embedded.h index 4fc51ff..eaf4b58 100644 --- a/src/image/embedded/snapshot/embedded.h +++ b/src/image/embedded/snapshot/embedded.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container embedded definition diff --git a/src/image/embedded/snapshot/snapshot.c b/src/image/embedded/snapshot/snapshot.c index c7ab4e6..5a3a594 100644 --- a/src/image/embedded/snapshot/snapshot.c +++ b/src/image/embedded/snapshot/snapshot.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container snapshot functions diff --git a/src/image/embedded/snapshot/snapshot.h b/src/image/embedded/snapshot/snapshot.h index e27cac5..dd2e42e 100644 --- a/src/image/embedded/snapshot/snapshot.h +++ b/src/image/embedded/snapshot/snapshot.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container snapshot functions definition diff --git a/src/image/embedded/snapshot/snapshot_def.h b/src/image/embedded/snapshot/snapshot_def.h index 711d3d0..fbc2c79 100644 --- a/src/image/embedded/snapshot/snapshot_def.h +++ b/src/image/embedded/snapshot/snapshot_def.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container snapshot definition diff --git a/src/image/external/ext_image.c b/src/image/external/ext_image.c index cde4629..3254742 100644 --- a/src/image/external/ext_image.c +++ b/src/image/external/ext_image.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide image functions @@ -60,16 +60,16 @@ int ext_prepare_rf(const im_prepare_request *request, char **real_rootfs) } if (real_rootfs != NULL) { - if (request->image_name != NULL) { + if (request->rootfs != NULL) { char real_path[PATH_MAX] = { 0 }; - if (request->image_name[0] != '/') { + if (request->rootfs[0] != '/') { ERROR("Rootfs should be absolutely path"); isulad_set_error_message("Rootfs should be absolutely path"); return -1; } - if (realpath(request->image_name, real_path) == NULL) { - ERROR("Failed to clean rootfs path '%s': %s", request->image_name, strerror(errno)); - isulad_set_error_message("Failed to clean rootfs path '%s': %s", request->image_name, strerror(errno)); + if (realpath(request->rootfs, real_path) == NULL) { + ERROR("Failed to clean rootfs path '%s': %s", request->rootfs, strerror(errno)); + isulad_set_error_message("Failed to clean rootfs path '%s': %s", request->rootfs, strerror(errno)); return -1; } *real_rootfs = util_strdup_s(real_path); @@ -128,15 +128,15 @@ int ext_merge_conf(const host_config *host_spec, container_config *container_spe } // No config neeed merge if NULL. - if (request->ext_config_image == NULL) { + if (request->image_name == NULL) { ret = 0; goto out; } // Get image's config and merge configs. - resolved_name = oci_resolve_image_name(request->ext_config_image); + resolved_name = oci_resolve_image_name(request->image_name); if (resolved_name == NULL) { - ERROR("Resolve external config image name failed, image name is %s", request->ext_config_image); + ERROR("Resolve external config image name failed, image name is %s", request->image_name); ret = -1; goto out; } diff --git a/src/image/external/ext_image.h b/src/image/external/ext_image.h index 13276af..8d237a5 100644 --- a/src/image/external/ext_image.h +++ b/src/image/external/ext_image.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Explanation: provide image function definition diff --git a/src/image/image.c b/src/image/image.c index c9e5b30..31099e0 100644 --- a/src/image/image.c +++ b/src/image/image.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide image functions @@ -62,6 +62,7 @@ static const struct bim_ops g_embedded_ops = { .container_fs_usage = embedded_filesystem_usage, .get_filesystem_info = NULL, .get_storage_status = NULL, + .get_storage_metadata = NULL, .image_status = NULL, .load_image = embedded_load_image, .pull_image = NULL, @@ -70,6 +71,7 @@ static const struct bim_ops g_embedded_ops = { .logout = NULL, .health_check = NULL, + .tag_image = NULL, }; #endif @@ -97,6 +99,7 @@ static const struct bim_ops g_isula_ops = { .container_fs_usage = isula_container_filesystem_usage, .get_filesystem_info = isula_get_filesystem_info, .get_storage_status = isula_get_storage_status, + .get_storage_metadata = isula_get_storage_metadata, .image_status = oci_status_image, .load_image = isual_load_image, .pull_image = isula_pull_rf, @@ -104,6 +107,7 @@ static const struct bim_ops g_isula_ops = { .logout = isula_logout, .health_check = isula_health_check, + .tag_image = isula_tag, }; #endif @@ -131,12 +135,14 @@ static const struct bim_ops g_ext_ops = { .image_status = NULL, .get_filesystem_info = NULL, .get_storage_status = NULL, + .get_storage_metadata = NULL, .load_image = ext_load_image, .pull_image = NULL, .login = ext_login, .logout = ext_logout, .health_check = NULL, + .tag_image = NULL, }; static const struct bim_type g_bims[] = { @@ -322,6 +328,36 @@ out: return ret; } +int im_get_storage_metadata(const char *image_type, char *id, im_storage_metadata_response **response) +{ + int ret = -1; + const struct bim_type *q = NULL; + + if (image_type == NULL || response == NULL) { + ERROR("Image type or response is NULL"); + goto out; + } + q = get_bim_by_type(image_type); + if (q == NULL) { + goto out; + } + if (q->ops->get_storage_metadata == NULL) { + ERROR("Get storage metadata umimplements"); + goto out; + } + + ret = q->ops->get_storage_metadata(id, response); + if (ret != 0) { + ERROR("Get storage metadata failed"); + free_im_storage_metadata_response(*response); + *response = NULL; + goto out; + } + +out: + return ret; +} + int im_get_filesystem_info(const char *image_type, im_fs_info_response **response) { int ret = -1; @@ -501,8 +537,8 @@ void free_im_prepare_request(im_prepare_request *request) request->image_name = NULL; free(request->container_id); request->container_id = NULL; - free(request->ext_config_image); - request->ext_config_image = NULL; + free(request->rootfs); + request->rootfs = NULL; free_json_map_string_string(request->storage_opt); request->storage_opt = NULL; @@ -673,8 +709,7 @@ bool im_config_image_exist(const char *image_name) } int im_merge_image_config(const char *id, const char *image_type, const char *image_name, - const char *ext_config_image, - host_config *host_spec, container_config *container_spec, + const char *rootfs, host_config *host_spec, container_config *container_spec, char **real_rootfs) { int ret = 0; @@ -687,7 +722,7 @@ int im_merge_image_config(const char *id, const char *image_type, const char *im goto out; } - bim = bim_get(image_type, image_name, ext_config_image, id); + bim = bim_get(image_type, image_name, rootfs, id); if (bim == NULL) { ERROR("Failed to init bim of image %s", image_name); ret = -1; @@ -706,7 +741,7 @@ int im_merge_image_config(const char *id, const char *image_type, const char *im } request->container_id = util_strdup_s(id); request->image_name = util_strdup_s(image_name); - request->ext_config_image = util_strdup_s(ext_config_image); + request->rootfs = util_strdup_s(rootfs); if (host_spec != NULL) { request->storage_opt = host_spec->storage_opt; } @@ -716,7 +751,7 @@ int im_merge_image_config(const char *id, const char *image_type, const char *im ret = bim->ops->merge_conf(host_spec, container_spec, request, real_rootfs); request->storage_opt = NULL; if (ret != 0) { - ERROR("Failed to merge image %s config, config image is %s", image_name, ext_config_image); + ERROR("Failed to merge image %s config", image_name); ret = -1; goto out; } @@ -1394,6 +1429,68 @@ pack_response: return ret; } +int im_tag_image(const im_tag_request *request, im_tag_response **response) +{ + int ret = -1; + char *src_name = NULL; + char *dest_name = NULL; + const struct bim_type *bim_type = NULL; + struct bim *bim = NULL; + + if (request == NULL || response == NULL) { + ERROR("Invalid input arguments"); + return -1; + } + + *response = util_common_calloc_s(sizeof(im_remove_response)); + if (*response == NULL) { + ERROR("Out of memory"); + return -1; + } + + if (request->src_name.image == NULL || request->dest_name.image == NULL) { + ERROR("remove image requires source image ref and dest image ref"); + isulad_set_error_message("remove image requires source image ref and dest image ref"); + goto pack_response; + } + + src_name = util_strdup_s(request->src_name.image); + dest_name = util_strdup_s(request->dest_name.image); + + bim_type = bim_query(src_name); + if (bim_type == NULL) { + ERROR("No such image:%s", src_name); + isulad_set_error_message("No such image:%s", src_name); + goto pack_response; + } + + bim = bim_get(bim_type->image_type, src_name, NULL, NULL); + if (bim == NULL) { + ERROR("Failed to init bim for image %s", src_name); + goto pack_response; + } + if (bim->ops->tag_image == NULL) { + ERROR("Unimplements tag image in %s", bim->type); + goto pack_response; + } + + ret = bim->ops->tag_image(request); + if (ret != 0) { + ERROR("Failed to tag image %s to %s", src_name, dest_name); + ret = -1; + goto pack_response; + } + +pack_response: + if (g_isulad_errmsg != NULL) { + (*response)->errmsg = util_strdup_s(g_isulad_errmsg); + } + free(src_name); + free(dest_name); + bim_put(bim); + return ret; +} + void free_im_remove_request(im_remove_request *ptr) { if (ptr == NULL) { @@ -1417,6 +1514,30 @@ void free_im_remove_response(im_remove_response *ptr) free(ptr); } +void free_im_tag_request(im_tag_request *ptr) +{ + if (ptr == NULL) { + return; + } + free(ptr->src_name.image); + ptr->src_name.image = NULL; + free(ptr->dest_name.image); + ptr->dest_name.image = NULL; + free(ptr); +} + +void free_im_tag_response(im_tag_response *ptr) +{ + if (ptr == NULL) { + return; + } + + free(ptr->errmsg); + ptr->errmsg = NULL; + + free(ptr); +} + static int do_im_inspect_image(struct bim *bim, char **inspected_json) { int ret = 0; @@ -1803,6 +1924,20 @@ void free_im_storage_status_response(im_storage_status_response *ptr) free(ptr); } +void free_im_storage_metadata_response(im_storage_metadata_response *ptr) +{ + if (ptr == NULL) { + return; + } + free_json_map_string_string(ptr->metadata); + ptr->metadata = NULL; + free(ptr->name); + ptr->name = NULL; + free(ptr->errmsg); + ptr->errmsg = NULL; + free(ptr); +} + void im_sync_containers_isuladkit(void) { DEBUG("Sync containers..."); diff --git a/src/image/image.h b/src/image/image.h index 1a3d02f..16c1d33 100644 --- a/src/image/image.h +++ b/src/image/image.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: weiwei * Create: 2017-11-22 * Description: provide image function definition @@ -58,6 +58,12 @@ typedef struct { char *status; } im_storage_status_response; +typedef struct { + json_map_string_string *metadata; + char *name; + char *errmsg; +} im_storage_metadata_response; + typedef struct { imagetool_fs_info *fs_info; char *errmsg; @@ -97,6 +103,15 @@ typedef struct { char *errmsg; } im_remove_response; +typedef struct { + image_spec src_name; + image_spec dest_name; +} im_tag_request; + +typedef struct { + char *errmsg; +} im_tag_response; + typedef struct { // Spec of the image. image_spec image; @@ -181,7 +196,7 @@ typedef struct { typedef struct { char *image_name; char *container_id; - char *ext_config_image; + char *rootfs; json_map_string_string *storage_opt; } im_prepare_request; @@ -238,6 +253,8 @@ struct bim_ops { int (*get_storage_status)(im_storage_status_response **response); + int (*get_storage_metadata)(char *id, im_storage_metadata_response **response); + /* load image */ int (*load_image)(const im_load_request *request); @@ -252,6 +269,8 @@ struct bim_ops { /* health check */ int (*health_check)(void); + /* Add a tag to the image */ + int (*tag_image)(const im_tag_request *request); }; struct bim { @@ -292,8 +311,7 @@ int im_umount_container_rootfs(const char *image_type, const char *image_name, c int im_remove_container_rootfs(const char *image_type, const char *container_id); int im_merge_image_config(const char *id, const char *image_type, const char *image_name, - const char *ext_config_image, - host_config *host_spec, container_config *container_spec, + const char *rootfs, host_config *host_spec, container_config *container_spec, char **real_rootfs); int im_get_user_conf(const char *image_type, const char *basefs, host_config *hc, const char *userstr, @@ -311,6 +329,12 @@ void free_im_remove_request(im_remove_request *ptr); void free_im_remove_response(im_remove_response *ptr); +int im_tag_image(const im_tag_request *request, im_tag_response **response); + +void free_im_tag_request(im_tag_request *ptr); + +void free_im_tag_response(im_tag_response *ptr); + int im_inspect_image(const im_inspect_request *request, im_inspect_response **response); void free_im_inspect_request(im_inspect_request *ptr); @@ -363,6 +387,10 @@ int im_get_storage_status(const char *image_type, im_storage_status_response **r void free_im_storage_status_response(im_storage_status_response *ptr); +int im_get_storage_metadata(const char *image_type, char *id, im_storage_metadata_response **response); + +void free_im_storage_metadata_response(im_storage_metadata_response *ptr); + size_t im_get_image_count(const im_image_count_request *request); void free_im_image_count_request(im_image_count_request *ptr); diff --git a/src/image/oci/global_config.c b/src/image/oci/global_config.c index 0b09e1f..09cbe93 100644 --- a/src/image/oci/global_config.c +++ b/src/image/oci/global_config.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-16 * Description: provide isula image operator definition diff --git a/src/image/oci/global_config.h b/src/image/oci/global_config.h index 4420224..cc664e3 100644 --- a/src/image/oci/global_config.h +++ b/src/image/oci/global_config.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-16 * Description: provide isula image operator definition diff --git a/src/image/oci/isula_container_export.c b/src/image/oci/isula_container_export.c index 124eb65..d59e6ca 100644 --- a/src/image/oci/isula_container_export.c +++ b/src/image/oci/isula_container_export.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula container export operator implement diff --git a/src/image/oci/isula_container_export.h b/src/image/oci/isula_container_export.h index f4f9eed..35393dc 100644 --- a/src/image/oci/isula_container_export.h +++ b/src/image/oci/isula_container_export.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula container export operator implement diff --git a/src/image/oci/isula_container_fs_usage.c b/src/image/oci/isula_container_fs_usage.c index 7740dba..02fa239 100644 --- a/src/image/oci/isula_container_fs_usage.c +++ b/src/image/oci/isula_container_fs_usage.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula container fs usage operator implement diff --git a/src/image/oci/isula_container_fs_usage.h b/src/image/oci/isula_container_fs_usage.h index dcf2294..57e546a 100644 --- a/src/image/oci/isula_container_fs_usage.h +++ b/src/image/oci/isula_container_fs_usage.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula container fs usage operator implement diff --git a/src/image/oci/isula_containers_list.c b/src/image/oci/isula_containers_list.c index d056537..bd089c8 100644 --- a/src/image/oci/isula_containers_list.c +++ b/src/image/oci/isula_containers_list.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-09-05 * Description: isula containers list operator implement diff --git a/src/image/oci/isula_containers_list.h b/src/image/oci/isula_containers_list.h index 56fd65a..6c7557b 100644 --- a/src/image/oci/isula_containers_list.h +++ b/src/image/oci/isula_containers_list.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-09-5 * Description: isula containers list operator implement diff --git a/src/image/oci/isula_health_check.c b/src/image/oci/isula_health_check.c index ffc6de2..bc82316 100644 --- a/src/image/oci/isula_health_check.c +++ b/src/image/oci/isula_health_check.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula health check operator implement diff --git a/src/image/oci/isula_health_check.h b/src/image/oci/isula_health_check.h index 1892f48..20d5517 100644 --- a/src/image/oci/isula_health_check.h +++ b/src/image/oci/isula_health_check.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula health check operator implement diff --git a/src/image/oci/isula_helper.c b/src/image/oci/isula_helper.c index 6a55833..e10a26e 100644 --- a/src/image/oci/isula_helper.c +++ b/src/image/oci/isula_helper.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: helper functions for isula image diff --git a/src/image/oci/isula_helper.h b/src/image/oci/isula_helper.h index 7edde9a..92eb826 100644 --- a/src/image/oci/isula_helper.h +++ b/src/image/oci/isula_helper.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: helper functions for isula image diff --git a/src/image/oci/isula_image.c b/src/image/oci/isula_image.c index 77ac4ab..d3fc071 100644 --- a/src/image/oci/isula_image.c +++ b/src/image/oci/isula_image.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: provide isula image operator definition @@ -26,6 +26,7 @@ #include "isula_rootfs_mount.h" #include "isula_rootfs_umount.h" #include "isula_image_rmi.h" +#include "isula_image_tag.h" #include "isula_container_fs_usage.h" #include "isula_image_fs_info.h" #include "isula_storage_status.h" @@ -36,6 +37,7 @@ #include "isula_health_check.h" #include "isula_images_list.h" #include "isula_containers_list.h" +#include "isula_storage_metadata.h" #include "containers_store.h" #include "oci_images_store.h" @@ -263,6 +265,62 @@ out: return ret; } +int isula_tag(const im_tag_request *request) +{ + int ret = -1; + char *src_name = NULL; + char *dest_name = NULL; + oci_image_t *image_info = NULL; + char *errmsg = NULL; + + if (request == NULL || request->src_name.image == NULL || request->dest_name.image == NULL) { + ERROR("Invalid input arguments"); + return -1; + } + + src_name = oci_resolve_image_name(request->src_name.image); + if (src_name == NULL) { + ret = -1; + ERROR("Failed to resolve source image name"); + goto out; + } + dest_name = oci_normalize_image_name(request->dest_name.image); + if (src_name == NULL) { + ret = -1; + ERROR("Failed to resolve source image name"); + goto out; + } + + image_info = oci_images_store_get(src_name); + if (image_info == NULL) { + INFO("No such image exist %s", src_name); + ret = -1; + goto out; + } + oci_image_lock(image_info); + + ret = isula_image_tag(src_name, dest_name, &errmsg); + if (ret != 0) { + isulad_set_error_message("Failed to tag image with error: %s", errmsg); + ERROR("Failed to tag image '%s' to '%s' with error: %s", src_name, dest_name, errmsg); + goto out; + } + + ret = register_new_oci_image_into_memory(dest_name); + if (ret != 0) { + ERROR("Register image %s into store failed", dest_name); + goto out; + } + +out: + oci_image_unlock(image_info); + oci_image_unref(image_info); + free(src_name); + free(dest_name); + free(errmsg); + return ret; +} + int isula_container_filesystem_usage(const im_container_fs_usage_request *request, imagetool_fs_info **fs_usage) { int ret = 0; @@ -348,6 +406,35 @@ err_out: return ret; } +int isula_get_storage_metadata(char *id, im_storage_metadata_response **response) +{ + int ret = -1; + + if (response == NULL || id == NULL) { + ERROR("Invalid input arguments"); + return ret; + } + + *response = (im_storage_metadata_response *)util_common_calloc_s(sizeof(im_storage_metadata_response)); + if (*response == NULL) { + ERROR("Out of memory"); + return ret; + } + + ret = isula_do_storage_metadata(id, *response); + if (ret != 0) { + ERROR("Get get storage metadata failed"); + ret = -1; + goto err_out; + } + + return 0; +err_out: + free_im_storage_metadata_response(*response); + *response = NULL; + return ret; +} + int isual_load_image(const im_load_request *request) { char **refs = NULL; diff --git a/src/image/oci/isula_image.h b/src/image/oci/isula_image.h index 7c3e75f..87f0453 100644 --- a/src/image/oci/isula_image.h +++ b/src/image/oci/isula_image.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: provide isula image operator definition @@ -28,6 +28,7 @@ void isula_exit(void); int isula_pull_rf(const im_pull_request *request, im_pull_response **response); int isula_rmi(const im_remove_request *request); +int isula_tag(const im_tag_request *request); int isula_get_filesystem_info(im_fs_info_response **response); int isual_load_image(const im_load_request *request); @@ -41,6 +42,7 @@ int isula_export_rf(const im_export_request *request); int isula_container_filesystem_usage(const im_container_fs_usage_request *request, imagetool_fs_info **fs_usage); int isula_get_storage_status(im_storage_status_response **response); +int isula_get_storage_metadata(char *id, im_storage_metadata_response **response); int isula_login(const im_login_request *request); int isula_logout(const im_logout_request *request); diff --git a/src/image/oci/isula_image_fs_info.c b/src/image/oci/isula_image_fs_info.c index df2754a..51756c6 100644 --- a/src/image/oci/isula_image_fs_info.c +++ b/src/image/oci/isula_image_fs_info.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula image fs info operator implement diff --git a/src/image/oci/isula_image_fs_info.h b/src/image/oci/isula_image_fs_info.h index 32d7488..2d31eac 100644 --- a/src/image/oci/isula_image_fs_info.h +++ b/src/image/oci/isula_image_fs_info.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula image fs info operator implement diff --git a/src/image/oci/isula_image_load.c b/src/image/oci/isula_image_load.c index e73420a..d28651a 100644 --- a/src/image/oci/isula_image_load.c +++ b/src/image/oci/isula_image_load.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula image load operator implement diff --git a/src/image/oci/isula_image_load.h b/src/image/oci/isula_image_load.h index 873511c..295e119 100644 --- a/src/image/oci/isula_image_load.h +++ b/src/image/oci/isula_image_load.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula image load operator implement diff --git a/src/image/oci/isula_image_pull.c b/src/image/oci/isula_image_pull.c index 23184d5..c336d05 100644 --- a/src/image/oci/isula_image_pull.c +++ b/src/image/oci/isula_image_pull.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula image pull operator implement diff --git a/src/image/oci/isula_image_pull.h b/src/image/oci/isula_image_pull.h index 5f46ef7..1f06f19 100644 --- a/src/image/oci/isula_image_pull.h +++ b/src/image/oci/isula_image_pull.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula image pull operator implement diff --git a/src/image/oci/isula_image_rmi.c b/src/image/oci/isula_image_rmi.c index a6b9b11..e8b2674 100644 --- a/src/image/oci/isula_image_rmi.c +++ b/src/image/oci/isula_image_rmi.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula image rootfs remove operator implement diff --git a/src/image/oci/isula_image_rmi.h b/src/image/oci/isula_image_rmi.h index 587e1c6..51d104c 100644 --- a/src/image/oci/isula_image_rmi.h +++ b/src/image/oci/isula_image_rmi.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula image rootfs remove operator implement diff --git a/src/image/oci/isula_image_status.c b/src/image/oci/isula_image_status.c index d237c5f..a75e024 100644 --- a/src/image/oci/isula_image_status.c +++ b/src/image/oci/isula_image_status.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula image status operator implement @@ -97,6 +97,9 @@ static void pack_imagetool_image(struct image_metadata *data, imagetool_image ** goto err_out; } + tmp_img->healthcheck = data->health_check; + data->health_check = NULL; + free(err); *image = tmp_img; return; diff --git a/src/image/oci/isula_image_status.h b/src/image/oci/isula_image_status.h index 4c24f79..d49cbf1 100644 --- a/src/image/oci/isula_image_status.h +++ b/src/image/oci/isula_image_status.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula image status operator implement diff --git a/src/image/oci/isula_image_tag.c b/src/image/oci/isula_image_tag.c new file mode 100644 index 0000000..60a93cb --- /dev/null +++ b/src/image/oci/isula_image_tag.c @@ -0,0 +1,107 @@ +/****************************************************************************** +* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR + * PURPOSE. + * See the Mulan PSL v2 for more details. +* Author: wangfengtu +* Create: 2020-04-15 +* Description: isula image tag operator implement +*******************************************************************************/ +#include "isula_image_tag.h" + +#include "isula_image_connect.h" +#include "isula_helper.h" +#include "connect.h" +#include "utils.h" +#include "log.h" + +static int generate_isula_tag_request(const char *src_name, const char *dest_name, struct isula_tag_request **ireq) +{ + struct isula_tag_request *tmp_req = NULL; + int ret = 0; + + if (src_name == NULL || dest_name == NULL || ireq == NULL) { + ERROR("Required image name"); + return -1; + } + tmp_req = (struct isula_tag_request *)util_common_calloc_s(sizeof(struct isula_tag_request)); + if (tmp_req == NULL) { + ERROR("Out of memory"); + return -1; + } + + tmp_req->src_name = (struct image_spec *)util_common_calloc_s(sizeof(struct image_spec)); + if (tmp_req->src_name == NULL) { + ERROR("Out of memory"); + ret = -1; + goto out; + } + + tmp_req->dest_name = (struct image_spec *)util_common_calloc_s(sizeof(struct image_spec)); + if (tmp_req->dest_name == NULL) { + ERROR("Out of memory"); + ret = -1; + goto out; + } + + tmp_req->src_name->image = util_strdup_s(src_name); + tmp_req->dest_name->image = util_strdup_s(dest_name); + +out: + *ireq = tmp_req; + return ret; +} + +int isula_image_tag(const char *src_name, const char *dest_name, char **errmsg) +{ + int ret = -1; + struct isula_tag_request *ireq = NULL; + struct isula_tag_response *iresp = NULL; + client_connect_config_t conf = { 0 }; + isula_image_ops *im_ops = NULL; + + im_ops = get_isula_image_ops(); + if (im_ops == NULL) { + ERROR("Don't init isula server grpc client"); + return -1; + } + if (im_ops->tag == NULL) { + ERROR("Umimplement tag operator"); + return -1; + } + + ret = generate_isula_tag_request(src_name, dest_name, &ireq); + if (ret != 0) { + goto out; + } + + iresp = (struct isula_tag_response *)util_common_calloc_s(sizeof(struct isula_tag_response)); + if (iresp == NULL) { + ERROR("Out of memory"); + goto out; + } + + ret = get_isula_image_connect_config(&conf); + if (ret != 0) { + goto out; + } + + INFO("Send remove image GRPC request"); + ret = im_ops->tag(ireq, iresp, &conf); + if (ret != 0) { + ERROR("Tag image %s to %s failed: %s", src_name, dest_name, iresp->errmsg); + } + *errmsg = iresp->errmsg; + iresp->errmsg = NULL; + +out: + free_isula_tag_request(ireq); + free_isula_tag_response(iresp); + free_client_connect_config_value(&conf); + return ret; +} diff --git a/src/image/oci/isula_image_tag.h b/src/image/oci/isula_image_tag.h new file mode 100644 index 0000000..1258ba9 --- /dev/null +++ b/src/image/oci/isula_image_tag.h @@ -0,0 +1,30 @@ +/****************************************************************************** +* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR + * PURPOSE. + * See the Mulan PSL v2 for more details. +* Author: wangfengtu +* Create: 2020-04-15 +* Description: isula image tag operator implement +*******************************************************************************/ +#ifndef __IMAGE_ISULA_IMAGE_TAG_H +#define __IMAGE_ISULA_IMAGE_TAG_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +int isula_image_tag(const char *src_name, const char *dest_name, char **errmsg); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/image/oci/isula_images_list.c b/src/image/oci/isula_images_list.c index 10f656f..b1bf361 100644 --- a/src/image/oci/isula_images_list.c +++ b/src/image/oci/isula_images_list.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula images list operator implement @@ -89,6 +89,9 @@ static int pack_imagetool_image(struct image_metadata *data, imagetool_image **i goto err_out; } + tmp_img->healthcheck = data->health_check; + data->health_check = NULL; + free(err); *image = tmp_img; return 0; diff --git a/src/image/oci/isula_images_list.h b/src/image/oci/isula_images_list.h index d941404..724b3db 100644 --- a/src/image/oci/isula_images_list.h +++ b/src/image/oci/isula_images_list.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula images list operator implement diff --git a/src/image/oci/isula_login.c b/src/image/oci/isula_login.c index 6617b0a..25905ac 100644 --- a/src/image/oci/isula_login.c +++ b/src/image/oci/isula_login.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula login operator implement diff --git a/src/image/oci/isula_login.h b/src/image/oci/isula_login.h index 4345bdc..f360826 100644 --- a/src/image/oci/isula_login.h +++ b/src/image/oci/isula_login.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula logint operator implement diff --git a/src/image/oci/isula_logout.c b/src/image/oci/isula_logout.c index 43d4907..5dc4975 100644 --- a/src/image/oci/isula_logout.c +++ b/src/image/oci/isula_logout.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula image rootfs remove operator implement diff --git a/src/image/oci/isula_logout.h b/src/image/oci/isula_logout.h index 691a994..2c929da 100644 --- a/src/image/oci/isula_logout.h +++ b/src/image/oci/isula_logout.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula logout operator implement diff --git a/src/image/oci/isula_rootfs_mount.c b/src/image/oci/isula_rootfs_mount.c index 1beea06..c6d4021 100644 --- a/src/image/oci/isula_rootfs_mount.c +++ b/src/image/oci/isula_rootfs_mount.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula image rootfs mount operator implement diff --git a/src/image/oci/isula_rootfs_mount.h b/src/image/oci/isula_rootfs_mount.h index d9ee12d..a6e2718 100644 --- a/src/image/oci/isula_rootfs_mount.h +++ b/src/image/oci/isula_rootfs_mount.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula image rootfs mount operator implement diff --git a/src/image/oci/isula_rootfs_prepare.c b/src/image/oci/isula_rootfs_prepare.c index 50e9baa..5285342 100644 --- a/src/image/oci/isula_rootfs_prepare.c +++ b/src/image/oci/isula_rootfs_prepare.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula image prepare operator implement diff --git a/src/image/oci/isula_rootfs_prepare.h b/src/image/oci/isula_rootfs_prepare.h index c2de434..73b3c16 100644 --- a/src/image/oci/isula_rootfs_prepare.h +++ b/src/image/oci/isula_rootfs_prepare.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula image prepare operator implement diff --git a/src/image/oci/isula_rootfs_remove.c b/src/image/oci/isula_rootfs_remove.c index 04c0545..122bb33 100644 --- a/src/image/oci/isula_rootfs_remove.c +++ b/src/image/oci/isula_rootfs_remove.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula image rootfs remove operator implement diff --git a/src/image/oci/isula_rootfs_remove.h b/src/image/oci/isula_rootfs_remove.h index 6b01e4d..963ef77 100644 --- a/src/image/oci/isula_rootfs_remove.h +++ b/src/image/oci/isula_rootfs_remove.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula image rootfs remove operator implement diff --git a/src/image/oci/isula_rootfs_umount.c b/src/image/oci/isula_rootfs_umount.c index 2cf4d5d..3420a41 100644 --- a/src/image/oci/isula_rootfs_umount.c +++ b/src/image/oci/isula_rootfs_umount.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula image rootfs umount operator implement diff --git a/src/image/oci/isula_rootfs_umount.h b/src/image/oci/isula_rootfs_umount.h index fcbb082..80c00ff 100644 --- a/src/image/oci/isula_rootfs_umount.h +++ b/src/image/oci/isula_rootfs_umount.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula image rootfs umount operator implement diff --git a/src/image/oci/isula_storage_metadata.c b/src/image/oci/isula_storage_metadata.c new file mode 100644 index 0000000..4026517 --- /dev/null +++ b/src/image/oci/isula_storage_metadata.c @@ -0,0 +1,78 @@ +/****************************************************************************** +* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR + * PURPOSE. + * See the Mulan PSL v2 for more details. +* Author: liuhao +* Create: 2020-03-24 +* Description: isula storage metadata operator implement +*******************************************************************************/ +#include "isula_storage_metadata.h" + +#include "isula_image_connect.h" +#include "isula_helper.h" +#include "connect.h" +#include "utils.h" +#include "log.h" + +int isula_do_storage_metadata(char *id, im_storage_metadata_response *resp) +{ + int ret = 0; + int nret = -1; + struct isula_storage_metadata_request ireq; + struct isula_storage_metadata_response *iresp = NULL; + client_connect_config_t conf = { 0 }; + isula_image_ops *im_ops = NULL; + + if (resp == NULL || id == NULL) { + ERROR("Invalid arguments"); + return -1; + } + + im_ops = get_isula_image_ops(); + if (im_ops == NULL) { + ERROR("Failed to init isula server grpc client"); + return -1; + } + if (im_ops->storage_metadata == NULL) { + ERROR("Umimplement get storage metadata operator"); + return -1; + } + + iresp = util_common_calloc_s(sizeof(struct isula_storage_metadata_response)); + if (iresp == NULL) { + ERROR("Out of memory"); + ret = -1; + goto out; + } + + nret = get_isula_image_connect_config(&conf); + if (nret != 0) { + ret = -1; + goto out; + } + + ireq.container_id = id; + nret = im_ops->storage_metadata(&ireq, iresp, &conf); + if (nret != 0) { + ERROR("Failed to get storage metadata with error: %s", iresp->errmsg); + isulad_set_error_message("Failed to get storage metadata with error: %s", iresp->errmsg); + ret = -1; + goto out; + } + resp->metadata = iresp->metadata; + iresp->metadata = NULL; + resp->name = util_strdup_s(iresp->name); + resp->errmsg = util_strdup_s(iresp->errmsg); + +out: + free_isula_storage_metadata_response(iresp); + free_client_connect_config_value(&conf); + return ret; +} + diff --git a/src/image/oci/isula_storage_metadata.h b/src/image/oci/isula_storage_metadata.h new file mode 100644 index 0000000..94a1e4a --- /dev/null +++ b/src/image/oci/isula_storage_metadata.h @@ -0,0 +1,30 @@ +/****************************************************************************** +* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR + * PURPOSE. + * See the Mulan PSL v2 for more details. +* Author: liuhao +* Create: 2020-03-23 +* Description: isula storage metadata operator implement +*******************************************************************************/ +#ifndef __IMAGE_ISULA_STORAGE_METADATA_H +#define __IMAGE_ISULA_STORAGE_METADATA_H + +#include "image.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int isula_do_storage_metadata(char *id, im_storage_metadata_response *resp); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/image/oci/isula_storage_status.c b/src/image/oci/isula_storage_status.c index 01fc80c..a42006b 100644 --- a/src/image/oci/isula_storage_status.c +++ b/src/image/oci/isula_storage_status.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula storage status operator implement diff --git a/src/image/oci/isula_storage_status.h b/src/image/oci/isula_storage_status.h index 2c4ee38..f44eeb0 100644 --- a/src/image/oci/isula_storage_status.h +++ b/src/image/oci/isula_storage_status.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: isula storage status operator implement diff --git a/src/image/oci/oci_auth.c b/src/image/oci/oci_auth.c index 16b63ec..c394516 100644 --- a/src/image/oci/oci_auth.c +++ b/src/image/oci/oci_auth.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wangfengtu * Create: 2019-06-24 * Description: provide oci auth functions diff --git a/src/image/oci/oci_auth.h b/src/image/oci/oci_auth.h index 3234688..4614c0e 100644 --- a/src/image/oci/oci_auth.h +++ b/src/image/oci/oci_auth.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wangfengtu * Create: 2019-06-24 * Description: provide auth definition diff --git a/src/image/oci/oci_common_operators.c b/src/image/oci/oci_common_operators.c index 73950cf..39dfb16 100644 --- a/src/image/oci/oci_common_operators.c +++ b/src/image/oci/oci_common_operators.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-23 * Description: provide image common function definition diff --git a/src/image/oci/oci_common_operators.h b/src/image/oci/oci_common_operators.h index f697393..e6520ae 100644 --- a/src/image/oci/oci_common_operators.h +++ b/src/image/oci/oci_common_operators.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-23 * Description: provide image common function definition diff --git a/src/image/oci/oci_config_merge.c b/src/image/oci/oci_config_merge.c index 8c8c4a5..70477a8 100644 --- a/src/image/oci/oci_config_merge.c +++ b/src/image/oci/oci_config_merge.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide oci config merge functions @@ -27,11 +27,10 @@ static void oci_image_merge_working_dir(const char *working_dir, container_config *container_spec) { - if (working_dir == NULL) { + if (container_spec->working_dir != NULL || working_dir == NULL) { return; } - free(container_spec->working_dir); container_spec->working_dir = util_strdup_s(working_dir); } @@ -74,7 +73,7 @@ static int oci_image_merge_env(const oci_image_spec_config *config, container_co } for (j = 0; j < container_spec->env_len; j++) { - custom_kv = util_string_split(container_spec->env[i], '='); + custom_kv = util_string_split(container_spec->env[j], '='); if (custom_kv == NULL) { continue; } diff --git a/src/image/oci/oci_config_merge.h b/src/image/oci/oci_config_merge.h index 7854851..3c3dd12 100644 --- a/src/image/oci/oci_config_merge.h +++ b/src/image/oci/oci_config_merge.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide oci config merge functions diff --git a/src/image/oci/oci_image_type.h b/src/image/oci/oci_image_type.h index f1c46d4..66dd82e 100644 --- a/src/image/oci/oci_image_type.h +++ b/src/image/oci/oci_image_type.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide image type definition diff --git a/src/image/oci/oci_image_unix.c b/src/image/oci/oci_image_unix.c index a3928c0..79594f2 100644 --- a/src/image/oci/oci_image_unix.c +++ b/src/image/oci/oci_image_unix.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container unix functions diff --git a/src/image/oci/oci_image_unix.h b/src/image/oci/oci_image_unix.h index 12ff7c9..1aec135 100644 --- a/src/image/oci/oci_image_unix.h +++ b/src/image/oci/oci_image_unix.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container unix functions diff --git a/src/image/oci/oci_images_store.c b/src/image/oci/oci_images_store.c index fef1678..95a6e7e 100644 --- a/src/image/oci/oci_images_store.c +++ b/src/image/oci/oci_images_store.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide containers store definition diff --git a/src/image/oci/oci_images_store.h b/src/image/oci/oci_images_store.h index cce5841..3011e3b 100644 --- a/src/image/oci/oci_images_store.h +++ b/src/image/oci/oci_images_store.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide containers store definition diff --git a/src/image/oci/run_image_server.c b/src/image/oci/run_image_server.c index e9ba60a..daf7f53 100644 --- a/src/image/oci/run_image_server.c +++ b/src/image/oci/run_image_server.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: run isula image server diff --git a/src/image/oci/run_image_server.h b/src/image/oci/run_image_server.h index 2f3cd78..3e195a3 100644 --- a/src/image/oci/run_image_server.h +++ b/src/image/oci/run_image_server.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: liuhao * Create: 2019-07-15 * Description: run isula image server diff --git a/src/json/oci_runtime_hooks.c b/src/json/oci_runtime_hooks.c index 81c38c6..aade895 100644 --- a/src/json/oci_runtime_hooks.c +++ b/src/json/oci_runtime_hooks.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2018-11-07 * Description: provide oci runtime hooks functions diff --git a/src/json/oci_runtime_hooks.h b/src/json/oci_runtime_hooks.h index f31054a..2d5dc06 100644 --- a/src/json/oci_runtime_hooks.h +++ b/src/json/oci_runtime_hooks.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container oci runtime hooks functions definition diff --git a/src/json/parse_common.c b/src/json/parse_common.c index f6cf78f..932a366 100644 --- a/src/json/parse_common.c +++ b/src/json/parse_common.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2019-02-22 * Description: provide common parse definition diff --git a/src/json/parse_common.h b/src/json/parse_common.h index 1f0bec1..1df7251 100644 --- a/src/json/parse_common.h +++ b/src/json/parse_common.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2019-02-22 * Description: provide common parse definition diff --git a/src/json/schema/schema/container/inspect.json b/src/json/schema/schema/container/inspect.json index dc14e9f..d1c6288 100644 --- a/src/json/schema/schema/container/inspect.json +++ b/src/json/schema/schema/container/inspect.json @@ -90,6 +90,40 @@ "HostConfig":{ "$ref": "../host-config.json" }, + "GraphDriver":{ + "type":"object", + "properties":{ + "Data": { + "type": "object", + "properties": { + "LowerDir":{ + "type":"string" + }, + "MergedDir":{ + "type":"string" + }, + "UpperDir":{ + "type":"string" + }, + "WorkDir":{ + "type":"string" + }, + "DeviceId":{ + "type":"string" + }, + "DeviceName":{ + "type":"string" + }, + "DeviceSize":{ + "type":"string" + } + } + }, + "Name": { + "type": "string" + } + } + }, "Mounts": { "type": "array", "items": { diff --git a/src/json/schema/schema/image/tag-image-request.json b/src/json/schema/schema/image/tag-image-request.json new file mode 100644 index 0000000..d6ec4dc --- /dev/null +++ b/src/json/schema/schema/image/tag-image-request.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "src_name": { + "type": "string" + }, + "dest_name": { + "type": "string" + } + } +} diff --git a/src/json/schema/schema/image/tag-image-response.json b/src/json/schema/schema/image/tag-image-response.json new file mode 100644 index 0000000..8c398e8 --- /dev/null +++ b/src/json/schema/schema/image/tag-image-response.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "cc": { + "type": "uint32" + }, + "errmsg": { + "type": "string" + } + } +} diff --git a/src/libisula.c b/src/libisula.c index 3a6fded..d13aab8 100644 --- a/src/libisula.c +++ b/src/libisula.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container isula library functions @@ -1184,6 +1184,36 @@ void isula_rmi_response_free(struct isula_rmi_response *response) return; } +/* isula tag request free */ +void isula_tag_request_free(struct isula_tag_request *request) +{ + if (request == NULL) { + return; + } + + free(request->src_name); + request->src_name = NULL; + free(request->dest_name); + request->dest_name = NULL; + + free(request); + return; +} + +/* isula tag response free */ +void isula_tag_response_free(struct isula_tag_response *response) +{ + if (response == NULL) { + return; + } + + free(response->errmsg); + response->errmsg = NULL; + + free(response); + return; +} + /* isula pull response free */ void isula_pull_request_free(struct isula_pull_request *request) { diff --git a/src/libisula.h b/src/libisula.h index d39a9e2..0e4b6c3 100644 --- a/src/libisula.h +++ b/src/libisula.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container isula library definition @@ -609,6 +609,17 @@ struct isula_pull_request { char *image_name; }; +struct isula_tag_request { + char *src_name; + char *dest_name; +}; + +struct isula_tag_response { + uint32_t cc; + uint32_t server_errono; + char *errmsg; +}; + struct isula_pull_response { char *image_ref; uint32_t cc; @@ -812,6 +823,10 @@ void isula_rmi_request_free(struct isula_rmi_request *request); void isula_rmi_response_free(struct isula_rmi_response *response); +void isula_tag_request_free(struct isula_tag_request *request); + +void isula_tag_response_free(struct isula_tag_response *response); + void isula_load_request_free(struct isula_load_request *request); void isula_load_response_free(struct isula_load_response *response); diff --git a/src/libisulad.c b/src/libisulad.c index f35fd4f..072bdc8 100644 --- a/src/libisulad.c +++ b/src/libisulad.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container isulad functions diff --git a/src/libisulad.h b/src/libisulad.h index 1f9e9ab..c1d6776 100644 --- a/src/libisulad.h +++ b/src/libisulad.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container isulad definition diff --git a/src/linked_list.h b/src/linked_list.h index 0a4a0a1..3e6a4a1 100644 --- a/src/linked_list.h +++ b/src/linked_list.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container linked list function definition diff --git a/src/log.c b/src/log.c index 86fc8d8..f99fe6a 100644 --- a/src/log.c +++ b/src/log.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container log function diff --git a/src/log.h b/src/log.h index ce324aa..132f3e2 100644 --- a/src/log.h +++ b/src/log.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container log function definition diff --git a/src/mainloop.c b/src/mainloop.c index 65464af..37cd13e 100644 --- a/src/mainloop.c +++ b/src/mainloop.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container mainloop functions diff --git a/src/mainloop.h b/src/mainloop.h index fdc4071..e92f120 100644 --- a/src/mainloop.h +++ b/src/mainloop.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container mainloop definition diff --git a/src/map/map.c b/src/map/map.c index e87d4cd..264a60b 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container map functions diff --git a/src/map/map.h b/src/map/map.h index 79b95b0..1cc1153 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container map definition diff --git a/src/map/rb_tree.c b/src/map/rb_tree.c index 2b728f4..5ba3337 100644 --- a/src/map/rb_tree.c +++ b/src/map/rb_tree.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide rb tree functions diff --git a/src/map/rb_tree.h b/src/map/rb_tree.h index 4cb41a7..75eb5a4 100644 --- a/src/map/rb_tree.h +++ b/src/map/rb_tree.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide rb tree definition diff --git a/src/namespace.c b/src/namespace.c index 9070cb2..3deff6a 100644 --- a/src/namespace.c +++ b/src/namespace.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide namespace functions @@ -15,6 +15,7 @@ #include "namespace.h" #include #include +#include #include "log.h" #include "utils.h" @@ -55,15 +56,15 @@ static char *get_host_namespace_path(const char *type) return NULL; } -static char *parse_share_namespace_with_prefix(const char *path) +static char *parse_share_namespace_with_prefix(const char *type, const char *path) { char *tmp_cid = NULL; char *result = NULL; container_t *cont = NULL; - - if (path == NULL) { - return NULL; - } + int pid; + int ret = 0; + char ns_path[PATH_MAX] = { 0 }; + char *ns_type = NULL; tmp_cid = connected_container(path); if (tmp_cid == NULL) { @@ -74,27 +75,71 @@ static char *parse_share_namespace_with_prefix(const char *path) ERROR("Invalid share path: %s", path); goto out; } - result = util_strdup_s(cont->common_config->id); - container_unref(cont); + + if (!is_running(cont->state)) { + ERROR("Can not join namespace of a non running container %s", tmp_cid); + isulad_set_error_message("Can not join namespace of a non running container %s", tmp_cid); + goto out; + } + + if (is_restarting(cont->state)) { + ERROR("Container %s is restarting, wait until the container is running", tmp_cid); + isulad_set_error_message("Container %s is restarting, wait until the container is running", tmp_cid); + goto out; + } + + pid = state_get_pid(cont->state); + if (pid < 1 || kill(pid, 0) < 0) { + ERROR("Container %s pid %d invalid", tmp_cid, pid); + goto out; + } + + if (strcmp(type, TYPE_NAMESPACE_NETWORK) == 0) { + ns_type = util_strdup_s("net"); + } else if (strcmp(type, TYPE_NAMESPACE_MOUNT) == 0) { + ns_type = util_strdup_s("mnt"); + } else { + ns_type = util_strdup_s(type); + } + + ret = snprintf(ns_path, PATH_MAX, "/proc/%d/ns/%s", pid, ns_type); + if (ret < 0 || (size_t)ret >= PATH_MAX) { + ERROR("Failed to print string %s", ns_type); + goto out; + } + + result = util_strdup_s(ns_path); out: + container_unref(cont); free(tmp_cid); + free(ns_type); return result; } -char *get_share_namespace_path(const char *type, const char *src_path) +int get_share_namespace_path(const char *type, const char *src_path, char **dest_path) { - char *tmp_mode = NULL; + int ret = 0; - if (is_none(src_path)) { - tmp_mode = NULL; - } else if (is_host(src_path)) { - tmp_mode = get_host_namespace_path(type); - } else if (is_container(src_path)) { - tmp_mode = parse_share_namespace_with_prefix(src_path); + if (type == NULL || dest_path == NULL) { + return -1; } - return tmp_mode; + if (is_none(src_path)) { + *dest_path = NULL; + } else if (is_host(src_path)) { + *dest_path = get_host_namespace_path(type); + if (*dest_path == NULL) { + ret = -1; + } + } else if (is_container(src_path)) { + *dest_path = parse_share_namespace_with_prefix(type, src_path); + if (*dest_path == NULL) { + ret = -1; + } + } + + return ret; } char *get_container_process_label(const char *cid) diff --git a/src/namespace.h b/src/namespace.h index c90059d..51b632f 100644 --- a/src/namespace.h +++ b/src/namespace.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide namespace definition @@ -82,7 +82,7 @@ static inline bool is_shareable(const char *mode) } char *connected_container(const char *mode); -char *get_share_namespace_path(const char *type, const char *src_path); +int get_share_namespace_path(const char *type, const char *src_path, char **dest_path); char *get_container_process_label(const char *path); #ifdef __cplusplus diff --git a/src/pack_config.c b/src/pack_config.c index 3b7bdef..a9906d5 100644 --- a/src/pack_config.c +++ b/src/pack_config.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container package configure functions diff --git a/src/pack_config.h b/src/pack_config.h index 7c757e8..6105f38 100644 --- a/src/pack_config.h +++ b/src/pack_config.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container package configure definition diff --git a/src/path.c b/src/path.c index 9cd7d9f..4adebe6 100644 --- a/src/path.c +++ b/src/path.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container path functions diff --git a/src/path.h b/src/path.h index 7515667..2c62d7d 100644 --- a/src/path.h +++ b/src/path.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container path function definition diff --git a/src/plugin/plugin.c b/src/plugin/plugin.c index 01f5a8f..f57486f 100644 --- a/src/plugin/plugin.c +++ b/src/plugin/plugin.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jingrui * Create: 2018-12-01 * Description: provide plugin definition @@ -65,6 +65,8 @@ #define PluginServicePostStop "/PluginService/PostStop" #define PluginServicePostRemove "/PluginService/PostRemove" +static plugin_manager_t *g_plugin_manager; + static int pm_init_plugin(const plugin_t *plugin); static int plugin_event_pre_start_handle(const plugin_t *plugin, const char *cid); diff --git a/src/plugin/plugin.h b/src/plugin/plugin.h index 50a84cf..478fb86 100644 --- a/src/plugin/plugin.h +++ b/src/plugin/plugin.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jingrui * Create: 2018-12-01 * Description: provide plugin definition @@ -78,8 +78,6 @@ typedef struct plugin_manager { map_t *eps; /* watch_event:plugins */ } plugin_manager_t; -plugin_manager_t *g_plugin_manager; - /* * init at isulad start, scan and init/sync all plugins */ diff --git a/src/plugin/pspec.c b/src/plugin/pspec.c index dabf42f..53f0271 100644 --- a/src/plugin/pspec.c +++ b/src/plugin/pspec.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jingrui * Create: 2018-12-01 * Description: provide plugin definition diff --git a/src/plugin/pspec.h b/src/plugin/pspec.h index 7537654..1d48264 100644 --- a/src/plugin/pspec.h +++ b/src/plugin/pspec.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jingrui * Create: 2018-12-01 * Description: provide plugin definition diff --git a/src/runtime/isula/isula_rt_ops.c b/src/runtime/isula/isula_rt_ops.c index a55e44b..44bc0dc 100644 --- a/src/runtime/isula/isula_rt_ops.c +++ b/src/runtime/isula/isula_rt_ops.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jingrui * Create: 2020-1-20 * Description: runtime ops diff --git a/src/runtime/isula/isula_rt_ops.h b/src/runtime/isula/isula_rt_ops.h index 5f46c04..b6ae69f 100644 --- a/src/runtime/isula/isula_rt_ops.h +++ b/src/runtime/isula/isula_rt_ops.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jingrui * Create: 2020-1-20 * Description: runtime ops diff --git a/src/runtime/lcr/lcr_rt_ops.c b/src/runtime/lcr/lcr_rt_ops.c index 5b31974..f65b650 100644 --- a/src/runtime/lcr/lcr_rt_ops.c +++ b/src/runtime/lcr/lcr_rt_ops.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2019-11-22 * Description: provide container list callback function definition @@ -382,6 +382,11 @@ int rt_lcr_exec(const char *id, const char *runtime, const rt_exec_params_t *par request.user = user; } + request.open_stdin = params->attach_stdin; + if (params->spec != NULL) { + request.tty = params->spec->terminal; + } + if (!engine_ops->engine_exec_op(&request, exit_code)) { const char *tmpmsg = NULL; if (engine_ops->engine_get_errmsg_op != NULL) { diff --git a/src/runtime/lcr/lcr_rt_ops.h b/src/runtime/lcr/lcr_rt_ops.h index 4cf29ef..a2951b4 100644 --- a/src/runtime/lcr/lcr_rt_ops.h +++ b/src/runtime/lcr/lcr_rt_ops.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2019-11-22 * Description: provide container list callback function definition diff --git a/src/runtime/runtime.c b/src/runtime/runtime.c index 4f0a515..ba91f8c 100644 --- a/src/runtime/runtime.c +++ b/src/runtime/runtime.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2019-11-14 * Description: provide runtime functions diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h index 09780da..5946d6d 100644 --- a/src/runtime/runtime.h +++ b/src/runtime/runtime.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2019-11-22 * Description: provide runtime function definition @@ -93,6 +93,7 @@ typedef struct _rt_exec_params_t { int64_t timeout; const char *suffix; defs_process *spec; + bool attach_stdin; } rt_exec_params_t; typedef struct _rt_pause_params_t { diff --git a/src/services/callback.c b/src/services/callback.c index 9d3cbcf..6aab6dd 100644 --- a/src/services/callback.c +++ b/src/services/callback.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container callback functions diff --git a/src/services/callback.h b/src/services/callback.h index 05af4f1..1fcaf8e 100644 --- a/src/services/callback.h +++ b/src/services/callback.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-08 * Description: provide container callback definition @@ -60,6 +60,8 @@ #include "host_info_response.h" #include "image_delete_image_request.h" #include "image_delete_image_response.h" +#include "image_tag_image_request.h" +#include "image_tag_image_response.h" #include "image_load_image_request.h" #include "image_load_image_response.h" #include "image_inspect_request.h" @@ -111,7 +113,7 @@ typedef struct { int(*list)(const container_list_request *request, container_list_response **response); int(*exec)(const container_exec_request *request, container_exec_response **response, - int stdinfd, struct io_write_wrapper *stdout); + int stdinfd, struct io_write_wrapper *stdout, struct io_write_wrapper *stderr); int(*attach)(const container_attach_request *request, container_attach_response **response, int stdinfd, struct io_write_wrapper *stdout, struct io_write_wrapper *stderr); @@ -157,6 +159,8 @@ typedef struct { int(*login)(const image_login_request *request, image_login_response **response); int(*logout)(const image_logout_request *request, image_logout_response **response); + + int(*tag)(const image_tag_image_request *request, image_tag_image_response **response); } service_image_callback_t; typedef struct { diff --git a/src/services/cri/checkpoint_handler.cc b/src/services/cri/checkpoint_handler.cc index 58229a6..16e24ea 100644 --- a/src/services/cri/checkpoint_handler.cc +++ b/src/services/cri/checkpoint_handler.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide checkpoint handler functions diff --git a/src/services/cri/checkpoint_handler.h b/src/services/cri/checkpoint_handler.h index 990fde4..417283a 100644 --- a/src/services/cri/checkpoint_handler.h +++ b/src/services/cri/checkpoint_handler.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide checkpoint handler function definition diff --git a/src/services/cri/cni_network_plugin.cc b/src/services/cri/cni_network_plugin.cc index c34ce04..ea90eaf 100644 --- a/src/services/cri/cni_network_plugin.cc +++ b/src/services/cri/cni_network_plugin.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide cni network plugin function definition diff --git a/src/services/cri/cni_network_plugin.h b/src/services/cri/cni_network_plugin.h index abaa441..601e04e 100644 --- a/src/services/cri/cni_network_plugin.h +++ b/src/services/cri/cni_network_plugin.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide cni network plugin function definition diff --git a/src/services/cri/cri_container.cc b/src/services/cri/cri_container.cc index c7c8201..373ab7b 100644 --- a/src/services/cri/cri_container.cc +++ b/src/services/cri/cri_container.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide cri container definition @@ -1308,8 +1308,8 @@ void CRIRuntimeServiceImpl::ExecSyncFromGRPC(const std::string &containerID, error.SetError("Out of memory"); return; } - (*request)->tty = true; - (*request)->attach_stdin = true; + (*request)->tty = false; + (*request)->attach_stdin = false; (*request)->attach_stdout = true; (*request)->attach_stderr = true; (*request)->timeout = timeout; @@ -1335,7 +1335,8 @@ void CRIRuntimeServiceImpl::ExecSync(const std::string &containerID, const google::protobuf::RepeatedPtrField &cmd, int64_t timeout, runtime::v1alpha2::ExecSyncResponse *reply, Errors &error) { - struct io_write_wrapper stringWriter = { 0 }; + struct io_write_wrapper StdoutstringWriter = { 0 }; + struct io_write_wrapper StderrstringWriter = { 0 }; if (m_cb == nullptr || m_cb->container.exec == nullptr) { error.SetError("Unimplemented callback"); @@ -1361,9 +1362,12 @@ void CRIRuntimeServiceImpl::ExecSync(const std::string &containerID, goto cleanup; } - stringWriter.context = (void *)reply->mutable_stdout(); - stringWriter.write_func = WriteToString; - if (m_cb->container.exec(request, &response, -1, &stringWriter)) { + StdoutstringWriter.context = (void *)reply->mutable_stdout(); + StdoutstringWriter.write_func = WriteToString; + + StderrstringWriter.context = (void *)reply->mutable_stderr(); + StderrstringWriter.write_func = WriteToString; + if (m_cb->container.exec(request, &response, -1, &StdoutstringWriter, &StderrstringWriter)) { if (response != nullptr && response->errmsg != nullptr) { error.SetError(response->errmsg); } else { diff --git a/src/services/cri/cri_container.h b/src/services/cri/cri_container.h index 0e71ee2..6336baa 100644 --- a/src/services/cri/cri_container.h +++ b/src/services/cri/cri_container.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide cri container manager function definition diff --git a/src/services/cri/cri_helpers.cc b/src/services/cri/cri_helpers.cc index 92d4054..ef33383 100644 --- a/src/services/cri/cri_helpers.cc +++ b/src/services/cri/cri_helpers.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide cni network plugin diff --git a/src/services/cri/cri_helpers.h b/src/services/cri/cri_helpers.h index ce3c007..2f8561d 100644 --- a/src/services/cri/cri_helpers.h +++ b/src/services/cri/cri_helpers.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide cri helpers functions diff --git a/src/services/cri/cri_image_service.cc b/src/services/cri/cri_image_service.cc index 992dce1..bc65e67 100644 --- a/src/services/cri/cri_image_service.cc +++ b/src/services/cri/cri_image_service.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide cri image functions diff --git a/src/services/cri/cri_image_service.h b/src/services/cri/cri_image_service.h index 4e644cf..3d2009d 100644 --- a/src/services/cri/cri_image_service.h +++ b/src/services/cri/cri_image_service.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide cri image service function definition diff --git a/src/services/cri/cri_runtime_service.cc b/src/services/cri/cri_runtime_service.cc index 76d3d0e..807ce01 100644 --- a/src/services/cri/cri_runtime_service.cc +++ b/src/services/cri/cri_runtime_service.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide cri runtime service function diff --git a/src/services/cri/cri_runtime_service.h b/src/services/cri/cri_runtime_service.h index fdd254b..29c0d23 100644 --- a/src/services/cri/cri_runtime_service.h +++ b/src/services/cri/cri_runtime_service.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide cri runtime service function definition diff --git a/src/services/cri/cri_sandbox.cc b/src/services/cri/cri_sandbox.cc index a8fe3a5..671a70a 100644 --- a/src/services/cri/cri_sandbox.cc +++ b/src/services/cri/cri_sandbox.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide cri sandbox functions diff --git a/src/services/cri/cri_sandbox.h b/src/services/cri/cri_sandbox.h index 8f6f73c..3dd7cdb 100644 --- a/src/services/cri/cri_sandbox.h +++ b/src/services/cri/cri_sandbox.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide sandbox manager function definition diff --git a/src/services/cri/cri_security_context.cc b/src/services/cri/cri_security_context.cc index 72807cd..e8deb1a 100644 --- a/src/services/cri/cri_security_context.cc +++ b/src/services/cri/cri_security_context.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide cri security context functions diff --git a/src/services/cri/cri_security_context.h b/src/services/cri/cri_security_context.h index 3c3f75f..aa209a5 100644 --- a/src/services/cri/cri_security_context.h +++ b/src/services/cri/cri_security_context.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide cri security context function definition diff --git a/src/services/cri/cri_services.h b/src/services/cri/cri_services.h index 495ec89..01f4305 100644 --- a/src/services/cri/cri_services.h +++ b/src/services/cri/cri_services.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide cri service function definition diff --git a/src/services/cri/errors.cc b/src/services/cri/errors.cc index a2d41c1..0dbee4a 100644 --- a/src/services/cri/errors.cc +++ b/src/services/cri/errors.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide err functions diff --git a/src/services/cri/errors.h b/src/services/cri/errors.h index cfdffc1..9102040 100644 --- a/src/services/cri/errors.h +++ b/src/services/cri/errors.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide err function definition diff --git a/src/services/cri/naming.cc b/src/services/cri/naming.cc index 9d210f1..97b0656 100644 --- a/src/services/cri/naming.cc +++ b/src/services/cri/naming.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide naming functions diff --git a/src/services/cri/naming.h b/src/services/cri/naming.h index c7ad28e..0ac36a7 100644 --- a/src/services/cri/naming.h +++ b/src/services/cri/naming.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide naming function definition diff --git a/src/services/cri/network_plugin.cc b/src/services/cri/network_plugin.cc index 520095e..bd7074e 100644 --- a/src/services/cri/network_plugin.cc +++ b/src/services/cri/network_plugin.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide net plugin functions diff --git a/src/services/cri/network_plugin.h b/src/services/cri/network_plugin.h index ba90fc2..eff5875 100644 --- a/src/services/cri/network_plugin.h +++ b/src/services/cri/network_plugin.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide network plugin function definition diff --git a/src/services/cri/request_cache.cc b/src/services/cri/request_cache.cc index e46e425..128dab0 100644 --- a/src/services/cri/request_cache.cc +++ b/src/services/cri/request_cache.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide request cache function definition diff --git a/src/services/cri/request_cache.h b/src/services/cri/request_cache.h index eb7f279..8836090 100644 --- a/src/services/cri/request_cache.h +++ b/src/services/cri/request_cache.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Description: store streaming requests and generates a single-use random token for retrieval. * Author: wujing * Create: 2019-01-02 diff --git a/src/services/execution/events/collector.c b/src/services/execution/events/collector.c index b4270b0..7546818 100644 --- a/src/services/execution/events/collector.c +++ b/src/services/execution/events/collector.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container collector functions diff --git a/src/services/execution/events/collector.h b/src/services/execution/events/collector.h index e0d06c9..9918844 100644 --- a/src/services/execution/events/collector.h +++ b/src/services/execution/events/collector.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container collector definition diff --git a/src/services/execution/events/events_handler.c b/src/services/execution/events/events_handler.c index 33a8d6f..1c2b313 100644 --- a/src/services/execution/events/events_handler.c +++ b/src/services/execution/events/events_handler.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container events handler functions diff --git a/src/services/execution/events/events_handler.h b/src/services/execution/events/events_handler.h index 22d33d0..3b725b6 100644 --- a/src/services/execution/events/events_handler.h +++ b/src/services/execution/events/events_handler.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container events handler definition diff --git a/src/services/execution/execute/execution.c b/src/services/execution/execute/execution.c index 0a99965..d0c1f8d 100644 --- a/src/services/execution/execute/execution.c +++ b/src/services/execution/execute/execution.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container list callback function definition @@ -53,6 +53,7 @@ #include "utils.h" #include "error.h" #include "collector.h" +#include "specs.h" static int filter_by_label(const container_t *cont, const container_get_id_request *request) @@ -256,8 +257,7 @@ static int umount_dev_tmpfs_for_system_container(const container_t *cont) return -1; } if (umount(rootfs_dev_path) < 0 && errno != ENOENT) { - ERROR("Failed to umount dev tmpfs: %s, error: %s", rootfs_dev_path, strerror(errno)); - return -1; + WARN("Failed to umount dev tmpfs: %s, error: %s", rootfs_dev_path, strerror(errno)); } } return 0; @@ -699,12 +699,12 @@ out: return ret; } -static int write_env_to_target_file(const container_t *cont) +static int write_env_to_target_file(const container_t *cont, const oci_runtime_spec *oci_spec) { int ret = 0; char *env_path = NULL; - if (cont->hostconfig->env_target_file == NULL || cont->common_config->config == NULL) { + if (cont->hostconfig->env_target_file == NULL || oci_spec->process == NULL) { return 0; } env_path = util_path_join(cont->common_config->base_fs, cont->hostconfig->env_target_file); @@ -713,8 +713,8 @@ static int write_env_to_target_file(const container_t *cont) return -1; } ret = write_env_content(env_path, - (const char **)cont->common_config->config->env, - cont->common_config->config->env_len); + (const char **)oci_spec->process->env, + oci_spec->process->env_len); free(env_path); return ret; } @@ -753,7 +753,7 @@ static void clean_resources_on_failure(const container_t *cont, const char *engi return; } -static int renew_oci_config(const container_t *cont, const oci_runtime_spec *oci_spec) +static int update_process_user(const container_t *cont, const oci_runtime_spec *oci_spec) { int ret = 0; defs_process_user *puser = NULL; @@ -772,6 +772,26 @@ out: return ret; } +static int renew_oci_config(const container_t *cont, oci_runtime_spec *oci_spec) +{ + int ret = 0; + + ret = update_process_user(cont, oci_spec); + if (ret != 0) { + ERROR("Failed to update process user"); + goto out; + } + + ret = merge_share_namespace(oci_spec, cont->hostconfig); + if (ret != 0) { + ERROR("Failed to merge share ns"); + goto out; + } + +out: + return ret; +} + static int do_start_container(container_t *cont, const char *console_fifos[], bool reset_rm, container_pid_t *pid_info) { @@ -810,11 +830,6 @@ static int do_start_container(container_t *cont, const char *console_fifos[], bo goto out; } - if (write_env_to_target_file(cont) < 0) { - ret = -1; - goto out; - } - if (reset_rm && !reset_restart_manager(cont, true)) { ERROR("Failed to reset restart manager"); isulad_set_error_message("Failed to reset restart manager"); @@ -840,6 +855,11 @@ static int do_start_container(container_t *cont, const char *console_fifos[], bo goto close_exit_fd; } + if (write_env_to_target_file(cont, oci_spec) < 0) { + ret = -1; + goto close_exit_fd; + } + nret = im_mount_container_rootfs(cont->common_config->image_type, cont->common_config->image, id); if (nret != 0) { ERROR("Failed to mount rootfs for container %s", id); @@ -996,12 +1016,6 @@ int start_container(container_t *cont, const char *console_fifos[], bool reset_r goto out; } - if (container_initialize_networking(cont) != 0) { - ERROR("Failed to initialize networking"); - ret = -1; - goto out; - } - ret = do_start_container(cont, console_fifos, reset_rm, &pid_info); if (ret != 0) { ERROR("Runtime start container failed"); diff --git a/src/services/execution/execute/execution.h b/src/services/execution/execute/execution.h index c3f9250..44a42ad 100644 --- a/src/services/execution/execute/execution.h +++ b/src/services/execution/execute/execution.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container list callback function definition diff --git a/src/services/execution/execute/execution_create.c b/src/services/execution/execute/execution_create.c index 0375875..9964f56 100644 --- a/src/services/execution/execute/execution_create.c +++ b/src/services/execution/execute/execution_create.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container create callback function definition @@ -742,27 +742,21 @@ static int get_request_container_info(const container_create_request *request, c return 0; } -static int get_request_image_info(const container_create_request *request, char **image_type, - const char **ext_config_image, const char **image_name) +static int get_request_image_info(const container_create_request *request, char **image_type, char **image_name) { *image_type = im_get_image_type(request->image, request->rootfs); if (*image_type == NULL) { return -1; } - if (request->rootfs != NULL) { - *image_name = request->rootfs; - // Do not use none image because none image has no config. - if (strcmp(request->image, "none") && strcmp(request->image, "none:latest")) { - *ext_config_image = request->image; - } - } else { - *image_name = request->image; + // Do not use none image because none image has no config. + if (strcmp(request->image, "none") && strcmp(request->image, "none:latest")) { + *image_name = util_strdup_s(request->image); } // Check if config image exist if provided. - if (*ext_config_image != NULL) { - if (!im_config_image_exist(*ext_config_image)) { + if (*image_name != NULL) { + if (!im_config_image_exist(*image_name)) { return -1; } } @@ -775,7 +769,7 @@ static int preparate_runtime_environment(const container_create_request *request { bool runtime_res = false; - if (request->runtime) { + if (util_valid_str(request->runtime)) { *runtime = get_runtime_from_request(request); } else { *runtime = conf_get_default_runtime(); @@ -787,6 +781,7 @@ static int preparate_runtime_environment(const container_create_request *request if (runtime_check(*runtime, &runtime_res) != 0) { ERROR("Runtimes param check failed"); + *cc = ISULAD_ERR_EXEC; return -1; } @@ -794,6 +789,7 @@ static int preparate_runtime_environment(const container_create_request *request ERROR("Invalid runtime name:%s", *runtime); isulad_set_error_message("Invalid runtime name (%s).", *runtime); + *cc = ISULAD_ERR_EXEC; return -1; } @@ -845,8 +841,7 @@ int container_create_cb(const container_create_request *request, char *runtime = NULL; char *name = NULL; char *id = NULL; - const char *image_name = NULL; - const char *ext_config_image = NULL; + char *image_name = NULL; oci_runtime_spec *oci_spec = NULL; host_config *host_spec = NULL; container_config *container_spec = NULL; @@ -864,7 +859,7 @@ int container_create_cb(const container_create_request *request, goto pack_response; } - if (get_request_image_info(request, &image_type, &ext_config_image, &image_name) != 0) { + if (get_request_image_info(request, &image_type, &image_name) != 0) { cc = ISULAD_ERR_EXEC; goto clean_nameindex; } @@ -905,7 +900,7 @@ int container_create_cb(const container_create_request *request, goto clean_container_root_dir; } - ret = im_merge_image_config(id, image_type, image_name, ext_config_image, host_spec, + ret = im_merge_image_config(id, image_type, image_name, request->rootfs, host_spec, v2_spec->config, &real_rootfs); if (ret != 0) { ERROR("Can not merge container_spec with image config"); @@ -1006,6 +1001,7 @@ pack_response: free(runtime_root); free(real_rootfs); free(image_type); + free(image_name); free(name); free(id); free_oci_runtime_spec(oci_spec); diff --git a/src/services/execution/execute/execution_create.h b/src/services/execution/execute/execution_create.h index 5100b7b..b078548 100644 --- a/src/services/execution/execute/execution_create.h +++ b/src/services/execution/execute/execution_create.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container list callback function definition diff --git a/src/services/execution/execute/execution_extend.c b/src/services/execution/execute/execution_extend.c index 35c25e1..96d319e 100644 --- a/src/services/execution/execute/execution_extend.c +++ b/src/services/execution/execute/execution_extend.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container extend callback function definition diff --git a/src/services/execution/execute/execution_extend.h b/src/services/execution/execute/execution_extend.h index 29e7cdb..a25b103 100644 --- a/src/services/execution/execute/execution_extend.h +++ b/src/services/execution/execute/execution_extend.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container list callback function definition diff --git a/src/services/execution/execute/execution_information.c b/src/services/execution/execute/execution_information.c index 01a2e6e..77788cf 100644 --- a/src/services/execution/execute/execution_information.c +++ b/src/services/execution/execute/execution_information.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container information callback function definition @@ -199,8 +199,10 @@ static int isulad_info_cb(const host_info_request *request, host_info_response * struct utsname u; im_image_count_request *im_request = NULL; char *rootpath = NULL; +#ifdef ENABLE_OCI_IMAGE char *graph_driver = NULL; struct graphdriver_status *driver_status = NULL; +#endif DAEMON_CLEAR_ERRMSG(); @@ -334,8 +336,10 @@ pack_response: (*response)->cc = cc; } free(rootpath); +#ifdef ENABLE_OCI_IMAGE free(graph_driver); free_graphdriver_status(driver_status); +#endif free(huge_page_size); free(operating_system); free_im_image_count_request(im_request); @@ -1339,6 +1343,17 @@ static int pack_inspect_data(const container_t *cont, container_inspect **out_in ret = -1; goto out; } + +#ifdef ENABLE_OCI_IMAGE + if (!strcmp(cont->common_config->image_type, IMAGE_TYPE_OCI)) { + inspect->graph_driver = graphdriver_get_metadata(cont->common_config->id); + if (inspect->graph_driver == NULL) { + ret = -1; + goto out; + } + } +#endif + out: *out_inspect = inspect; return ret; diff --git a/src/services/execution/execute/execution_information.h b/src/services/execution/execute/execution_information.h index 3ac74dd..578e07a 100644 --- a/src/services/execution/execute/execution_information.h +++ b/src/services/execution/execute/execution_information.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container list callback function definition diff --git a/src/services/execution/execute/execution_network.c b/src/services/execution/execute/execution_network.c index d70d921..b9c6af4 100644 --- a/src/services/execution/execute/execution_network.c +++ b/src/services/execution/execute/execution_network.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container network callback function definition @@ -41,22 +41,37 @@ static int write_hostname_to_file(const char *rootfs, const char *hostname) { int ret = 0; char *file_path = NULL; + char *tmp = NULL; + char sbuf[MAX_HOST_NAME_LEN] = { 0 }; + + if (hostname == NULL) { + goto out; + } if (realpath_in_scope(rootfs, "/etc/hostname", &file_path) < 0) { SYSERROR("Failed to get real path '/etc/hostname' under rootfs '%s'", rootfs); isulad_set_error_message("Failed to get real path '/etc/hostname' under rootfs '%s'", rootfs); - goto error_out; + goto out; } - if (hostname != NULL) { - ret = util_write_file(file_path, hostname, strlen(hostname), NETWORK_MOUNT_FILE_MODE); - if (ret) { - SYSERROR("Failed to write %s", file_path); - isulad_set_error_message("Failed to write %s: %s", file_path, strerror(errno)); - goto error_out; + + if (util_file_exists(file_path) && util_file2str(file_path, sbuf, sizeof(sbuf)) > 0) { + tmp = util_strdup_s(sbuf); + (void)util_trim_newline(tmp); + tmp = util_trim_space(tmp); + if (strcmp("", tmp) != 0 && strcmp("localhost", tmp) != 0) { + goto out; } } -error_out: + ret = util_write_file(file_path, hostname, strlen(hostname), NETWORK_MOUNT_FILE_MODE); + if (ret) { + SYSERROR("Failed to write %s", file_path); + isulad_set_error_message("Failed to write %s: %s", file_path, strerror(errno)); + goto out; + } + +out: + free(tmp); free(file_path); return ret; } @@ -1030,24 +1045,4 @@ out: return ret; } -int container_initialize_networking(const container_t *cont) -{ - int ret = 0; - size_t len = strlen(SHARE_NAMESPACE_PREFIX); - container_t *nc = NULL; - host_config *hc = cont->hostconfig; - - // is container mode - if (is_container(hc->network_mode)) { - nc = get_networked_container(cont->common_config->id, hc->network_mode + len, true); - if (nc == NULL) { - ERROR("Error to get networked container"); - return -1; - } - } - - container_unref(nc); - return ret; -} - diff --git a/src/services/execution/execute/execution_network.h b/src/services/execution/execute/execution_network.h index c9c2135..57f4b09 100644 --- a/src/services/execution/execute/execution_network.h +++ b/src/services/execution/execute/execution_network.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container list callback function definition @@ -26,7 +26,6 @@ extern "C" { int merge_network(const host_config *host_spec, const char *rootfs, const char *runtime_root, const char *id, const char *hostname); -int container_initialize_networking(const container_t *cont); int init_container_network_confs(const char *id, const char *rootpath, const host_config *hc, container_config_v2_common_config *common_config); diff --git a/src/services/execution/execute/execution_stream.c b/src/services/execution/execute/execution_stream.c index 03920ba..3e000ba 100644 --- a/src/services/execution/execute/execution_stream.c +++ b/src/services/execution/execute/execution_stream.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container stream callback function definition @@ -542,6 +542,7 @@ static int exec_container(container_t *cont, const char *runtime, char * const c params.suffix = request->suffix; params.state = cont->state_path; params.spec = process_spec; + params.attach_stdin = request->attach_stdin; if (runtime_exec(cont->common_config->id, runtime, ¶ms, exit_code)) { ERROR("Runtime exec container failed"); @@ -607,8 +608,8 @@ static int container_exec_cb_check(const container_exec_request *request, contai } static int exec_prepare_console(container_t *cont, const container_exec_request *request, int stdinfd, - struct io_write_wrapper *stdout_handler, char **fifos, - char **fifopath, int *sync_fd, pthread_t *thread_id) + struct io_write_wrapper *stdout_handler, struct io_write_wrapper *stderr_handler, + char **fifos, char **fifopath, int *sync_fd, pthread_t *thread_id) { int ret = 0; const char *id = cont->common_config->id; @@ -628,7 +629,7 @@ static int exec_prepare_console(container_t *cont, const container_exec_request goto out; } if (ready_copy_io_data(*sync_fd, false, request->stdin, request->stdout, request->stderr, - stdinfd, stdout_handler, NULL, (const char **)fifos, thread_id)) { + stdinfd, stdout_handler, stderr_handler, (const char **)fifos, thread_id)) { ret = -1; goto out; } @@ -729,7 +730,7 @@ out: } static int container_exec_cb(const container_exec_request *request, container_exec_response **response, - int stdinfd, struct io_write_wrapper *stdout_handler) + int stdinfd, struct io_write_wrapper *stdout_handler, struct io_write_wrapper *stderr_handler) { int exit_code = 0; int sync_fd = -1; @@ -801,7 +802,8 @@ static int container_exec_cb(const container_exec_request *request, container_ex } } - if (exec_prepare_console(cont, request, stdinfd, stdout_handler, fifos, &fifopath, &sync_fd, &thread_id)) { + if (exec_prepare_console(cont, request, stdinfd, stdout_handler, stderr_handler, fifos, &fifopath, &sync_fd, + &thread_id)) { cc = ISULAD_ERR_EXEC; goto pack_response; } diff --git a/src/services/execution/execute/execution_stream.h b/src/services/execution/execute/execution_stream.h index 000ac5c..34de024 100644 --- a/src/services/execution/execute/execution_stream.h +++ b/src/services/execution/execute/execution_stream.h @@ -3,14 +3,14 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container list callback function definition diff --git a/src/services/execution/execute/list.c b/src/services/execution/execute/list.c index fd61fba..c18c28e 100644 --- a/src/services/execution/execute/list.c +++ b/src/services/execution/execute/list.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container list callback function definition diff --git a/src/services/execution/execute/list.h b/src/services/execution/execute/list.h index 944e90f..7aa452a 100644 --- a/src/services/execution/execute/list.h +++ b/src/services/execution/execute/list.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container list callback function definition diff --git a/src/services/execution/log_gather.c b/src/services/execution/log_gather.c index aa52610..9f0eb03 100644 --- a/src/services/execution/log_gather.c +++ b/src/services/execution/log_gather.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2017-11-22 * Description: provide log gather functions diff --git a/src/services/execution/log_gather.h b/src/services/execution/log_gather.h index f5bd860..8cb4837 100644 --- a/src/services/execution/log_gather.h +++ b/src/services/execution/log_gather.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2017-11-22 * Description: provide log gather definition diff --git a/src/services/execution/manager/container_state.c b/src/services/execution/manager/container_state.c index 0aff72b..ae895ab 100644 --- a/src/services/execution/manager/container_state.c +++ b/src/services/execution/manager/container_state.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2017-11-22 * Description: provide container state functions diff --git a/src/services/execution/manager/container_state.h b/src/services/execution/manager/container_state.h index 6afa50e..55d188d 100644 --- a/src/services/execution/manager/container_state.h +++ b/src/services/execution/manager/container_state.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container state definition diff --git a/src/services/execution/manager/container_unix.c b/src/services/execution/manager/container_unix.c index 11d4c04..3646eca 100644 --- a/src/services/execution/manager/container_unix.c +++ b/src/services/execution/manager/container_unix.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2017-11-22 * Description: provide container unix functions diff --git a/src/services/execution/manager/container_unix.h b/src/services/execution/manager/container_unix.h index c509373..1f58bae 100644 --- a/src/services/execution/manager/container_unix.h +++ b/src/services/execution/manager/container_unix.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2017-11-22 * Description: provide container unix definition diff --git a/src/services/execution/manager/containers_gc.c b/src/services/execution/manager/containers_gc.c index b0567e6..123e682 100644 --- a/src/services/execution/manager/containers_gc.c +++ b/src/services/execution/manager/containers_gc.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container gc functions diff --git a/src/services/execution/manager/containers_gc.h b/src/services/execution/manager/containers_gc.h index 8fae33e..020dfd7 100644 --- a/src/services/execution/manager/containers_gc.h +++ b/src/services/execution/manager/containers_gc.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container gc definition diff --git a/src/services/execution/manager/containers_store.c b/src/services/execution/manager/containers_store.c index f7e0b32..2120b62 100644 --- a/src/services/execution/manager/containers_store.c +++ b/src/services/execution/manager/containers_store.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container store functions diff --git a/src/services/execution/manager/containers_store.h b/src/services/execution/manager/containers_store.h index 8813497..099d53b 100644 --- a/src/services/execution/manager/containers_store.h +++ b/src/services/execution/manager/containers_store.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2017-11-22 * Description: provide containers store definition diff --git a/src/services/execution/manager/health_check.c b/src/services/execution/manager/health_check.c index 8f006a5..e6fbc4e 100644 --- a/src/services/execution/manager/health_check.c +++ b/src/services/execution/manager/health_check.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2018-11-1 * Description: provide health check functions @@ -516,7 +516,8 @@ void *health_check_run(void *arg) char **cmd_slice = NULL; char output[REV_BUF_SIZE] = { 0 }; char timebuffer[TIME_STR_SIZE] = { 0 }; - struct io_write_wrapper ctx = { 0 }; + struct io_write_wrapper Stdoutctx = { 0 }; + struct io_write_wrapper Stderrctx = { 0 }; container_t *cont = NULL; service_callback_t *cb = NULL; container_exec_request *container_req = NULL; @@ -556,10 +557,12 @@ void *health_check_run(void *arg) ERROR("Out of memory"); goto out; } - container_req->tty = false; + + // Set tty to true, compatible with busybox + container_req->tty = true; container_req->attach_stdin = false; container_req->attach_stdout = true; - container_req->attach_stderr = false; + container_req->attach_stderr = true; container_req->timeout = timeout_with_default(config->health_check->timeout, DEFAULT_PROBE_TIMEOUT) / Time_Second; container_req->container_id = util_strdup_s(cont->common_config->id); container_req->argv = cmd_slice; @@ -575,10 +578,13 @@ void *health_check_run(void *arg) } result->start = util_strdup_s(timebuffer); - ctx.context = (void *)output; - ctx.write_func = write_to_string; - ctx.close_func = NULL; - ret = cb->container.exec(container_req, &container_res, -1, &ctx); + Stdoutctx.context = (void *)output; + Stdoutctx.write_func = write_to_string; + Stdoutctx.close_func = NULL; + Stderrctx.context = (void *)output; + Stderrctx.write_func = write_to_string; + Stderrctx.close_func = NULL; + ret = cb->container.exec(container_req, &container_res, -1, &Stdoutctx, &Stderrctx); if (ret != 0) { health_check_exec_failed_handle(container_res, result); } else { diff --git a/src/services/execution/manager/health_check.h b/src/services/execution/manager/health_check.h index e5ea272..58c4529 100644 --- a/src/services/execution/manager/health_check.h +++ b/src/services/execution/manager/health_check.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2018-11-1 * Description: provide health check definition diff --git a/src/services/execution/manager/monitord.c b/src/services/execution/manager/monitord.c index 2e2f08a..a2779d8 100644 --- a/src/services/execution/manager/monitord.c +++ b/src/services/execution/manager/monitord.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container monitord functions diff --git a/src/services/execution/manager/monitord.h b/src/services/execution/manager/monitord.h index 334e1fa..67539e1 100644 --- a/src/services/execution/manager/monitord.h +++ b/src/services/execution/manager/monitord.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2017-11-22 * Description: provide monitord definition diff --git a/src/services/execution/manager/restartmanager.c b/src/services/execution/manager/restartmanager.c index b9c8b30..a6994d2 100644 --- a/src/services/execution/manager/restartmanager.c +++ b/src/services/execution/manager/restartmanager.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container restart manager functions diff --git a/src/services/execution/manager/restartmanager.h b/src/services/execution/manager/restartmanager.h index 5ab7ca3..985049d 100644 --- a/src/services/execution/manager/restartmanager.h +++ b/src/services/execution/manager/restartmanager.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container restart manager definition diff --git a/src/services/execution/manager/restore.c b/src/services/execution/manager/restore.c index cdd1c5b..9e7e1f7 100644 --- a/src/services/execution/manager/restore.c +++ b/src/services/execution/manager/restore.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container list callback function definition diff --git a/src/services/execution/manager/restore.h b/src/services/execution/manager/restore.h index fb9905f..aa4fa5a 100644 --- a/src/services/execution/manager/restore.h +++ b/src/services/execution/manager/restore.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2017-11-22 * Description: provide restore definition diff --git a/src/services/execution/manager/supervisor.c b/src/services/execution/manager/supervisor.c index 7f07c70..ab97d09 100644 --- a/src/services/execution/manager/supervisor.c +++ b/src/services/execution/manager/supervisor.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container supervisor functions diff --git a/src/services/execution/manager/supervisor.h b/src/services/execution/manager/supervisor.h index 712d6f3..e449ac4 100644 --- a/src/services/execution/manager/supervisor.h +++ b/src/services/execution/manager/supervisor.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container supervisor definition diff --git a/src/services/execution/spec/selinux_label.c b/src/services/execution/spec/selinux_label.c index 54b1ab0..2dfe213 100644 --- a/src/services/execution/spec/selinux_label.c +++ b/src/services/execution/spec/selinux_label.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019-2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2019-12-15 * Description: provide selinux label handle function definition diff --git a/src/services/execution/spec/selinux_label.h b/src/services/execution/spec/selinux_label.h index 737e099..7e570d0 100644 --- a/src/services/execution/spec/selinux_label.h +++ b/src/services/execution/spec/selinux_label.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019-2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2019-12-15 * Description: provide selinux label handle function definition diff --git a/src/services/execution/spec/specs.c b/src/services/execution/spec/specs.c index e0cf75b..7b759e8 100644 --- a/src/services/execution/spec/specs.c +++ b/src/services/execution/spec/specs.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container specs functions @@ -1378,10 +1378,10 @@ out: return ret; } -static int merge_share_namespace_helper(const oci_runtime_spec *oci_spec, const char *mode, const char *type) +static int merge_share_namespace_helper(const oci_runtime_spec *oci_spec, const char *path, const char *type) { int ret = -1; - char *tmp_mode = NULL; + char *ns_path = NULL; size_t len = 0; size_t org_len = 0; size_t i = 0; @@ -1391,13 +1391,17 @@ static int merge_share_namespace_helper(const oci_runtime_spec *oci_spec, const len = oci_spec->linux->namespaces_len; work_ns = oci_spec->linux->namespaces; - tmp_mode = get_share_namespace_path(type, mode); + ret = get_share_namespace_path(type, path, &ns_path); + if (ret != 0) { + ERROR("Failed to get share ns type:%s path:%s", type, path); + goto out; + } for (i = 0; i < org_len; i++) { if (strcmp(type, work_ns[i]->type) == 0) { free(work_ns[i]->path); work_ns[i]->path = NULL; - if (tmp_mode != NULL) { - work_ns[i]->path = util_strdup_s(tmp_mode); + if (ns_path != NULL) { + work_ns[i]->path = util_strdup_s(ns_path); } break; } @@ -1423,14 +1427,14 @@ static int merge_share_namespace_helper(const oci_runtime_spec *oci_spec, const goto out; } work_ns[len]->type = util_strdup_s(type); - if (tmp_mode != NULL) { - work_ns[len]->path = util_strdup_s(tmp_mode); + if (ns_path != NULL) { + work_ns[len]->path = util_strdup_s(ns_path); } len++; } ret = 0; out: - free(tmp_mode); + free(ns_path); if (work_ns != NULL) { oci_spec->linux->namespaces = work_ns; oci_spec->linux->namespaces_len = len; @@ -1438,16 +1442,16 @@ out: return ret; } -static int merge_share_single_namespace(const oci_runtime_spec *oci_spec, const char *mode, const char *type) +static int merge_share_single_namespace(const oci_runtime_spec *oci_spec, const char *path, const char *type) { - if (mode == NULL) { + if (path == NULL) { return 0; } - return merge_share_namespace_helper(oci_spec, mode, type); + return merge_share_namespace_helper(oci_spec, path, type); } -static int merge_share_namespace(oci_runtime_spec *oci_spec, const host_config *host_spec) +int merge_share_namespace(oci_runtime_spec *oci_spec, const host_config *host_spec) { int ret = -1; @@ -1601,11 +1605,6 @@ static int merge_resources_conf(oci_runtime_spec *oci_spec, host_config *host_sp { int ret = 0; - ret = merge_share_namespace(oci_spec, host_spec); - if (ret != 0) { - goto out; - } - ret = merge_conf_cgroup(oci_spec, host_spec); if (ret != 0) { goto out; diff --git a/src/services/execution/spec/specs.h b/src/services/execution/spec/specs.h index a5fec40..0d315c8 100644 --- a/src/services/execution/spec/specs.h +++ b/src/services/execution/spec/specs.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2017-11-22 * Description: provide specs definition @@ -40,6 +40,8 @@ int save_oci_config(const char *id, const char *rootpath, const oci_runtime_spec int parse_security_opt(const host_config *host_spec, bool *no_new_privileges, char ***label_opts, size_t *label_opts_len, char **seccomp_profile); + +int merge_share_namespace(oci_runtime_spec *oci_spec, const host_config *host_spec); #ifdef __cplusplus } #endif diff --git a/src/services/execution/spec/specs_extend.c b/src/services/execution/spec/specs_extend.c index def3978..3305c1e 100644 --- a/src/services/execution/spec/specs_extend.c +++ b/src/services/execution/spec/specs_extend.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container specs functions diff --git a/src/services/execution/spec/specs_extend.h b/src/services/execution/spec/specs_extend.h index a9dc28c..ff41881 100644 --- a/src/services/execution/spec/specs_extend.h +++ b/src/services/execution/spec/specs_extend.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2017-11-22 * Description: provide specs definition diff --git a/src/services/execution/spec/specs_mount.c b/src/services/execution/spec/specs_mount.c index 979be1e..ff89083 100644 --- a/src/services/execution/spec/specs_mount.c +++ b/src/services/execution/spec/specs_mount.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container specs functions @@ -2311,12 +2311,31 @@ out: return ret; } +int destination_compare(const void *p1, const void *p2) +{ + defs_mount *mount_1 = *(defs_mount **)p1; + defs_mount *mount_2 = *(defs_mount **)p2; + + return strcmp(mount_1->destination, mount_2->destination); +} + int merge_conf_mounts(oci_runtime_spec *oci_spec, host_config *host_spec, container_config_v2_common_config *v2_spec) { int ret = 0; container_config *container_spec = v2_spec->config; + /* mounts to mount filesystem */ + if (container_spec->mounts && container_spec->mounts_len) { + ret = merge_volumes(oci_spec, container_spec->mounts, + container_spec->mounts_len, v2_spec, + parse_mount); + if (ret) { + ERROR("Failed to merge mounts"); + goto out; + } + } + /* volumes to mount */ if (host_spec->binds != NULL && host_spec->binds_len) { ret = merge_volumes(oci_spec, host_spec->binds, @@ -2336,17 +2355,6 @@ int merge_conf_mounts(oci_runtime_spec *oci_spec, host_config *host_spec, } } - /* mounts to mount filesystem */ - if (container_spec->mounts && container_spec->mounts_len) { - ret = merge_volumes(oci_spec, container_spec->mounts, - container_spec->mounts_len, v2_spec, - parse_mount); - if (ret) { - ERROR("Failed to merge mounts"); - goto out; - } - } - if (host_spec->shm_size == 0) { host_spec->shm_size = DEFAULT_SHM_SIZE; } @@ -2363,7 +2371,7 @@ int merge_conf_mounts(oci_runtime_spec *oci_spec, host_config *host_spec, add_shm_mount(oci_spec, v2_spec->shm_path); } - if (host_spec->shm_size > 0) { + if (!has_mount_shm(host_spec, v2_spec) && host_spec->shm_size > 0) { ret = change_dev_shm_size(oci_spec, host_spec); if (ret) { ERROR("Failed to set dev shm size"); @@ -2379,6 +2387,8 @@ int merge_conf_mounts(oci_runtime_spec *oci_spec, host_config *host_spec, } } + qsort(oci_spec->mounts, oci_spec->mounts_len, sizeof(oci_spec->mounts[0]), destination_compare); + out: return ret; } diff --git a/src/services/execution/spec/specs_mount.h b/src/services/execution/spec/specs_mount.h index 88d1bb7..094b957 100644 --- a/src/services/execution/spec/specs_mount.h +++ b/src/services/execution/spec/specs_mount.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2017-11-22 * Description: provide specs definition diff --git a/src/services/execution/spec/specs_security.c b/src/services/execution/spec/specs_security.c index c940daa..1dd42b2 100644 --- a/src/services/execution/spec/specs_security.c +++ b/src/services/execution/spec/specs_security.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container specs functions diff --git a/src/services/execution/spec/specs_security.h b/src/services/execution/spec/specs_security.h index 658b5ec..4b9f11b 100644 --- a/src/services/execution/spec/specs_security.h +++ b/src/services/execution/spec/specs_security.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2017-11-22 * Description: provide specs definition diff --git a/src/services/execution/spec/sysinfo.c b/src/services/execution/spec/sysinfo.c index 749e548..229a4bb 100644 --- a/src/services/execution/spec/sysinfo.c +++ b/src/services/execution/spec/sysinfo.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: maoweiyong * Create: 2017-11-22 * Description: provide system information functions diff --git a/src/services/execution/spec/sysinfo.h b/src/services/execution/spec/sysinfo.h index 7832564..1b5d5ef 100644 --- a/src/services/execution/spec/sysinfo.h +++ b/src/services/execution/spec/sysinfo.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container sysinfo definition diff --git a/src/services/execution/spec/verify.c b/src/services/execution/spec/verify.c index 80054b0..a066492 100644 --- a/src/services/execution/spec/verify.c +++ b/src/services/execution/spec/verify.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container verify functions diff --git a/src/services/execution/spec/verify.h b/src/services/execution/spec/verify.h index 6801a90..828faf2 100644 --- a/src/services/execution/spec/verify.h +++ b/src/services/execution/spec/verify.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container verify definition diff --git a/src/services/graphdriver/devmapper/driver_devmapper.c b/src/services/graphdriver/devmapper/driver_devmapper.c index c82bd3f..6e6dc62 100644 --- a/src/services/graphdriver/devmapper/driver_devmapper.c +++ b/src/services/graphdriver/devmapper/driver_devmapper.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. -* iSulad licensed under the Mulan PSL v1. -* You can use this software according to the terms and conditions of the Mulan PSL v1. -* You may obtain a copy of Mulan PSL v1 at: -* http://license.coscl.org.cn/MulanPSL +* iSulad licensed under the Mulan PSL v2. +* You can use this software according to the terms and conditions of the Mulan PSL v2. +* You may obtain a copy of Mulan PSL v2 at: +* http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. -* See the Mulan PSL v1 for more details. +* See the Mulan PSL v2 for more details. * Author: wangfengtu * Create: 2020-01-19 * Description: provide devicemapper graphdriver function definition diff --git a/src/services/graphdriver/devmapper/driver_devmapper.h b/src/services/graphdriver/devmapper/driver_devmapper.h index 7f94f9e..f9cbb36 100644 --- a/src/services/graphdriver/devmapper/driver_devmapper.h +++ b/src/services/graphdriver/devmapper/driver_devmapper.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. -* iSulad licensed under the Mulan PSL v1. -* You can use this software according to the terms and conditions of the Mulan PSL v1. -* You may obtain a copy of Mulan PSL v1 at: -* http://license.coscl.org.cn/MulanPSL +* iSulad licensed under the Mulan PSL v2. +* You can use this software according to the terms and conditions of the Mulan PSL v2. +* You may obtain a copy of Mulan PSL v2 at: +* http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. -* See the Mulan PSL v1 for more details. +* See the Mulan PSL v2 for more details. * Author: wangfengtu * Create: 2020-01-19 * Description: provide devicemapper graphdriver function definition diff --git a/src/services/graphdriver/driver.c b/src/services/graphdriver/driver.c index b7721af..d92dc97 100644 --- a/src/services/graphdriver/driver.c +++ b/src/services/graphdriver/driver.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide image functions @@ -27,8 +27,8 @@ #include "isulad_config.h" #include "image.h" -/* overlay2 */ - +/* overlay/overlay2 */ +#define DRIVER_OVERLAY_NAME "overlay" #define DRIVER_OVERLAY2_NAME "overlay2" static const struct graphdriver_ops g_overlay2_ops = { .init = overlay2_init, @@ -124,6 +124,77 @@ free_out: return status; } +container_inspect_graph_driver *graphdriver_get_metadata(char *id) +{ + container_inspect_graph_driver *inspect_driver = NULL; + int ret = -1; + im_storage_metadata_response *resp = NULL; + int i = 0; + + ret = im_get_storage_metadata(IMAGE_TYPE_OCI, id, &resp); + if (ret != 0) { + goto free_out; + } + + if (resp->name == NULL || resp->metadata == NULL) { + ERROR("Failed to get metadata or name"); + ret = -1; + goto free_out; + } + + inspect_driver = util_common_calloc_s(sizeof(container_inspect_graph_driver)); + if (inspect_driver == NULL) { + ERROR("Out of memory"); + ret = -1; + goto free_out; + } + inspect_driver->data = util_common_calloc_s(sizeof(container_inspect_graph_driver_data)); + if (inspect_driver->data == NULL) { + ERROR("Out of memory"); + ret = -1; + goto free_out; + } + + inspect_driver->name = util_strdup_s(resp->name); + + if (!strcmp(resp->name, DRIVER_OVERLAY_NAME) || !strcmp(resp->name, DRIVER_OVERLAY2_NAME)) { + for (i = 0; i < resp->metadata->len; i++) { + if (!strcmp(resp->metadata->keys[i], "LowerDir")) { + inspect_driver->data->lower_dir = util_strdup_s(resp->metadata->values[i]); + } else if (!strcmp(resp->metadata->keys[i], "MergedDir")) { + inspect_driver->data->merged_dir = util_strdup_s(resp->metadata->values[i]); + } else if (!strcmp(resp->metadata->keys[i], "UpperDir")) { + inspect_driver->data->upper_dir = util_strdup_s(resp->metadata->values[i]); + } else if (!strcmp(resp->metadata->keys[i], "WorkDir")) { + inspect_driver->data->work_dir = util_strdup_s(resp->metadata->values[i]); + } + } + } else if (!strcmp(resp->name, DRIVER_DEVMAPPER_NAME)) { + for (i = 0; i < resp->metadata->len; i++) { + if (!strcmp(resp->metadata->keys[i], "DeviceId")) { + inspect_driver->data->device_id = util_strdup_s(resp->metadata->values[i]); + } else if (!strcmp(resp->metadata->keys[i], "DeviceName")) { + inspect_driver->data->device_name = util_strdup_s(resp->metadata->values[i]); + } else if (!strcmp(resp->metadata->keys[i], "DeviceSize")) { + inspect_driver->data->device_size = util_strdup_s(resp->metadata->values[i]); + } + } + } else { + ERROR("Unsupported driver %s", resp->name); + ret = -1; + goto free_out; + } + + ret = 0; +free_out: + free_im_storage_metadata_response(resp); + if (ret != 0) { + free_container_inspect_graph_driver(inspect_driver); + return NULL; + } + return inspect_driver; +} + int update_graphdriver_status(struct graphdriver **driver) { struct graphdriver_status *status = NULL; diff --git a/src/services/graphdriver/driver.h b/src/services/graphdriver/driver.h index 8192683..3d2f5e5 100644 --- a/src/services/graphdriver/driver.h +++ b/src/services/graphdriver/driver.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2019-04-02 * Description: provide graphdriver function definition @@ -18,6 +18,7 @@ #include #include #include +#include "container_inspect.h" #ifdef __cplusplus extern "C" { @@ -50,6 +51,8 @@ struct graphdriver *graphdriver_get(const char *name); struct graphdriver_status *graphdriver_get_status(void); +container_inspect_graph_driver *graphdriver_get_metadata(char *id); + int update_graphdriver_status(struct graphdriver **driver); void graphdriver_umount_mntpoint(void); diff --git a/src/services/graphdriver/overlay2/driver_overlay2.c b/src/services/graphdriver/overlay2/driver_overlay2.c index 4168681..9a8939d 100644 --- a/src/services/graphdriver/overlay2/driver_overlay2.c +++ b/src/services/graphdriver/overlay2/driver_overlay2.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2019-04-02 * Description: provide overlay2 function definition diff --git a/src/services/graphdriver/overlay2/driver_overlay2.h b/src/services/graphdriver/overlay2/driver_overlay2.h index 267dba1..0caa784 100644 --- a/src/services/graphdriver/overlay2/driver_overlay2.h +++ b/src/services/graphdriver/overlay2/driver_overlay2.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2019-04-02 * Description: provide overlay2 function definition diff --git a/src/services/image/image_cb.c b/src/services/image/image_cb.c index 61a0001..0f18340 100644 --- a/src/services/image/image_cb.c +++ b/src/services/image/image_cb.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide image functions @@ -384,6 +384,111 @@ out: return (ret < 0) ? ECOMMON : ret; } +/* tag image */ +static int tag_image(const char *src_name, const char *dest_name) +{ + int ret = 0; + im_tag_request *im_request = NULL; + im_tag_response *im_response = NULL; + + if (src_name == NULL || dest_name == NULL) { + ERROR("invalid NULL param"); + return EINVALIDARGS; + } + + im_request = util_common_calloc_s(sizeof(im_tag_request)); + if (im_request == NULL) { + ERROR("Out of memory"); + ret = -1; + goto out; + } + + im_request->src_name.image = util_strdup_s(src_name); + im_request->dest_name.image = util_strdup_s(dest_name); + + ret = im_tag_image(im_request, &im_response); + if (ret != 0) { + if (im_response != NULL && im_response->errmsg != NULL) { + ERROR("Tag image %s to %s failed:%s", src_name, dest_name, im_response->errmsg); + isulad_try_set_error_message("Tag image %s to %s failed:%s", src_name, dest_name, im_response->errmsg); + } else { + ERROR("Tag image %s to %s failed", src_name, dest_name); + isulad_try_set_error_message("Tag image %s to %s failed"); + } + ret = -1; + goto out; + } + +out: + free_im_tag_request(im_request); + free_im_tag_response(im_response); + + return ret; +} + +/* image tag cb */ +static int image_tag_cb(const image_tag_image_request *request, + image_tag_image_response **response) +{ + int ret = -1; + char *src_name = NULL; + char *dest_name = NULL; + uint32_t cc = ISULAD_SUCCESS; + + DAEMON_CLEAR_ERRMSG(); + + if (request == NULL || request->src_name == NULL || response == NULL || + request->dest_name == NULL) { + ERROR("Invalid input arguments"); + return EINVALIDARGS; + } + + src_name = request->src_name; + dest_name = request->dest_name; + + *response = util_common_calloc_s(sizeof(image_delete_image_response)); + if (*response == NULL) { + ERROR("Out of memory"); + cc = ISULAD_ERR_MEMOUT; + goto out; + } + + if (!util_valid_image_name(src_name)) { + ERROR("Invalid image name %s", src_name); + cc = ISULAD_ERR_INPUT; + isulad_try_set_error_message("Invalid image name:%s", src_name); + goto out; + } + + if (!util_valid_image_name(dest_name)) { + ERROR("Invalid image name %s", dest_name); + cc = ISULAD_ERR_INPUT; + isulad_try_set_error_message("Invalid image name:%s", dest_name); + goto out; + } + + EVENT("Image Event: {Object: %s, Type: Tagging}", src_name); + + ret = tag_image(src_name, dest_name); + if (ret != 0) { + cc = ISULAD_ERR_EXEC; + goto out; + } + + EVENT("Image Event: {Object: %s, Type: Tagged}", src_name); + +out: + if (*response != NULL) { + (*response)->cc = cc; + if (g_isulad_errmsg != NULL) { + (*response)->errmsg = util_strdup_s(g_isulad_errmsg); + DAEMON_CLEAR_ERRMSG(); + } + } + + return (ret < 0) ? ECOMMON : ret; +} + static bool valid_repo_tags(char * const * const repo_tags, size_t repo_index) { if (repo_tags != NULL && repo_tags[repo_index] != NULL) { @@ -890,5 +995,6 @@ void image_callback_init(service_image_callback_t *cb) cb->inspect = image_inspect_cb; cb->login = login_cb; cb->logout = logout_cb; + cb->tag = image_tag_cb; } diff --git a/src/services/image/image_cb.h b/src/services/image/image_cb.h index aed8f67..bed4600 100644 --- a/src/services/image/image_cb.h +++ b/src/services/image/image_cb.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide image function definition diff --git a/src/sha256/sha256.c b/src/sha256/sha256.c index 5f43c9b..a1c2f11 100644 --- a/src/sha256/sha256.c +++ b/src/sha256/sha256.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide container sha256 functions diff --git a/src/sha256/sha256.h b/src/sha256/sha256.h index 429e645..e052cbf 100644 --- a/src/sha256/sha256.h +++ b/src/sha256/sha256.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2017-11-22 * Description: provide container sha256 definition diff --git a/src/sysctl_tools.c b/src/sysctl_tools.c index 8af8f59..98f7ee1 100644 --- a/src/sysctl_tools.c +++ b/src/sysctl_tools.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide sysctl functions diff --git a/src/sysctl_tools.h b/src/sysctl_tools.h index 62f8133..90cf988 100644 --- a/src/sysctl_tools.h +++ b/src/sysctl_tools.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide sysctl function definition diff --git a/src/tar/libtar.c b/src/tar/libtar.c index 79c65dd..e6cb893 100644 --- a/src/tar/libtar.c +++ b/src/tar/libtar.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide tar functions diff --git a/src/tar/libtar.h b/src/tar/libtar.h index a55c832..5d5a45b 100644 --- a/src/tar/libtar.h +++ b/src/tar/libtar.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide tar function definition diff --git a/src/types_def.c b/src/types_def.c index 9134976..4138b6f 100644 --- a/src/types_def.c +++ b/src/types_def.c @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide typedef functions diff --git a/src/types_def.h b/src/types_def.h index 711ed21..fd3073d 100644 --- a/src/types_def.h +++ b/src/types_def.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: tanyifeng * Create: 2018-11-1 * Description: provide typedef functions definition diff --git a/src/websocket/service/attach_serve.cc b/src/websocket/service/attach_serve.cc index 1eba860..62b1619 100644 --- a/src/websocket/service/attach_serve.cc +++ b/src/websocket/service/attach_serve.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide container attach functions @@ -48,10 +48,11 @@ int AttachServe::Execute(struct lws *wsi, const std::string &token, } struct io_write_wrapper stringWriter = { 0 }; stringWriter.context = (void *)wsi; - stringWriter.write_func = WsWriteToClient; + stringWriter.write_func = WsWriteStdoutToClient; stringWriter.close_func = closeWsConnect; container_req->attach_stderr = false; - int ret = cb->container.attach(container_req, &container_res, read_pipe_fd, &stringWriter, nullptr); + int ret = cb->container.attach(container_req, &container_res, + container_req->attach_stdin ? read_pipe_fd : -1, &stringWriter, nullptr); free_container_attach_request(container_req); free_container_attach_response(container_res); diff --git a/src/websocket/service/attach_serve.h b/src/websocket/service/attach_serve.h index c38b110..300b940 100644 --- a/src/websocket/service/attach_serve.h +++ b/src/websocket/service/attach_serve.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Description: Attach streaming service implementation. * Author: wujing * Create: 2019-01-02 diff --git a/src/websocket/service/exec_serve.cc b/src/websocket/service/exec_serve.cc index 13e0f91..0437b93 100644 --- a/src/websocket/service/exec_serve.cc +++ b/src/websocket/service/exec_serve.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide ExecServe functions @@ -45,10 +45,14 @@ int ExecServe::Execute(struct lws *wsi, const std::string &token, ERROR("Failed to transform grpc request!"); return -1; } - struct io_write_wrapper stringWriter = { 0 }; - stringWriter.context = (void *)wsi; - stringWriter.write_func = WsWriteToClient; - int ret = cb->container.exec(container_req, &container_res, read_pipe_fd, &stringWriter); + struct io_write_wrapper StdoutstringWriter = { 0 }; + StdoutstringWriter.context = (void *)wsi; + StdoutstringWriter.write_func = WsWriteStdoutToClient; + struct io_write_wrapper StderrstringWriter = { 0 }; + StderrstringWriter.context = (void *)wsi; + StderrstringWriter.write_func = WsWriteStderrToClient; + int ret = cb->container.exec(container_req, &container_res, + container_req->attach_stdin ? read_pipe_fd : -1, &StdoutstringWriter, &StderrstringWriter); if (ret != 0) { std::string message; if (container_res != nullptr && container_res->errmsg != nullptr) { @@ -56,11 +60,11 @@ int ExecServe::Execute(struct lws *wsi, const std::string &token, } else { message = "Failed to call exec container callback. "; } - WsWriteToClient(wsi, message.c_str(), message.length()); + WsWriteStdoutToClient(wsi, message.c_str(), message.length()); } if (container_res != nullptr && container_res->exit_code != 0) { std::string exit_info = "Exit code :" + std::to_string((int)container_res->exit_code) + "\n"; - WsWriteToClient(wsi, exit_info.c_str(), exit_info.length()); + WsWriteStdoutToClient(wsi, exit_info.c_str(), exit_info.length()); } free_container_exec_request(container_req); free_container_exec_response(container_res); diff --git a/src/websocket/service/exec_serve.h b/src/websocket/service/exec_serve.h index c716fd6..73de44e 100644 --- a/src/websocket/service/exec_serve.h +++ b/src/websocket/service/exec_serve.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Description: Exec streaming service implementation. * Author: wujing * Create: 2019-01-02 diff --git a/src/websocket/service/route_callback_register.h b/src/websocket/service/route_callback_register.h index 394324a..9f74d41 100644 --- a/src/websocket/service/route_callback_register.h +++ b/src/websocket/service/route_callback_register.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Description: Streaming service function registration. * Author: wujing * Create: 2019-01-02 diff --git a/src/websocket/service/stream_server.cc b/src/websocket/service/stream_server.cc index c2fd4be..b4df642 100644 --- a/src/websocket/service/stream_server.cc +++ b/src/websocket/service/stream_server.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide websocket server functions diff --git a/src/websocket/service/stream_server.h b/src/websocket/service/stream_server.h index cfd563e..aa7bd9d 100644 --- a/src/websocket/service/stream_server.h +++ b/src/websocket/service/stream_server.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide websocket stream service definition diff --git a/src/websocket/service/ws_server.cc b/src/websocket/service/ws_server.cc index da1d564..b961b85 100644 --- a/src/websocket/service/ws_server.cc +++ b/src/websocket/service/ws_server.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2018-11-08 * Description: provide websocket server functions @@ -410,7 +410,7 @@ void WebsocketServer::Wait() } -ssize_t WsWriteToClient(void *context, const void *data, size_t len) +ssize_t WsWriteStdoutToClient(void *context, const void *data, size_t len) { const int RETRIES = 10; const int CHECK_PERIOD_SECOND = 1; @@ -456,6 +456,52 @@ ssize_t WsWriteToClient(void *context, const void *data, size_t len) return (ssize_t)len; } +ssize_t WsWriteStderrToClient(void *context, const void *data, size_t len) +{ + const int RETRIES = 10; + const int CHECK_PERIOD_SECOND = 1; + const int TRIGGER_PERIOD_MS = 100; + + struct lws *wsi = static_cast(context); + WebsocketServer *server = WebsocketServer::GetInstance(); + server->LockAllWsSession(); + auto it = server->GetWsisData().find(wsi); + if (it == server->GetWsisData().end()) { + ERROR("invalid session!"); + server->UnlockAllWsSession(); + return 0; + } + it->second.SetProcessingStatus(true); + server->UnlockAllWsSession(); + server->SetLwsSendedFlag(wsi, false); + it->second.buf_mutex->lock(); + auto &buf = it->second.buf; + // Determine if it is standard output channel or error channel? + (void)memset(buf, 0, LWS_PRE + MAX_MSG_BUFFER_SIZE + 1); + buf[LWS_PRE] = STDERRCHANNEL; + + (void)memcpy(&buf[LWS_PRE + 1], (void *)data, len); + auto start = std::chrono::system_clock::now(); + lws_callback_on_writable(wsi); + it->second.buf_mutex->unlock(); + int count = 0; + while (!it->second.sended && count < RETRIES) { + auto end = std::chrono::system_clock::now(); + auto duration = std::chrono::duration_cast(end - start); + double spend_time = static_cast(duration.count()) * std::chrono::microseconds::period::num / + std::chrono::microseconds::period::den; + if (spend_time > CHECK_PERIOD_SECOND) { + lws_callback_on_writable(wsi); + std::this_thread::sleep_for(std::chrono::milliseconds(TRIGGER_PERIOD_MS)); + start = std::chrono::system_clock::now(); + count++; + } + std::this_thread::sleep_for(std::chrono::milliseconds(TRIGGER_PERIOD_MS)); + } + it->second.SetProcessingStatus(false); + return (ssize_t)len; +} + int closeWsConnect(void *context, char **err) { (void)err; diff --git a/src/websocket/service/ws_server.h b/src/websocket/service/ws_server.h index 5a8d269..761d7ab 100644 --- a/src/websocket/service/ws_server.h +++ b/src/websocket/service/ws_server.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Description: websockets server implementation * Author: wujing * Create: 2019-01-02 @@ -119,7 +119,8 @@ private: int m_listenPort; }; -ssize_t WsWriteToClient(void *context, const void *data, size_t len); +ssize_t WsWriteStdoutToClient(void *context, const void *data, size_t len); +ssize_t WsWriteStderrToClient(void *context, const void *data, size_t len); int closeWsConnect(void *context, char **err); #endif /* __WEBSOCKET_SERVER_H_ */ diff --git a/test/cmd/isula/extend/pause/pause_llt.cc b/test/cmd/isula/extend/pause/pause_llt.cc index 4c2fecb..8039963 100644 --- a/test/cmd/isula/extend/pause/pause_llt.cc +++ b/test/cmd/isula/extend/pause/pause_llt.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-14 * Description: provide pause unit test diff --git a/test/cmd/isula/extend/resume/resume_llt.cc b/test/cmd/isula/extend/resume/resume_llt.cc index 781e460..e317197 100644 --- a/test/cmd/isula/extend/resume/resume_llt.cc +++ b/test/cmd/isula/extend/resume/resume_llt.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2020-02-14 * Description: provide unpause unit test diff --git a/test/cmd/isula/infomation/info/info_llt.cc b/test/cmd/isula/infomation/info/info_llt.cc index b4a6b18..6a35e22 100644 --- a/test/cmd/isula/infomation/info/info_llt.cc +++ b/test/cmd/isula/infomation/info/info_llt.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wangfengtu * Create: 2020-02-20 * Description: provide info mock diff --git a/test/cutils/utils_array/utils_array_llt.cc b/test/cutils/utils_array/utils_array_llt.cc index cb18c74..4f74f55 100644 --- a/test/cutils/utils_array/utils_array_llt.cc +++ b/test/cutils/utils_array/utils_array_llt.cc @@ -1,13 +1,13 @@ /* * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Description: utils_array llt * Author: tanyifeng * Create: 2019-09-24 diff --git a/test/cutils/utils_convert/utils_convert_llt.cc b/test/cutils/utils_convert/utils_convert_llt.cc index d7c944d..617a52f 100644 --- a/test/cutils/utils_convert/utils_convert_llt.cc +++ b/test/cutils/utils_convert/utils_convert_llt.cc @@ -1,13 +1,13 @@ /* * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Description: utils_convert llt * Author: tanyifeng * Create: 2019-07-08 diff --git a/test/cutils/utils_string/utils_string_llt.cc b/test/cutils/utils_string/utils_string_llt.cc index 36dbcf9..207809b 100644 --- a/test/cutils/utils_string/utils_string_llt.cc +++ b/test/cutils/utils_string/utils_string_llt.cc @@ -1,13 +1,13 @@ /* * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Description: utils_string llt * Author: tanyifeng * Create: 2019-07-08 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 95c9f3b..5318bbe 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 @@ -1,13 +1,13 @@ /* * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Description: oci_config_merge llt * Author: wangfengtu * Create: 2019-08-20 diff --git a/test/image/oci/oci_llt_common.cc b/test/image/oci/oci_llt_common.cc index 5a6298b..2a66eed 100644 --- a/test/image/oci/oci_llt_common.cc +++ b/test/image/oci/oci_llt_common.cc @@ -1,13 +1,13 @@ /* * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Description: oci_rootfs_remove llt * Author: wangfengtu * Create: 2019-08-29 diff --git a/test/image/oci/oci_llt_common.h b/test/image/oci/oci_llt_common.h index c62d4e3..7394b12 100644 --- a/test/image/oci/oci_llt_common.h +++ b/test/image/oci/oci_llt_common.h @@ -1,13 +1,13 @@ /* * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Description: oci_rootfs_remove llt * Author: wangfengtu * Create: 2019-08-29 diff --git a/test/include/mock.h b/test/include/mock.h index 8ac7d2a..e257a55 100644 --- a/test/include/mock.h +++ b/test/include/mock.h @@ -1,13 +1,13 @@ /* * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Description: define mock method * Author: wangyushui * Create: 2019-6-10 diff --git a/test/mocks/collector_mock.cc b/test/mocks/collector_mock.cc index 169f236..55a2051 100644 --- a/test/mocks/collector_mock.cc +++ b/test/mocks/collector_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide collector mock diff --git a/test/mocks/collector_mock.h b/test/mocks/collector_mock.h index a7a0c4c..d3f8d27 100644 --- a/test/mocks/collector_mock.h +++ b/test/mocks/collector_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide collector mock diff --git a/test/mocks/container_state_mock.cc b/test/mocks/container_state_mock.cc index 0e88d4e..beb74d3 100644 --- a/test/mocks/container_state_mock.cc +++ b/test/mocks/container_state_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide container_state mock diff --git a/test/mocks/container_state_mock.h b/test/mocks/container_state_mock.h index f64b5bf..a717a93 100644 --- a/test/mocks/container_state_mock.h +++ b/test/mocks/container_state_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide container_state mock diff --git a/test/mocks/container_unix_mock.cc b/test/mocks/container_unix_mock.cc index cd8374a..a47dfdf 100644 --- a/test/mocks/container_unix_mock.cc +++ b/test/mocks/container_unix_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2020-02-14 * Description: provide container unix mock diff --git a/test/mocks/container_unix_mock.h b/test/mocks/container_unix_mock.h index 4197706..8af0b01 100644 --- a/test/mocks/container_unix_mock.h +++ b/test/mocks/container_unix_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: lifeng * Create: 2020-02-14 * Description: provide container unix mock diff --git a/test/mocks/containers_gc_mock.cc b/test/mocks/containers_gc_mock.cc index 74b8039..adc8446 100644 --- a/test/mocks/containers_gc_mock.cc +++ b/test/mocks/containers_gc_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide containers_gc mock diff --git a/test/mocks/containers_gc_mock.h b/test/mocks/containers_gc_mock.h index c1ea541..18775bb 100644 --- a/test/mocks/containers_gc_mock.h +++ b/test/mocks/containers_gc_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide containers_gc mock diff --git a/test/mocks/containers_store_mock.cc b/test/mocks/containers_store_mock.cc index 65022f5..133769b 100644 --- a/test/mocks/containers_store_mock.cc +++ b/test/mocks/containers_store_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2020-02-14 * Description: provide containers store mock diff --git a/test/mocks/containers_store_mock.h b/test/mocks/containers_store_mock.h index 3d0f16b..fc128a4 100644 --- a/test/mocks/containers_store_mock.h +++ b/test/mocks/containers_store_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2020-02-14 * Description: provide containers store mock diff --git a/test/mocks/driver_mock.cc b/test/mocks/driver_mock.cc index 75f23ee..d5ad19f 100644 --- a/test/mocks/driver_mock.cc +++ b/test/mocks/driver_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide driver mock diff --git a/test/mocks/driver_mock.h b/test/mocks/driver_mock.h index 856f853..d54659a 100644 --- a/test/mocks/driver_mock.h +++ b/test/mocks/driver_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide driver mock diff --git a/test/mocks/driver_overlay2_mock.cc b/test/mocks/driver_overlay2_mock.cc index 8289dae..1babd44 100644 --- a/test/mocks/driver_overlay2_mock.cc +++ b/test/mocks/driver_overlay2_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wangfengtu * Create: 2020-02-19 * Description: provide driver overlay2 mock diff --git a/test/mocks/driver_overlay2_mock.h b/test/mocks/driver_overlay2_mock.h index 0653818..1650613 100644 --- a/test/mocks/driver_overlay2_mock.h +++ b/test/mocks/driver_overlay2_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wangfengtu * Create: 2020-02-19 * Description: provide driver overlay2 mock diff --git a/test/mocks/engine_mock.cc b/test/mocks/engine_mock.cc index 0e55f23..32d45e1 100644 --- a/test/mocks/engine_mock.cc +++ b/test/mocks/engine_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2020-02-14 * Description: provide namespace mock diff --git a/test/mocks/engine_mock.h b/test/mocks/engine_mock.h index 18e6d5e..e783361 100644 --- a/test/mocks/engine_mock.h +++ b/test/mocks/engine_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2020-02-14 * Description: provide engine mock diff --git a/test/mocks/grpc_client_mock.cc b/test/mocks/grpc_client_mock.cc index a58f4e0..712d634 100644 --- a/test/mocks/grpc_client_mock.cc +++ b/test/mocks/grpc_client_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019-2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2019-12-19 * Description: provide grpc client mock diff --git a/test/mocks/grpc_client_mock.h b/test/mocks/grpc_client_mock.h index 3b988ab..f79138d 100644 --- a/test/mocks/grpc_client_mock.h +++ b/test/mocks/grpc_client_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2019-2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2019-12-19 * Description: provide grpc client mock diff --git a/test/mocks/health_check_mock.cc b/test/mocks/health_check_mock.cc index 51d84fc..bf02651 100644 --- a/test/mocks/health_check_mock.cc +++ b/test/mocks/health_check_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide health_check mock diff --git a/test/mocks/health_check_mock.h b/test/mocks/health_check_mock.h index fce65af..a214810 100644 --- a/test/mocks/health_check_mock.h +++ b/test/mocks/health_check_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide health_check mock diff --git a/test/mocks/image_mock.cc b/test/mocks/image_mock.cc index 7d1cb7f..81a6604 100644 --- a/test/mocks/image_mock.cc +++ b/test/mocks/image_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wangfengtu * Create: 2020-02-19 * Description: provide image mock diff --git a/test/mocks/image_mock.h b/test/mocks/image_mock.h index 7f97e2a..60069d4 100644 --- a/test/mocks/image_mock.h +++ b/test/mocks/image_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wangfengtu * Create: 2020-02-19 * Description: provide image mock diff --git a/test/mocks/isulad_config_mock.cc b/test/mocks/isulad_config_mock.cc index cdef765..7f95e3d 100644 --- a/test/mocks/isulad_config_mock.cc +++ b/test/mocks/isulad_config_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2020-02-14 * Description: provide namespace mock diff --git a/test/mocks/isulad_config_mock.h b/test/mocks/isulad_config_mock.h index 1e1f408..5604ba6 100644 --- a/test/mocks/isulad_config_mock.h +++ b/test/mocks/isulad_config_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2020-02-14 * Description: provide isulad config mock diff --git a/test/mocks/namespace_mock.cc b/test/mocks/namespace_mock.cc index 33041ff..6e3cdf8 100644 --- a/test/mocks/namespace_mock.cc +++ b/test/mocks/namespace_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2020-02-14 * Description: provide namespace mock diff --git a/test/mocks/namespace_mock.h b/test/mocks/namespace_mock.h index 85f7c85..e51c750 100644 --- a/test/mocks/namespace_mock.h +++ b/test/mocks/namespace_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2020-02-14 * Description: provide namespace mock diff --git a/test/mocks/restartmanager_mock.cc b/test/mocks/restartmanager_mock.cc index 73a183b..38911c7 100644 --- a/test/mocks/restartmanager_mock.cc +++ b/test/mocks/restartmanager_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide restartmanager mock diff --git a/test/mocks/restartmanager_mock.h b/test/mocks/restartmanager_mock.h index a1100e0..8537981 100644 --- a/test/mocks/restartmanager_mock.h +++ b/test/mocks/restartmanager_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide restartmanager mock diff --git a/test/mocks/runtime_mock.cc b/test/mocks/runtime_mock.cc index 2995a56..a3c4579 100644 --- a/test/mocks/runtime_mock.cc +++ b/test/mocks/runtime_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide runtime mock diff --git a/test/mocks/runtime_mock.h b/test/mocks/runtime_mock.h index 99f9b2d..a5905c0 100644 --- a/test/mocks/runtime_mock.h +++ b/test/mocks/runtime_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide runtime mock diff --git a/test/mocks/selinux_label_mock.cc b/test/mocks/selinux_label_mock.cc index 89e7768..68a60af 100644 --- a/test/mocks/selinux_label_mock.cc +++ b/test/mocks/selinux_label_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2020-02-11 * Description: provide selinux label mock diff --git a/test/mocks/selinux_label_mock.h b/test/mocks/selinux_label_mock.h index eaf2f69..673db96 100644 --- a/test/mocks/selinux_label_mock.h +++ b/test/mocks/selinux_label_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2020-02-11 * Description: provide selinux label mock diff --git a/test/mocks/selinux_mock.cc b/test/mocks/selinux_mock.cc index e6ed358..24d6073 100644 --- a/test/mocks/selinux_mock.cc +++ b/test/mocks/selinux_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2020-02-11 * Description: provide selinux mock diff --git a/test/mocks/selinux_mock.h b/test/mocks/selinux_mock.h index 81466f9..167a81f 100644 --- a/test/mocks/selinux_mock.h +++ b/test/mocks/selinux_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2020-02-11 * Description: provide selinux mock diff --git a/test/mocks/specs_mock.cc b/test/mocks/specs_mock.cc index a426c67..975d821 100644 --- a/test/mocks/specs_mock.cc +++ b/test/mocks/specs_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide specs mock diff --git a/test/mocks/specs_mock.h b/test/mocks/specs_mock.h index 6b9849f..30e2866 100644 --- a/test/mocks/specs_mock.h +++ b/test/mocks/specs_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide specs mock diff --git a/test/mocks/syscall_mock.cc b/test/mocks/syscall_mock.cc index da6f57a..c0f61f2 100644 --- a/test/mocks/syscall_mock.cc +++ b/test/mocks/syscall_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2020-02-11 * Description: provide syscall mock diff --git a/test/mocks/syscall_mock.h b/test/mocks/syscall_mock.h index 5196506..80b8b28 100644 --- a/test/mocks/syscall_mock.h +++ b/test/mocks/syscall_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2020-02-11 * Description: syscall mock diff --git a/test/mocks/sysinfo_mock.cc b/test/mocks/sysinfo_mock.cc index cb1eff5..9d03900 100644 --- a/test/mocks/sysinfo_mock.cc +++ b/test/mocks/sysinfo_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide sysinfo mock diff --git a/test/mocks/sysinfo_mock.h b/test/mocks/sysinfo_mock.h index 1c3d9b4..d3db32e 100644 --- a/test/mocks/sysinfo_mock.h +++ b/test/mocks/sysinfo_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide sysinfo mock diff --git a/test/mocks/verify_mock.cc b/test/mocks/verify_mock.cc index 6339687..3606cc4 100644 --- a/test/mocks/verify_mock.cc +++ b/test/mocks/verify_mock.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide verify mock diff --git a/test/mocks/verify_mock.h b/test/mocks/verify_mock.h index 97a4ada..4fb1a2c 100644 --- a/test/mocks/verify_mock.h +++ b/test/mocks/verify_mock.h @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide verify mock diff --git a/test/path/path_llt.cc b/test/path/path_llt.cc index ba7ef7c..1738306 100644 --- a/test/path/path_llt.cc +++ b/test/path/path_llt.cc @@ -1,13 +1,13 @@ /* * Copyright (c) Huawei Technologies Co., Ltd. 2019. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Description: path llt * Author: jikui * Create: 2019-08-22 diff --git a/test/runtime/isula/isula_rt_ops_llt.cc b/test/runtime/isula/isula_rt_ops_llt.cc index ac42b45..f807877 100644 --- a/test/runtime/isula/isula_rt_ops_llt.cc +++ b/test/runtime/isula/isula_rt_ops_llt.cc @@ -1,13 +1,13 @@ /* * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Description: isula runtime ops llt * Author: jingrui * Create: 2020-02-15 diff --git a/test/runtime/lcr/lcr_rt_ops_llt.cc b/test/runtime/lcr/lcr_rt_ops_llt.cc index 7afce71..ef9a3f6 100644 --- a/test/runtime/lcr/lcr_rt_ops_llt.cc +++ b/test/runtime/lcr/lcr_rt_ops_llt.cc @@ -1,13 +1,13 @@ /* * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Description: lcr runtime ops llt * Author: lifeng * Create: 2020-02-15 diff --git a/test/services/execution/execute/execution_extend/execution_extend_llt.cc b/test/services/execution/execute/execution_extend/execution_extend_llt.cc index fe8ed96..0537554 100644 --- a/test/services/execution/execute/execution_extend/execution_extend_llt.cc +++ b/test/services/execution/execute/execution_extend/execution_extend_llt.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: jikui * Create: 2020-02-25 * Description: provide execution_extend llt test diff --git a/test/services/execution/spec/selinux_label_llt.cc b/test/services/execution/spec/selinux_label_llt.cc index b5f612b..5dd828b 100644 --- a/test/services/execution/spec/selinux_label_llt.cc +++ b/test/services/execution/spec/selinux_label_llt.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2020-02-14 * Description: provide selinux label unit test diff --git a/test/services/execution/spec/selinux_label_mock_llt.cc b/test/services/execution/spec/selinux_label_mock_llt.cc index da719bd..94f8417 100644 --- a/test/services/execution/spec/selinux_label_mock_llt.cc +++ b/test/services/execution/spec/selinux_label_mock_llt.cc @@ -1,13 +1,13 @@ /****************************************************************************** * Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Author: wujing * Create: 2020-02-14 * Description: provide selinux label unit test diff --git a/test/services/graphdriver/driver/driver_llt.cc b/test/services/graphdriver/driver/driver_llt.cc index 76f53f8..4dead3f 100644 --- a/test/services/graphdriver/driver/driver_llt.cc +++ b/test/services/graphdriver/driver/driver_llt.cc @@ -1,13 +1,13 @@ /* * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Description: driver llt * Author: wangfengtu * Create: 2020-02-19 diff --git a/test/specs/specs/specs_llt.cc b/test/specs/specs/specs_llt.cc index 66ca319..8915d4c 100644 --- a/test/specs/specs/specs_llt.cc +++ b/test/specs/specs/specs_llt.cc @@ -1,13 +1,13 @@ /* * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Description: specs llt * Author: lifeng * Create: 2020-02-18 diff --git a/test/specs/specs_extend/specs_extend_llt.cc b/test/specs/specs_extend/specs_extend_llt.cc index cefee30..8699ccd 100644 --- a/test/specs/specs_extend/specs_extend_llt.cc +++ b/test/specs/specs_extend/specs_extend_llt.cc @@ -1,13 +1,13 @@ /* * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. - * iSulad licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * http://license.coscl.org.cn/MulanPSL + * iSulad licensed under the Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR * PURPOSE. - * See the Mulan PSL v1 for more details. + * See the Mulan PSL v2 for more details. * Description: specs extend llt * Author: lifeng * Create: 2020-02-18 diff --git a/test/test.sh b/test/test.sh index 2821754..876d888 100755 --- a/test/test.sh +++ b/test/test.sh @@ -1,13 +1,13 @@ ####################################################################### ##- @Copyright (C) Huawei Technologies., Ltd. 2019. All rights reserved. -# - iSulad licensed under the Mulan PSL v1. -# - You can use this software according to the terms and conditions of the Mulan PSL v1. -# - You may obtain a copy of Mulan PSL v1 at: -# - http://license.coscl.org.cn/MulanPSL +# - iSulad licensed under the Mulan PSL v2. +# - You can use this software according to the terms and conditions of the Mulan PSL v2. +# - You may obtain a copy of Mulan PSL v2 at: +# - http://license.coscl.org.cn/MulanPSL2 # - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR # - IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR # - PURPOSE. -# - See the Mulan PSL v1 for more details. +# - See the Mulan PSL v2 for more details. ##- @Description: generate cetification ##- @Author: wujing ##- @Create: 2019-04-25 diff --git a/tools/static_check b/tools/static_check index a7cf5fe..51c4b01 100755 --- a/tools/static_check +++ b/tools/static_check @@ -1,13 +1,13 @@ ####################################################################### ##- @Copyright (C) Huawei Technologies., Ltd. 2019. All rights reserved. -# - iSulad licensed under the Mulan PSL v1. -# - You can use this software according to the terms and conditions of the Mulan PSL v1. -# - You may obtain a copy of Mulan PSL v1 at: -# - http://license.coscl.org.cn/MulanPSL +# - iSulad licensed under the Mulan PSL v2. +# - You can use this software according to the terms and conditions of the Mulan PSL v2. +# - You may obtain a copy of Mulan PSL v2 at: +# - http://license.coscl.org.cn/MulanPSL2 # - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR # - IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR # - PURPOSE. -# - See the Mulan PSL v1 for more details. +# - See the Mulan PSL v2 for more details. ##- @Description: generate cetification ##- @Author: wujing ##- @Create: 2019-04-25 diff --git a/update-version.bash b/update-version.bash index dba43aa..9371461 100755 --- a/update-version.bash +++ b/update-version.bash @@ -1,13 +1,13 @@ ####################################################################### ##- @Copyright (C) Huawei Technologies., Ltd. 2019. All rights reserved. -# - iSulad licensed under the Mulan PSL v1. -# - You can use this software according to the terms and conditions of the Mulan PSL v1. -# - You may obtain a copy of Mulan PSL v1 at: -# - http://license.coscl.org.cn/MulanPSL +# - iSulad licensed under the Mulan PSL v2. +# - You can use this software according to the terms and conditions of the Mulan PSL v2. +# - You may obtain a copy of Mulan PSL v2 at: +# - http://license.coscl.org.cn/MulanPSL2 # - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR # - IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR # - PURPOSE. -# - See the Mulan PSL v1 for more details. +# - See the Mulan PSL v2 for more details. ##- @Description: generate cetification ##- @Author: wujing ##- @Create: 2019-04-25 @@ -17,6 +17,7 @@ # ./update-version.bash topDir=$(git rev-parse --show-toplevel) specfile="${topDir}/iSulad.spec" +Cmakefile="${topDir}/CMakeLists.txt" Version_CMakefile="${topDir}/cmake/options.cmake" old_version=$(cat ${specfile} | grep "%global" | grep "_version" | awk {'print $3'}) first_old_version=$(cat ${specfile} | grep "%global" | grep "_version" | awk {'print $3'} | awk -F "." {'print $1'}) @@ -49,6 +50,7 @@ commit_id=${commit_id_long:0:8} new_release=`date "+%Y%m%d"`.`date "+%H%M%S"`.git$commit_id echo "The relase version has been modified, it is ${new_release}" sed -i "s/set(ISULAD_VERSION \"${old_version}\")/set(ISULAD_VERSION \"${new_version}\")/g" ${Version_CMakefile} +sed -i "s/^.*set(GIT_COMMIT_HASH.*$/set(GIT_COMMIT_HASH \"${commit_id_long}\")/g" ${Cmakefile} sed -i "s/^\%global _version ${old_version}$/\%global _version ${new_version}/g" ${specfile} sed -i "s/^\%global _release ${old_release}$/\%global _release ${new_release}/g" ${specfile}