!6 modify package from isulad-tools to syscontainer-tools

Merge pull request !6 from zhangsong234/master
This commit is contained in:
openeuler-ci-bot 2020-02-12 16:15:02 +08:00 committed by Gitee
commit f25c2f5869
71 changed files with 303 additions and 297 deletions

View File

@ -12,7 +12,7 @@
### general ### general
* change Mtu range (MR: #80) * change Mtu range (MR: #80)
* remove 'add-path/remove-path' commands from isulad-tools (MR: #82) * remove 'add-path/remove-path' commands from syscontainer-tools (MR: #82)
* network: config net device 'tx/sg/tso' on (MR: #81) * network: config net device 'tx/sg/tso' on (MR: #81)
* fix some minor issue(security check, file mode...) (MR: #84) * fix some minor issue(security check, file mode...) (MR: #84)
* fix when supply empty mac address, `add-nic` will panic (MR: #85) * fix when supply empty mac address, `add-nic` will panic (MR: #85)
@ -23,22 +23,22 @@
### general ### general
* reorginzed the isulad-tools code (MR: #75) * reorginzed the syscontainer-tools code (MR: #75)
* use`isulad-tools` in `isulad-tools_wrapper` instead of `isula exec` (MR: #76) * use`syscontainer-tools` in `syscontainer-tools_wrapper` instead of `isula exec` (MR: #76)
* fix filelock can't lock accross the process issue (MR: #78) * fix filelock can't lock accross the process issue (MR: #78)
### hooks ### hooks
* combine 3 hooks binary to `isulad-hooks` (MR: #75) * combine 3 hooks binary to `syscontainer-hooks` (MR: #75)
## v0.6 (2017-6-23) ## v0.6 (2017-6-23)
### general ### general
* isulad-tools add `add-route & del-nic & del-route` command line. (MR: #71, #68) * syscontainer-tools add `add-route & del-nic & del-route` command line. (MR: #71, #68)
* isulad-tools add-nic supports network interface config. (MR: #68) * syscontainer-tools add-nic supports network interface config. (MR: #68)
* isulad-tools supports fidsk in container. (MR: #70) * syscontainer-tools supports fidsk in container. (MR: #70)
* isulad-tools could only remove the devices added by isulad-tools (MR: #66) * syscontainer-tools could only remove the devices added by syscontainer-tools (MR: #66)
### network-hook ### network-hook
@ -51,11 +51,11 @@
* fix some dir permissions for potential security risk. (MR: #56, #57, #62) * fix some dir permissions for potential security risk. (MR: #56, #57, #62)
* move empty_systemd.sh to iSulad project. (MR: #60) * move empty_systemd.sh to iSulad project. (MR: #60)
### isulad-tools ### syscontainer-tools
* fix isulad-tools subcommand display orders. (MR: #55) * fix syscontainer-tools subcommand display orders. (MR: #55)
* when iSulad daemon and isulad-tools are not in the same cgroup path, device-hook will fail to update cgroup permissions. (MR: #58) * when iSulad daemon and syscontainer-tools are not in the same cgroup path, device-hook will fail to update cgroup permissions. (MR: #58)
* when containers specify cgroup folder (with `--cgroup-parent` flag), isulad-tools will fail to update device cgroup permissions. (MR: #64) * when containers specify cgroup folder (with `--cgroup-parent` flag), syscontainer-tools will fail to update device cgroup permissions. (MR: #64)
### oci-relabel-hook ### oci-relabel-hook
@ -67,9 +67,9 @@
* fix some golang security problems based on review comments * fix some golang security problems based on review comments
### isulad-tools ### syscontainer-tools
* Fix find cgroup path issue when isulad-tools run in container * Fix find cgroup path issue when syscontainer-tools run in container
* Add upstart support for system container * Add upstart support for system container
## v0.3 (2017-1-9) ## v0.3 (2017-1-9)
@ -84,9 +84,9 @@
* device-hook: Update cgroup permission in prestart hook not poststart * device-hook: Update cgroup permission in prestart hook not poststart
* oci-relabel-hook: Use golang to refact oci-relabel-hook * oci-relabel-hook: Use golang to refact oci-relabel-hook
### isulad-tools ### syscontainer-tools
* Add "--force" flag for `isulad-tools add-device` * Add "--force" flag for `syscontainer-tools add-device`
* can not use fdisk to partition when add a device to a container * can not use fdisk to partition when add a device to a container
@ -97,7 +97,7 @@
* device-hook: newly introduced device hook to save config for new added devices. * device-hook: newly introduced device hook to save config for new added devices.
* oci-relabel-hook: use container's SELinux policy to adapt various images. * oci-relabel-hook: use container's SELinux policy to adapt various images.
### isulad-tools ### syscontainer-tools
* use device-hook instead of "isula update" to keep resource persistent in container. * use device-hook instead of "isula update" to keep resource persistent in container.
* add syslog support, all log will be written to syslog. * add syslog support, all log will be written to syslog.
@ -119,7 +119,7 @@ This is first initial release with lots of new features:
* network-hook: move network interface from host to container when container starts. * network-hook: move network interface from host to container when container starts.
* oci-relabel-hook: relabel container's rootfs when container starts. * oci-relabel-hook: relabel container's rootfs when container starts.
### isulad-tools ### syscontainer-tools
New Commands: New Commands:

View File

@ -1,5 +1,5 @@
# Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. # Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
# isulad-tools is licensed under the Mulan PSL v1. # syscontainer-tools is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1. # You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at: # You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL # http://license.coscl.org.cn/MulanPSL
@ -7,7 +7,7 @@
# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR # IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
# PURPOSE. # PURPOSE.
# See the Mulan PSL v1 for more details. # See the Mulan PSL v1 for more details.
# Description: makefile for isulad-tools # Description: makefile for syscontainer-tools
# Author: zhangwei # Author: zhangwei
# Create: 2018-01-18 # Create: 2018-01-18
@ -17,29 +17,29 @@ DEPS_LINK := $(CURDIR)/vendor/
TAGS="cgo static_build" TAGS="cgo static_build"
VERSION := $(shell cat ./VERSION) VERSION := $(shell cat ./VERSION)
BEP_DIR=/tmp/isulad-tools-build-bep BEP_DIR=/tmp/syscontainer-tools-build-bep
BEP_FLAGS=-tmpdir=/tmp/isulad-tools-build-bep BEP_FLAGS=-tmpdir=/tmp/syscontainer-tools-build-bep
GO_LDFLAGS="-s -w -buildid=IdByiSula -extldflags=-zrelro -extldflags=-znow $(BEP_FLAGS) -X main.gitCommit=${COMMIT} -X main.version=${VERSION}" GO_LDFLAGS="-s -w -buildid=IdByiSula -extldflags=-zrelro -extldflags=-znow $(BEP_FLAGS) -X main.gitCommit=${COMMIT} -X main.version=${VERSION}"
ENV = GOPATH=${GOPATH} CGO_ENABLED=1 ENV = GOPATH=${GOPATH} CGO_ENABLED=1
## PLEASE be noticed that the vendor dir can only work with golang > 1.6 !! ## PLEASE be noticed that the vendor dir can only work with golang > 1.6 !!
all: dep isulad-tools isulad-hooks all: dep syscontainer-tools syscontainer-hooks
dep: dep:
mkdir -p $(BEP_DIR) mkdir -p $(BEP_DIR)
init: init:
sh -x apply-patch sh -x apply-patch
isulad-tools: $(SOURCES) | $(DEPS_LINK) syscontainer-tools: $(SOURCES) | $(DEPS_LINK)
@echo "Making isulad-tools..." @echo "Making syscontainer-tools..."
${ENV} go build -mod=vendor -tags ${TAGS} -ldflags ${GO_LDFLAGS} -o build/isulad-tools . ${ENV} go build -mod=vendor -tags ${TAGS} -ldflags ${GO_LDFLAGS} -o build/syscontainer-tools .
@echo "Done!" @echo "Done!"
isulad-hooks: $(SOURCES) | $(DEPS_LINK) syscontainer-hooks: $(SOURCES) | $(DEPS_LINK)
@echo "Making isulad-hooks..." @echo "Making syscontainer-hooks..."
${ENV} go build -mod=vendor -tags ${TAGS} -ldflags ${GO_LDFLAGS} -o build/isulad-hooks ./hooks/isulad-hooks ${ENV} go build -mod=vendor -tags ${TAGS} -ldflags ${GO_LDFLAGS} -o build/syscontainer-hooks ./hooks/syscontainer-hooks
@echo "Done!" @echo "Done!"
localtest: localtest:

View File

@ -1,38 +1,38 @@
# isulad-tools # syscontainer-tools
## Introduction ## Introduction
**isulad-tools** is a fully customized tool, **syscontainer-tools** is a fully customized tool,
it is a small auxiliary tool which is expected to work with isulad with hook support, it is a small auxiliary tool which is expected to work with isulad with hook support,
and provides enhanced functions which is inappropriate to be included in isulad itself. and provides enhanced functions which is inappropriate to be included in isulad itself.
The project includes two main parts: `isulad-tools` and `hooks`. The project includes two main parts: `syscontainer-tools` and `hooks`.
`isulad-tools` is used for dynamically operating on running containers, `syscontainer-tools` is used for dynamically operating on running containers,
and `hooks` is used for executing user defined program at some special timepoint of container's lifecycle. and `hooks` is used for executing user defined program at some special timepoint of container's lifecycle.
## Hooks ## Hooks
We provide isulad hooks function. We provide syscontainer hooks function.
* isulad-hooks: * syscontainer-hooks:
1. insert block devices added by isulad-tools into container when container restarts(prestart state). 1. insert block devices added by syscontainer-tools into container when container restarts(prestart state).
2. insert network interfaces and route rules added by isulad-tools into container when container restarts(prestart state). 2. insert network interfaces and route rules added by syscontainer-tools into container when container restarts(prestart state).
3. remove udev rules and leaking network interfaces when container stops(post-stop state). 3. remove udev rules and leaking network interfaces when container stops(post-stop state).
4. handling oci relabel for container in prestart and post stop state. 4. handling oci relabel for container in prestart and post stop state.
You could use hook spec to customise your hooks. You could use hook spec to customise your hooks.
For detailed information, See [introduction of isulad-hooks](hooks/isulad-hooks/README.md) For detailed information, See [introduction of syscontainer-hooks](hooks/syscontainer-hooks/README.md)
## isulad-tools ## syscontainer-tools
Basic usage of `isulad-tools`: Basic usage of `syscontainer-tools`:
``` ```
NAME: NAME:
isulad-tools - Enhanced tools for IT isulad syscontainer-tools - Enhanced tools for IT isulad
USAGE: USAGE:
isulad-tools [global options] command [command options] [arguments...] syscontainer-tools [global options] command [command options] [arguments...]
VERSION: VERSION:
v0.9 v0.9
@ -58,7 +58,7 @@ GLOBAL OPTIONS:
--version, -v print the version --version, -v print the version
``` ```
For usage of each command, you can check with `--help`, e.g. `isulad-tools add-device --help` For usage of each command, you can check with `--help`, e.g. `syscontainer-tools add-device --help`
## Contributions ## Contributions

View File

@ -1,5 +1,5 @@
# Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. # Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
# isulad-tools is licensed under the Mulan PSL v1. # syscontainer-tools is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1. # You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at: # You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL # http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -23,14 +23,14 @@ import (
"strings" "strings"
"sync" "sync"
"isula.org/isulad-tools/container" "isula.org/syscontainer-tools/container"
"isula.org/isulad-tools/types" "isula.org/syscontainer-tools/types"
) )
const ( const (
defaultConfigFile = "device_hook.json" defaultConfigFile = "device_hook.json"
// IsuladToolsDir is isulad-tools run dir // IsuladToolsDir is syscontainer-tools run dir
IsuladToolsDir = "/run/isulad-tools" IsuladToolsDir = "/run/syscontainer-tools"
) )
// QosType defines the qos type by int // QosType defines the qos type by int

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -19,7 +19,7 @@ import (
"os" "os"
"strings" "strings"
"isula.org/isulad-tools/types" "isula.org/syscontainer-tools/types"
) )
// HostMapping host path mapping to container path // HostMapping host path mapping to container path
@ -209,7 +209,7 @@ func (config *ContainerHookConfig) addBind(bind *types.Bind) (bool, error) {
} }
func (config *ContainerHookConfig) removeBind(bind *types.Bind) (bool, error) { func (config *ContainerHookConfig) removeBind(bind *types.Bind) (bool, error) {
// if in add array, remove it, will not restore to Rm array, as it is added by isulad-tools. // if in add array, remove it, will not restore to Rm array, as it is added by syscontainer-tools.
if index := config.bindIndexInArray(bind, config.Binds); index != -1 { if index := config.bindIndexInArray(bind, config.Binds); index != -1 {
config.dirty = true config.dirty = true
config.Binds = append(config.Binds[:index], config.Binds[index+1:]...) config.Binds = append(config.Binds[:index], config.Binds[index+1:]...)

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -15,12 +15,12 @@ package config
import ( import (
"fmt" "fmt"
"isula.org/isulad-tools/types" "isula.org/syscontainer-tools/types"
"path/filepath" "path/filepath"
) )
var ( var (
// IsuladToolsDirNetns is isulad-tools netns dir // IsuladToolsDirNetns is syscontainer-tools netns dir
IsuladToolsDirNetns = filepath.Join(IsuladToolsDir, "netns") IsuladToolsDirNetns = filepath.Join(IsuladToolsDir, "netns")
) )
@ -95,7 +95,7 @@ func (config *ContainerHookConfig) UpdateNetworkInterface(nic *types.InterfaceCo
return nil return nil
} }
// IsRouteExist will check if the route is added by isulad-tools // IsRouteExist will check if the route is added by syscontainer-tools
func (config *ContainerHookConfig) IsRouteExist(route *types.Route) bool { func (config *ContainerHookConfig) IsRouteExist(route *types.Route) bool {
for _, eRoute := range config.NetworkRoutes { for _, eRoute := range config.NetworkRoutes {
if types.IsSameRoute(route, eRoute) { if types.IsSameRoute(route, eRoute) {

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -194,7 +194,7 @@ func getIsuladContainerSpec(id string) (spec *specs.Spec, err error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
configPath := fmt.Sprintf("%s/engines/lcr/%s/ociconfig.json", graphDriverPath, id) configPath := fmt.Sprintf("%s/engines/lcr/%s/config.json", graphDriverPath, id)
config, err := os.Open(configPath) config, err := os.Open(configPath)
if err != nil { if err != nil {
if os.IsNotExist(err) { if os.IsNotExist(err) {

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -20,10 +20,10 @@ import (
"fmt" "fmt"
"os" "os"
hconfig "isula.org/isulad-tools/config" hconfig "isula.org/syscontainer-tools/config"
"isula.org/isulad-tools/container" "isula.org/syscontainer-tools/container"
"isula.org/isulad-tools/libdevice" "isula.org/syscontainer-tools/libdevice"
"isula.org/isulad-tools/types" "isula.org/syscontainer-tools/types"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/urfave/cli" "github.com/urfave/cli"

2
go.mod
View File

@ -1,4 +1,4 @@
module isula.org/isulad-tools module isula.org/syscontainer-tools
replace ( replace (
golang.org/x/crypto => github.com/golang/crypto v0.0.0-20190701094942-4def268fd1a4 golang.org/x/crypto => github.com/golang/crypto v0.0.0-20190701094942-4def268fd1a4

View File

@ -1,5 +1,5 @@
# Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. # Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
# isulad-tools is licensed under the Mulan PSL v1. # syscontainer-tools is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1. # You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at: # You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL # http://license.coscl.org.cn/MulanPSL
@ -16,10 +16,10 @@
HOOK_DIR=/var/lib/isulad/hooks HOOK_DIR=/var/lib/isulad/hooks
ISULAD_TOOLS_DIR=/usr/local/bin ISULAD_TOOLS_DIR=/usr/local/bin
ISULAD_TOOLS_WRAPPER="/lib/udev" ISULAD_TOOLS_WRAPPER="/lib/udev"
HOOK_SPEC="/etc/isulad-tools" HOOK_SPEC="/etc/syscontainer-tools"
echo "Hooks will be installed to $HOOK_DIR" echo "Hooks will be installed to $HOOK_DIR"
echo "isulad_tools will be installed to $ISULAD_TOOLS_DIR" echo "syscontainer_tools will be installed to $ISULAD_TOOLS_DIR"
mkdir -p -m 0700 ${HOOK_DIR} mkdir -p -m 0700 ${HOOK_DIR}
mkdir -p -m 0750 ${ISULAD_TOOLS_DIR} mkdir -p -m 0750 ${ISULAD_TOOLS_DIR}
@ -27,29 +27,29 @@ mkdir -p -m 0750 ${ISULAD_TOOLS_WRAPPER}
mkdir -p -m 0750 ${HOOK_SPEC} mkdir -p -m 0750 ${HOOK_SPEC}
install -m 0755 -p ../build/*-hooks ${HOOK_DIR} install -m 0755 -p ../build/*-hooks ${HOOK_DIR}
install -m 0755 -p ../build/isulad-tools ${ISULAD_TOOLS_DIR} install -m 0755 -p ../build/syscontainer-tools ${ISULAD_TOOLS_DIR}
install -m 0750 isulad-tools_wrapper ${ISULAD_TOOLS_WRAPPER}/isulad-tools_wrapper install -m 0750 syscontainer-tools_wrapper ${ISULAD_TOOLS_WRAPPER}/syscontainer-tools_wrapper
cat << EOF > ${HOOK_SPEC}/hookspec.json cat << EOF > ${HOOK_SPEC}/hookspec.json
{ {
"prestart": [ "prestart": [
{ {
"path": "${HOOK_DIR}/isulad-hooks", "path": "${HOOK_DIR}/syscontainer-hooks",
"args": ["isulad-hooks", "--state", "prestart"], "args": ["syscontainer-hooks", "--state", "prestart"],
"env": [] "env": []
} }
], ],
"poststart":[ "poststart":[
{ {
"path": "${HOOK_DIR}/isulad-hooks", "path": "${HOOK_DIR}/syscontainer-hooks",
"args": ["isulad-hooks", "--state", "poststart"], "args": ["syscontainer-hooks", "--state", "poststart"],
"env": [] "env": []
} }
], ],
"poststop":[ "poststop":[
{ {
"path": "${HOOK_DIR}/isulad-hooks", "path": "${HOOK_DIR}/syscontainer-hooks",
"args": ["isulad-hooks", "--state", "poststop"], "args": ["syscontainer-hooks", "--state", "poststop"],
"env": [] "env": []
} }
] ]

View File

@ -2,12 +2,12 @@
%define debug_package %{nil} %define debug_package %{nil}
#Basic Information #Basic Information
Name: isulad-tools Name: syscontainer-tools
Version: v0.9 Version: v0.9
Release: 34 Release: 35
Summary: isulad tools for IT, work with iSulad Summary: syscontainer tools for IT, work with iSulad
License: Mulan PSL v1 License: Mulan PSL v1
URL: https://gitee.com/src-openeuler/iSulad-tools URL: https://gitee.com/src-openeuler/syscontainer-tools
Source0: %{name}-src.tar.gz Source0: %{name}-src.tar.gz
BuildRoot: %{_tmppath}/%{name}-root BuildRoot: %{_tmppath}/%{name}-root
@ -18,11 +18,11 @@ Requires: iSulad
Requires: util-linux Requires: util-linux
%description %description
This is isulad tools, to make it work, you need a isulad and util-linux This is syscontainer tools, to make it work, you need a isulad and util-linux
#Build sections #Build sections
%prep %prep
%setup -q -c -n src/isula.org/isulad-tools %setup -q -c -n src/isula.org/syscontainer-tools
%build %build
make init && make make init && make
@ -36,9 +36,9 @@ mkdir -p -m 0700 ${HOOK_DIR}
mkdir -p -m 0750 ${ISULAD_TOOLS_DIR} mkdir -p -m 0750 ${ISULAD_TOOLS_DIR}
mkdir -p -m 0750 ${ISULAD_TOOLS_WRAPPER} mkdir -p -m 0750 ${ISULAD_TOOLS_WRAPPER}
install -m 0750 build/isulad-hooks ${HOOK_DIR} install -m 0750 build/syscontainer-hooks ${HOOK_DIR}
install -m 0750 build/isulad-tools ${ISULAD_TOOLS_DIR} install -m 0750 build/syscontainer-tools ${ISULAD_TOOLS_DIR}
install -m 0750 hack/isulad-tools_wrapper ${ISULAD_TOOLS_WRAPPER}/isulad-tools_wrapper install -m 0750 hack/syscontainer-tools_wrapper ${ISULAD_TOOLS_WRAPPER}/syscontainer-tools_wrapper
#Install and uninstall scripts #Install and uninstall scripts
%pre %pre
@ -53,15 +53,15 @@ fi
if [[ "$GRAPH" != "/var/lib/isulad" ]]; then if [[ "$GRAPH" != "/var/lib/isulad" ]]; then
mkdir -p -m 0550 $GRAPH/hooks mkdir -p -m 0550 $GRAPH/hooks
install -m 0550 -p /var/lib/isulad/hooks/isulad-hooks $GRAPH/hooks install -m 0550 -p /var/lib/isulad/hooks/syscontainer-hooks $GRAPH/hooks
echo echo
echo "=================== WARNING! ================================================" echo "=================== WARNING! ================================================"
echo " 'iSulad Root Dir' is $GRAPH, move /var/lib/isulad/hooks/isulad-hooks to $GRAPH/hooks" echo " 'iSulad Root Dir' is $GRAPH, move /var/lib/isulad/hooks/syscontainer-hooks to $GRAPH/hooks"
echo "=============================================================================" echo "============================================================================="
echo echo
fi fi
HOOK_SPEC=/etc/isulad-tools HOOK_SPEC=/etc/syscontainer-tools
HOOK_DIR=${GRAPH}/hooks HOOK_DIR=${GRAPH}/hooks
mkdir -p -m 0750 ${HOOK_SPEC} mkdir -p -m 0750 ${HOOK_SPEC}
mkdir -p -m 0550 ${HOOK_DIR} mkdir -p -m 0550 ${HOOK_DIR}
@ -69,22 +69,22 @@ cat << EOF > ${HOOK_SPEC}/hookspec.json
{ {
"prestart": [ "prestart": [
{ {
"path": "${HOOK_DIR}/isulad-hooks", "path": "${HOOK_DIR}/syscontainer-hooks",
"args": ["isulad-hooks", "--state", "prestart"], "args": ["syscontainer-hooks", "--state", "prestart"],
"env": [] "env": []
} }
], ],
"poststart":[ "poststart":[
{ {
"path": "${HOOK_DIR}/isulad-hooks", "path": "${HOOK_DIR}/syscontainer-hooks",
"args": ["isulad-hooks", "--state", "poststart"], "args": ["syscontainer-hooks", "--state", "poststart"],
"env": [] "env": []
} }
], ],
"poststop":[ "poststop":[
{ {
"path": "${HOOK_DIR}/isulad-hooks", "path": "${HOOK_DIR}/syscontainer-hooks",
"args": ["isulad-hooks", "--state", "poststop"], "args": ["syscontainer-hooks", "--state", "poststop"],
"env": [] "env": []
} }
] ]
@ -97,10 +97,10 @@ chmod 0640 ${HOOK_SPEC}/hookspec.json
#Files list #Files list
%files %files
%defattr(0550,root,root,0550) %defattr(0550,root,root,0550)
/usr/local/bin/isulad-tools /usr/local/bin/syscontainer-tools
%attr(0550,root,root) /var/lib/isulad/hooks %attr(0550,root,root) /var/lib/isulad/hooks
%attr(0550,root,root) /var/lib/isulad/hooks/isulad-hooks %attr(0550,root,root) /var/lib/isulad/hooks/syscontainer-hooks
%attr(0550,root,root) /lib/udev/isulad-tools_wrapper %attr(0550,root,root) /lib/udev/syscontainer-tools_wrapper
#Clean section #Clean section
@ -108,6 +108,12 @@ chmod 0640 ${HOOK_SPEC}/hookspec.json
rm -rfv %{buildroot} rm -rfv %{buildroot}
%changelog %changelog
* Tue Jan 07 2020 Zhangsong<zhangsong34@huawei.com> - 0.9.35
- Type:enhancement
- ID:NA
- SUG:restart
- DESC:update package
* Tue Dec 26 2019 Zhangsong<zhangsong34@huawei.com> - 0.9.34 * Tue Dec 26 2019 Zhangsong<zhangsong34@huawei.com> - 0.9.34
- Type:enhancement - Type:enhancement
- ID:NA - ID:NA
@ -124,7 +130,7 @@ rm -rfv %{buildroot}
- Type:enhancement - Type:enhancement
- ID:NA - ID:NA
- SUG:restart - SUG:restart
- DESC:rebuild patches for isulad-tools - DESC:rebuild patches for syscontainer-tools
* Fri Nov 02 2018 Zhangsong<zhangsong34@huawei.com> - 0.9.7-1 * Fri Nov 02 2018 Zhangsong<zhangsong34@huawei.com> - 0.9.7-1
- Type:enhancement - Type:enhancement

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. # Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
# isulad-tools is licensed under the Mulan PSL v1. # syscontainer-tools is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1. # You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at: # You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL # http://license.coscl.org.cn/MulanPSL
@ -8,12 +8,12 @@
# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR # IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
# PURPOSE. # PURPOSE.
# See the Mulan PSL v1 for more details. # See the Mulan PSL v1 for more details.
# Description: isulad tools wrapper # Description: syscontainer tools wrapper
# Author: zhangwei # Author: zhangsong234
# Create: 2018-01-18 # Create: 2020-01-17
LOG_DIR=/var/log/hyperagent LOG_DIR=/var/log/hyperagent
LOG_FILE=${LOG_DIR}/isulad-tools.log LOG_FILE=${LOG_DIR}/syscontainer-tools.log
## by default, isulad is installed in /usr/bin, ## by default, isulad is installed in /usr/bin,
## but udevd do not have this path in PATH env ## but udevd do not have this path in PATH env
@ -25,10 +25,10 @@ run_cmd() {
$@ $@
} }
add_node() { add_node() {
run_cmd isulad-tools --log $LOG_FILE add-device $id /dev/$o_dev:$devname run_cmd syscontainer-tools --log $LOG_FILE add-device $id /dev/$o_dev:$devname
} }
remove_node() { remove_node() {
run_cmd isulad-tools --log $LOG_FILE remove-device $id /dev/$o_dev:$devname run_cmd syscontainer-tools --log $LOG_FILE remove-device $id /dev/$o_dev:$devname
} }

View File

@ -1,23 +0,0 @@
{
"prestart": [
{
"path": "/var/lib/isulad/hooks/isulad-hooks",
"args": ["isulad-hooks", "--state", "prestart", "--log", "/var/log/device-hook.log"],
"env": []
}
],
"poststart":[
{
"path": "/var/lib/isulad/hooks/isulad-hooks",
"args": ["isulad-hooks", "--state", "prestart", "--log", "/var/log/device-hook.log"],
"env": []
}
],
"poststop":[
{
"path": "/var/lib/isulad/hooks/isulad-hooks",
"args": ["isulad-hooks", "--state", "poststop", "--log", "/var/log/device-hook.log"],
"env": []
}
]
}

View File

@ -1,16 +1,16 @@
# isulad-hooks # syscontainer-hooks
This is a simple custom isulad hook for our own need, This is a simple custom syscontainer hook for our own need,
it interacts with isulad as a multifunctional hook. it interacts with isulad as a multifunctional hook.
1. allow user to add your own devices or binds into the container and update device Qos for container(device hook in prestart state). 1. allow user to add your own devices or binds into the container and update device Qos for container(device hook in prestart state).
2. allow user to remove udev rule which added by isulad-tools when container is exiting(device hook in post-stop state). 2. allow user to remove udev rule which added by syscontainer-tools when container is exiting(device hook in post-stop state).
3. allow user to add network interface and route rule to container(network hook in prestart state). 3. allow user to add network interface and route rule to container(network hook in prestart state).
4. allow user to remove network interface on host when container is exiting(network hook in post-stop state). 4. allow user to remove network interface on host when container is exiting(network hook in post-stop state).
5. allow user to do oci relabel for container in both prestart and post-stop state for container. 5. allow user to do oci relabel for container in both prestart and post-stop state for container.
Actually, this hook only handles the container restart process, we use isulad-tools to Actually, this hook only handles the container restart process, we use syscontainer-tools to
add device/binds/network interface/route rule to container. And isulad-tools will save the device/network config to disk. add device/binds/network interface/route rule to container. And syscontainer-tools will save the device/network config to disk.
And the hook will make sure the resources you added to container will be persistent after restart. And the hook will make sure the resources you added to container will be persistent after restart.
Rename it to your favourite name afterwards. Rename it to your favourite name afterwards.
@ -30,15 +30,15 @@ it's not a mandatory step, make your own choice for your convenience :)
## customise hook service ## customise hook service
We could use `isulad-hooks` to customise the hook service. We could use `syscontainer-hooks` to customise the hook service.
``` ```
Usage of isulad-hooks: Usage of syscontainer-hooks:
-log string -log string
set output log file set output log file
-state string -state string
set isulad hook state mode: prestart or poststop set syscontainer hook state mode: prestart or poststop
-with-relabel -with-relabel
isulad hook enable oci relabel hook function syscontainer hook enable oci relabel hook function
``` ```
As block device and network interface are both in our requirement, so these two function are mandantory. As block device and network interface are both in our requirement, so these two function are mandantory.
@ -46,7 +46,7 @@ We could use `--with-relabel=true` to add oci-relabel hook service for container
We could use `--state` to specify which state the hook will be running in. We could use `--state` to specify which state the hook will be running in.
Full hook config: Full hook config:
[hook spec example of isulad-hooks](hooks/isulad-hooks/example/hookspec.json) [hook spec example of syscontainer-hooks](hooks/syscontainer-hooks/example/hookspec.json)
## Try it! ## Try it!
@ -58,10 +58,10 @@ after that, you can run it like this:
``` ```
$ isula run -d --name test_device --hook-spec $PWD/example/hookspec.json busybox sleep 20000 $ isula run -d --name test_device --hook-spec $PWD/example/hookspec.json busybox sleep 20000
``` ```
2.use isulad-tools to add device or binds to container 2.use syscontainer-tools to add device or binds to container
``` ```
isulad-tools add-device test_device /dev/zero:/dev/test_zero:rwm /dev/zero:/dev/test_zero2:rwm syscontainer-tools add-device test_device /dev/zero:/dev/test_zero:rwm /dev/zero:/dev/test_zero2:rwm
``` ```
3.restart the container. to check the device is still in container. 3.restart the container. to check the device is still in container.

View File

@ -0,0 +1,23 @@
{
"prestart": [
{
"path": "/var/lib/isulad/hooks/syscontainer-hooks",
"args": ["syscontainer-hooks", "--state", "prestart", "--log", "/var/log/device-hook.log"],
"env": []
}
],
"poststart":[
{
"path": "/var/lib/isulad/hooks/syscontainer-hooks",
"args": ["syscontainer-hooks", "--state", "prestart", "--log", "/var/log/device-hook.log"],
"env": []
}
],
"poststop":[
{
"path": "/var/lib/isulad/hooks/syscontainer-hooks",
"args": ["syscontainer-hooks", "--state", "poststop", "--log", "/var/log/device-hook.log"],
"env": []
}
]
}

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -7,7 +7,7 @@
// IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR // IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
// PURPOSE. // PURPOSE.
// See the Mulan PSL v1 for more details. // See the Mulan PSL v1 for more details.
// Description: isulad hook main function // Description: syscontainer hook main function
// Author: zhangwei // Author: zhangwei
// Create: 2018-01-18 // Create: 2018-01-18
@ -27,15 +27,15 @@ import (
_ "github.com/opencontainers/runc/libcontainer/nsenter" _ "github.com/opencontainers/runc/libcontainer/nsenter"
"github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/runtime-spec/specs-go"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
hconfig "isula.org/isulad-tools/config" hconfig "isula.org/syscontainer-tools/config"
"isula.org/isulad-tools/container" "isula.org/syscontainer-tools/container"
"isula.org/isulad-tools/utils" "isula.org/syscontainer-tools/utils"
) )
var ( var (
defaultHookConfigFile = "device_hook.json" defaultHookConfigFile = "device_hook.json"
syslogTag = "hook " syslogTag = "hook "
bundleConfigFile = "ociconfig.json" bundleConfigFile = "config.json"
) )
type hookData struct { type hookData struct {
@ -140,7 +140,7 @@ func prepareHookData() (*hookData, error) {
func main() { func main() {
if reexec.Init() { if reexec.Init() {
// `reexec routine` was registered in isulad-tools/libdevice // `reexec routine` was registered in syscontainer-tools/libdevice
// Sub nsenter process will come here. // Sub nsenter process will come here.
// Isulad reexec package do not handle errors. // Isulad reexec package do not handle errors.
// And sub device-hook nsenter init process will send back the error message to parenet through pipe. // And sub device-hook nsenter init process will send back the error message to parenet through pipe.
@ -150,9 +150,9 @@ func main() {
signal.Ignore(syscall.SIGINT, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM) signal.Ignore(syscall.SIGINT, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM)
flLogfile := flag.String("log", "", "set output log file") flLogfile := flag.String("log", "", "set output log file")
flMode := flag.String("state", "", "set isulad hook state mode: prestart or poststop") flMode := flag.String("state", "", "set syscontainer hook state mode: prestart or poststop")
// No requirements at present, by default don't enable this function. // No requirements at present, by default don't enable this function.
flWithRelabel := flag.Bool("with-relabel", false, "isulad hook enable oci relabel hook function") flWithRelabel := flag.Bool("with-relabel", false, "syscontainer hook enable oci relabel hook function")
flag.Parse() flag.Parse()
@ -163,7 +163,7 @@ func main() {
} }
if err := os.MkdirAll(hconfig.IsuladToolsDir, 0666); err != nil { if err := os.MkdirAll(hconfig.IsuladToolsDir, 0666); err != nil {
logrus.Errorf("failed to set isulad-tools dir: %v", err) logrus.Errorf("failed to set syscontainer-tools dir: %v", err)
} }
switch *flMode { switch *flMode {

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -20,12 +20,12 @@ import (
"path/filepath" "path/filepath"
"github.com/opencontainers/runc/libcontainer/configs" "github.com/opencontainers/runc/libcontainer/configs"
hconfig "isula.org/isulad-tools/config" hconfig "isula.org/syscontainer-tools/config"
"isula.org/isulad-tools/libdevice" "isula.org/syscontainer-tools/libdevice"
"isula.org/isulad-tools/libnetwork" "isula.org/syscontainer-tools/libnetwork"
"isula.org/isulad-tools/pkg/udevd" "isula.org/syscontainer-tools/pkg/udevd"
"isula.org/isulad-tools/types" "isula.org/syscontainer-tools/types"
"isula.org/isulad-tools/utils" "isula.org/syscontainer-tools/utils"
"github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/runtime-spec/specs-go"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -28,13 +28,13 @@ import (
"github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/runtime-spec/specs-go"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
hconfig "isula.org/isulad-tools/config" hconfig "isula.org/syscontainer-tools/config"
"isula.org/isulad-tools/libdevice" "isula.org/syscontainer-tools/libdevice"
"isula.org/isulad-tools/libdevice/nsexec" "isula.org/syscontainer-tools/libdevice/nsexec"
"isula.org/isulad-tools/libnetwork" "isula.org/syscontainer-tools/libnetwork"
"isula.org/isulad-tools/pkg/udevd" "isula.org/syscontainer-tools/pkg/udevd"
"isula.org/isulad-tools/types" "isula.org/syscontainer-tools/types"
"isula.org/isulad-tools/utils" "isula.org/syscontainer-tools/utils"
) )
const ( const (

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -34,9 +34,9 @@ import (
"github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/runtime-spec/specs-go"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/vishvananda/netlink/nl" "github.com/vishvananda/netlink/nl"
hconfig "isula.org/isulad-tools/config" hconfig "isula.org/syscontainer-tools/config"
"isula.org/isulad-tools/libdevice/nsexec" "isula.org/syscontainer-tools/libdevice/nsexec"
"isula.org/isulad-tools/utils" "isula.org/syscontainer-tools/utils"
) )
var ( var (

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -24,8 +24,8 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/runtime-spec/specs-go"
"isula.org/isulad-tools/types" "isula.org/syscontainer-tools/types"
"isula.org/isulad-tools/utils" "isula.org/syscontainer-tools/utils"
) )
// ParseBind will parse host path to Bind structure // ParseBind will parse host path to Bind structure

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -19,7 +19,7 @@ import (
"path/filepath" "path/filepath"
"github.com/opencontainers/runc/libcontainer/cgroups" "github.com/opencontainers/runc/libcontainer/cgroups"
"isula.org/isulad-tools/types" "isula.org/syscontainer-tools/types"
) )
var ( var (

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -26,10 +26,10 @@ import (
"syscall" "syscall"
"github.com/docker/docker/pkg/reexec" "github.com/docker/docker/pkg/reexec"
"isula.org/isulad-tools/libdevice/nsexec" "isula.org/syscontainer-tools/libdevice/nsexec"
"isula.org/isulad-tools/pkg/mount" "isula.org/syscontainer-tools/pkg/mount"
"isula.org/isulad-tools/types" "isula.org/syscontainer-tools/types"
"isula.org/isulad-tools/utils" "isula.org/syscontainer-tools/utils"
) )
func init() { func init() {

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -24,7 +24,7 @@ import (
"strings" "strings"
"syscall" "syscall"
"isula.org/isulad-tools/types" "isula.org/syscontainer-tools/types"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -22,12 +22,12 @@ import (
"github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/runtime-spec/specs-go"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
hconfig "isula.org/isulad-tools/config" hconfig "isula.org/syscontainer-tools/config"
"isula.org/isulad-tools/container" "isula.org/syscontainer-tools/container"
"isula.org/isulad-tools/libdevice/nsexec" "isula.org/syscontainer-tools/libdevice/nsexec"
"isula.org/isulad-tools/pkg/udevd" "isula.org/syscontainer-tools/pkg/udevd"
"isula.org/isulad-tools/types" "isula.org/syscontainer-tools/types"
"isula.org/isulad-tools/utils" "isula.org/syscontainer-tools/utils"
) )
func checkDevice(config hconfig.ContainerConfig, devs []*types.Device, opts *types.AddDeviceOptions) error { func checkDevice(config hconfig.ContainerConfig, devs []*types.Device, opts *types.AddDeviceOptions) error {
@ -279,7 +279,7 @@ func RemoveDevice(c *container.Container, devices []*types.Device, followPartiti
for _, device := range devices { for _, device := range devices {
newDevice := config.FindDeviceByMapping(device) newDevice := config.FindDeviceByMapping(device)
if newDevice == nil { if newDevice == nil {
errinfo := fmt.Sprint("Device pair(", device.PathOnHost, ":", device.Path, ") is not added by isulad-tools, can not remove it, please check input parameter.") errinfo := fmt.Sprint("Device pair(", device.PathOnHost, ":", device.Path, ") is not added by syscontainer-tools, can not remove it, please check input parameter.")
retErr = append(retErr, errors.New(errinfo)) retErr = append(retErr, errors.New(errinfo))
continue continue
} }
@ -288,7 +288,7 @@ func RemoveDevice(c *container.Container, devices []*types.Device, followPartiti
if followPartition { if followPartition {
subDevices := config.FindSubPartition(newDevice) subDevices := config.FindSubPartition(newDevice)
for _, subDev := range subDevices { for _, subDev := range subDevices {
// check the sub partition is added by isulad-tools // check the sub partition is added by syscontainer-tools
if found := config.FindDeviceByMapping(subDev); found == nil { if found := config.FindDeviceByMapping(subDev); found == nil {
continue continue
} }
@ -474,7 +474,7 @@ func RemovePath(c *container.Container, binds []*types.Bind) error {
} }
if mp == nil { if mp == nil {
errinfo := fmt.Sprint("Path pair(", bind.HostPath, ":", bind.ContainerPath, ") is not added by isulad-tools, can not remove it, please check input parameter") errinfo := fmt.Sprint("Path pair(", bind.HostPath, ":", bind.ContainerPath, ") is not added by syscontainer-tools, can not remove it, please check input parameter")
retErr = append(retErr, errors.New(errinfo)) retErr = append(retErr, errors.New(errinfo))
continue continue
} }

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -17,7 +17,7 @@ import (
"fmt" "fmt"
"os" "os"
"isula.org/isulad-tools/types" "isula.org/syscontainer-tools/types"
) )
var ( var (

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -21,8 +21,8 @@ import (
"os" "os"
"os/exec" "os/exec"
"isula.org/isulad-tools/types" "isula.org/syscontainer-tools/types"
"isula.org/isulad-tools/utils" "isula.org/syscontainer-tools/utils"
"github.com/opencontainers/runc/libcontainer" "github.com/opencontainers/runc/libcontainer"
"github.com/vishvananda/netlink/nl" "github.com/vishvananda/netlink/nl"

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -19,7 +19,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"isula.org/isulad-tools/types" "isula.org/syscontainer-tools/types"
) )
const ( const (

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -16,9 +16,9 @@ package bridge
import ( import (
"os/exec" "os/exec"
"isula.org/isulad-tools/libnetwork/bridge/api" "isula.org/syscontainer-tools/libnetwork/bridge/api"
"isula.org/isulad-tools/libnetwork/bridge/linux" "isula.org/syscontainer-tools/libnetwork/bridge/linux"
"isula.org/isulad-tools/libnetwork/bridge/ovs" "isula.org/syscontainer-tools/libnetwork/bridge/ovs"
) )
var supportedDrivers map[string]api.BridgeDriver = make(map[string]api.BridgeDriver) var supportedDrivers map[string]api.BridgeDriver = make(map[string]api.BridgeDriver)

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -16,7 +16,7 @@ package linux
import ( import (
"fmt" "fmt"
"isula.org/isulad-tools/libnetwork/bridge/api" "isula.org/syscontainer-tools/libnetwork/bridge/api"
"github.com/vishvananda/netlink" "github.com/vishvananda/netlink"
) )

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -18,7 +18,7 @@ import (
"os/exec" "os/exec"
"github.com/vishvananda/netlink" "github.com/vishvananda/netlink"
"isula.org/isulad-tools/libnetwork/bridge/api" "isula.org/syscontainer-tools/libnetwork/bridge/api"
) )
type ovsBridgeDriver struct { type ovsBridgeDriver struct {

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -16,8 +16,8 @@ package common
import ( import (
"net" "net"
"isula.org/isulad-tools/libnetwork/bridge" "isula.org/syscontainer-tools/libnetwork/bridge"
"isula.org/isulad-tools/libnetwork/bridge/api" "isula.org/syscontainer-tools/libnetwork/bridge/api"
) )
// Driver implement the network driver common options // Driver implement the network driver common options

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -20,9 +20,9 @@ import (
// "github.com/Sirupsen/logrus" // "github.com/Sirupsen/logrus"
"github.com/vishvananda/netlink" "github.com/vishvananda/netlink"
"isula.org/isulad-tools/libnetwork/drivers/common" "isula.org/syscontainer-tools/libnetwork/drivers/common"
"isula.org/isulad-tools/libnetwork/drivers/eth" "isula.org/syscontainer-tools/libnetwork/drivers/eth"
"isula.org/isulad-tools/libnetwork/drivers/veth" "isula.org/syscontainer-tools/libnetwork/drivers/veth"
) )
var ( var (

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -22,9 +22,9 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/vishvananda/netlink" "github.com/vishvananda/netlink"
"isula.org/isulad-tools/libnetwork/drivers/common" "isula.org/syscontainer-tools/libnetwork/drivers/common"
"isula.org/isulad-tools/libnetwork/nsutils" "isula.org/syscontainer-tools/libnetwork/nsutils"
"isula.org/isulad-tools/pkg/ethtool" "isula.org/syscontainer-tools/pkg/ethtool"
) )
type ethDriver struct { type ethDriver struct {

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -22,9 +22,9 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/vishvananda/netlink" "github.com/vishvananda/netlink"
"isula.org/isulad-tools/libnetwork/drivers/common" "isula.org/syscontainer-tools/libnetwork/drivers/common"
"isula.org/isulad-tools/libnetwork/nsutils" "isula.org/syscontainer-tools/libnetwork/nsutils"
"isula.org/isulad-tools/pkg/ethtool" "isula.org/syscontainer-tools/pkg/ethtool"
) )
type vethDriver struct { type vethDriver struct {
@ -96,7 +96,7 @@ func (d *vethDriver) DeleteIf() error {
veth, err := netlink.LinkByName(d.GetHostNicName()) veth, err := netlink.LinkByName(d.GetHostNicName())
if err != nil { if err != nil {
// As add-nic supports 'update-config-only' option, // As add-nic supports 'update-config-only' option,
// With this flag, isulad-tools will update config only, don't add device to container. // With this flag, syscontainer-tools will update config only, don't add device to container.
// So if device dose not exist on host, ignore it. // So if device dose not exist on host, ignore it.
if strings.Contains(err.Error(), "Link not found") { if strings.Contains(err.Error(), "Link not found") {
return nil return nil

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -19,10 +19,10 @@ import (
"strings" "strings"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
hconfig "isula.org/isulad-tools/config" hconfig "isula.org/syscontainer-tools/config"
"isula.org/isulad-tools/container" "isula.org/syscontainer-tools/container"
"isula.org/isulad-tools/libnetwork/drivers" "isula.org/syscontainer-tools/libnetwork/drivers"
"isula.org/isulad-tools/types" "isula.org/syscontainer-tools/types"
) )
// AddNic will add a network interface to container, it will update the config for container // AddNic will add a network interface to container, it will update the config for container

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -21,10 +21,10 @@ import (
"strings" "strings"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
hconfig "isula.org/isulad-tools/config" hconfig "isula.org/syscontainer-tools/config"
"isula.org/isulad-tools/container" "isula.org/syscontainer-tools/container"
"isula.org/isulad-tools/libnetwork/nsutils" "isula.org/syscontainer-tools/libnetwork/nsutils"
"isula.org/isulad-tools/types" "isula.org/syscontainer-tools/types"
"github.com/vishvananda/netlink" "github.com/vishvananda/netlink"
) )
@ -140,7 +140,7 @@ func DelRoutes(ctr *container.Container, routes []*types.Route, updateConfigOnly
var retErr []error var retErr []error
for _, r := range routes { for _, r := range routes {
if exist := hConfig.IsRouteExist(r); !exist { if exist := hConfig.IsRouteExist(r); !exist {
errinfo := fmt.Sprint("Route(", r, ") is not added by isulad-tools, can not remove it, please check input parameter.") errinfo := fmt.Sprint("Route(", r, ") is not added by syscontainer-tools, can not remove it, please check input parameter.")
retErr = append(retErr, errors.New(errinfo)) retErr = append(retErr, errors.New(errinfo))
continue continue
} }

14
main.go
View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -22,8 +22,8 @@ import (
"syscall" "syscall"
"github.com/docker/docker/pkg/reexec" "github.com/docker/docker/pkg/reexec"
"isula.org/isulad-tools/config" "isula.org/syscontainer-tools/config"
"isula.org/isulad-tools/utils" "isula.org/syscontainer-tools/utils"
_ "github.com/opencontainers/runc/libcontainer/nsenter" _ "github.com/opencontainers/runc/libcontainer/nsenter"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
@ -55,7 +55,7 @@ func fatalf(t string, v ...interface{}) {
func mainWork() { func mainWork() {
app := cli.NewApp() app := cli.NewApp()
app.Name = "isulad-tools" app.Name = "syscontainer-tools"
app.Usage = usage app.Usage = usage
v := []string{ v := []string{
version, version,
@ -111,7 +111,7 @@ func mainWork() {
app.Before = func(context *cli.Context) error { app.Before = func(context *cli.Context) error {
if err := os.MkdirAll(config.IsuladToolsDir, 0666); err != nil { if err := os.MkdirAll(config.IsuladToolsDir, 0666); err != nil {
logrus.Errorf("failed to set isulad-tools dir: %v", err) logrus.Errorf("failed to set syscontainer-tools dir: %v", err)
} }
if logpath := context.GlobalString("log"); logpath != "" { if logpath := context.GlobalString("log"); logpath != "" {
@ -155,10 +155,10 @@ func mainWork() {
} }
func main() { func main() {
if reexec.Init() { if reexec.Init() {
// `reexec routine` was registered in isulad-tools/libdevice // `reexec routine` was registered in syscontainer-tools/libdevice
// Sub nsenter process will come here. // Sub nsenter process will come here.
// Isulad reexec package do not handle errors. // Isulad reexec package do not handle errors.
// And sub isulad-tools nsenter init process will send back the error message to parenet through pipe. // And sub syscontainer-tools nsenter init process will send back the error message to parenet through pipe.
// So here do not need to handle errors. // So here do not need to handle errors.
return return
} }

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -24,9 +24,9 @@ import (
"github.com/docker/libnetwork/netutils" "github.com/docker/libnetwork/netutils"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"isula.org/isulad-tools/container" "isula.org/syscontainer-tools/container"
"isula.org/isulad-tools/libnetwork" "isula.org/syscontainer-tools/libnetwork"
"isula.org/isulad-tools/types" "isula.org/syscontainer-tools/types"
) )
var addNicCommand = cli.Command{ var addNicCommand = cli.Command{

View File

@ -1,6 +1,6 @@
/****************************************************************************** /******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved.
* isulad-tools is licensed under the Mulan PSL v1. * syscontainer-tools is licensed under the Mulan PSL v1.
* You can use this software according to the terms and conditions of the Mulan PSL v1. * You can use this software according to the terms and conditions of the Mulan PSL v1.
* You may obtain a copy of Mulan PSL v1 at: * You may obtain a copy of Mulan PSL v1 at:
* http://license.coscl.org.cn/MulanPSL * http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL

View File

@ -1,6 +1,6 @@
/****************************************************************************** /******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved. * Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved.
* isulad-tools is licensed under the Mulan PSL v1. * syscontainer-tools is licensed under the Mulan PSL v1.
* You can use this software according to the terms and conditions of the Mulan PSL v1. * You can use this software according to the terms and conditions of the Mulan PSL v1.
* You may obtain a copy of Mulan PSL v1 at: * You may obtain a copy of Mulan PSL v1 at:
* http://license.coscl.org.cn/MulanPSL * http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -42,7 +42,7 @@ func saveRules(path string, rules []*Rule) error {
return err return err
} }
f.WriteString("## This File is auto-generated by isulad-tools.\n") f.WriteString("## This File is auto-generated by syscontainer-tools.\n")
f.WriteString("## DO NOT EDIT IT\n\n") f.WriteString("## DO NOT EDIT IT\n\n")
for _, r := range rules { for _, r := range rules {
if _, err := f.WriteString(fmt.Sprintf("%s\n", r.ToUdevRuleString())); err != nil { if _, err := f.WriteString(fmt.Sprintf("%s\n", r.ToUdevRuleString())); err != nil {

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -18,14 +18,14 @@ import (
"os" "os"
"path/filepath" "path/filepath"
hconfig "isula.org/isulad-tools/config" hconfig "isula.org/syscontainer-tools/config"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )
var ( var (
programe = "/lib/udev/isulad-tools_wrapper" programe = "/lib/udev/syscontainer-tools_wrapper"
lockFile = "udevd_config_locker" lockFile = "udevd_config_locker"
configPath = "/etc/udev/rules.d/99-isulad-tools.rules" configPath = "/etc/udev/rules.d/99-syscontainer-tools.rules"
) )
// Rule defines an udev rule which used to capture the partition udev event // Rule defines an udev rule which used to capture the partition udev event

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -19,7 +19,7 @@ import (
"io/ioutil" "io/ioutil"
"os/exec" "os/exec"
"isula.org/isulad-tools/utils" "isula.org/syscontainer-tools/utils"
"github.com/opencontainers/runc/libcontainer/selinux" "github.com/opencontainers/runc/libcontainer/selinux"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -20,9 +20,9 @@ import (
"os" "os"
"strings" "strings"
"isula.org/isulad-tools/container" "isula.org/syscontainer-tools/container"
"isula.org/isulad-tools/libnetwork" "isula.org/syscontainer-tools/libnetwork"
"isula.org/isulad-tools/types" "isula.org/syscontainer-tools/types"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/urfave/cli" "github.com/urfave/cli"

View File

@ -1,5 +1,5 @@
# Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. # Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
# isulad-tools is licensed under the Mulan PSL v1. # syscontainer-tools is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1. # You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at: # You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL # http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
# Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. # Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
# isulad-tools is licensed under the Mulan PSL v1. # syscontainer-tools is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1. # You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at: # You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL # http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
# Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. # Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
# isulad-tools is licensed under the Mulan PSL v1. # syscontainer-tools is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1. # You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at: # You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL # http://license.coscl.org.cn/MulanPSL
@ -13,8 +13,8 @@
#!/bin/bash #!/bin/bash
## isulad-tools paths. ## syscontainer-tools paths.
ISULAD_TOOLS="$CUR/../build/isulad-tools" ISULAD_TOOLS="$CUR/../build/syscontainer-tools"
## Ubuntu image ## Ubuntu image
UBUNTU_IMAGE="ubuntu" UBUNTU_IMAGE="ubuntu"

View File

@ -1,5 +1,5 @@
# Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. # Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
# isulad-tools is licensed under the Mulan PSL v1. # syscontainer-tools is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1. # You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at: # You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL # http://license.coscl.org.cn/MulanPSL
@ -41,8 +41,8 @@ setupImage(){
setup_device_hook(){ setup_device_hook(){
mkdir -p /var/lib/isulad/hooks mkdir -p /var/lib/isulad/hooks
cp $CUR/../hooks/isulad-hooks/example/hookspec.json /var/lib/isulad/hooks/ cp $CUR/../hooks/syscontainer-hooks/example/hookspec.json /var/lib/isulad/hooks/
cp $CUR/../build/isulad-hooks /var/lib/isulad/hooks/ cp $CUR/../build/syscontainer-hooks /var/lib/isulad/hooks/
} }
main_test(){ main_test(){

View File

@ -1,5 +1,5 @@
# Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. # Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
# isulad-tools is licensed under the Mulan PSL v1. # syscontainer-tools is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1. # You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at: # You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL # http://license.coscl.org.cn/MulanPSL
@ -24,7 +24,7 @@
test_001(){ test_001(){
#testcase01 #testcase01
CONTAINER_ID=`isula run -d $BUSYBOX_IMAGE top` CONTAINER_ID=`isula run -d $BUSYBOX_IMAGE top`
$ISULAD_TOOLS --debug --log $TMP/isulad-tools.log add-nic \ $ISULAD_TOOLS --debug --log $TMP/syscontainer-tools.log add-nic \
--type veth --name eth10 --ip 192.168.182.2/24 \ --type veth --name eth10 --ip 192.168.182.2/24 \
--mac "aa:bb:cc:dd:ee:aa" --bridge "docker0" --mtu 1350 \ --mac "aa:bb:cc:dd:ee:aa" --bridge "docker0" --mtu 1350 \
$CONTAINER_ID $CONTAINER_ID
@ -83,7 +83,7 @@ test_002(){
fail "02-1:FAIL" fail "02-1:FAIL"
fi fi
CONTAINER_ID=`isula run -d $BUSYBOX_IMAGE top` CONTAINER_ID=`isula run -d $BUSYBOX_IMAGE top`
$ISULAD_TOOLS --debug --log $TMP/isulad-tools.log add-nic \ $ISULAD_TOOLS --debug --log $TMP/syscontainer-tools.log add-nic \
--type veth --name eth11 --ip 192.168.182.2/24 \ --type veth --name eth11 --ip 192.168.182.2/24 \
--mac "aa:bb:cc:dd:ee:aa" --bridge $OVS_BR --mtu 1350 \ --mac "aa:bb:cc:dd:ee:aa" --bridge $OVS_BR --mtu 1350 \
$CONTAINER_ID $CONTAINER_ID

View File

@ -1,5 +1,5 @@
# Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. # Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
# isulad-tools is licensed under the Mulan PSL v1. # syscontainer-tools is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1. # You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at: # You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL # http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
# Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. # Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
# isulad-tools is licensed under the Mulan PSL v1. # syscontainer-tools is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1. # You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at: # You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL # http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
# Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. # Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
# isulad-tools is licensed under the Mulan PSL v1. # syscontainer-tools is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1. # You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at: # You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL # http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
# Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. # Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
# isulad-tools is licensed under the Mulan PSL v1. # syscontainer-tools is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1. # You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at: # You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL # http://license.coscl.org.cn/MulanPSL
@ -24,7 +24,7 @@ test_001(){
ip a a 192.168.182.1/24 dev $BR ip a a 192.168.182.1/24 dev $BR
CONTAINER_ID=`isula run -d --net none $BUSYBOX_IMAGE top` CONTAINER_ID=`isula run -d --net none $BUSYBOX_IMAGE top`
$ISULAD_TOOLS --debug --log $TMP/isulad-tools.log add-nic \ $ISULAD_TOOLS --debug --log $TMP/syscontainer-tools.log add-nic \
--type veth --name eth0 --ip 192.168.182.2/24 \ --type veth --name eth0 --ip 192.168.182.2/24 \
--mac "aa:bb:cc:dd:ee:aa" --bridge $BR --mtu 1450 \ --mac "aa:bb:cc:dd:ee:aa" --bridge $BR --mtu 1450 \
$CONTAINER_ID $CONTAINER_ID

View File

@ -1,5 +1,5 @@
# Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. # Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
# isulad-tools is licensed under the Mulan PSL v1. # syscontainer-tools is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1. # You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at: # You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL # http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -33,7 +33,7 @@ func getGraphDriverPath() (string, error) {
return "", err return "", err
} }
// get /var/lib/isulad from /var/lib/isulad/hooks/isulad-hooks // get /var/lib/isulad from /var/lib/isulad/hooks/syscontainer-hooks
dir := filepath.Dir(filepath.Dir(path)) dir := filepath.Dir(filepath.Dir(path))
return dir, nil return dir, nil
} }

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -20,10 +20,10 @@ import (
"path/filepath" "path/filepath"
"syscall" "syscall"
mymount "isula.org/isulad-tools/pkg/mount" mymount "isula.org/syscontainer-tools/pkg/mount"
"github.com/docker/docker/pkg/mount" "github.com/docker/docker/pkg/mount"
"isula.org/isulad-tools/types" "isula.org/syscontainer-tools/types"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
@ -36,7 +36,7 @@ const (
/* Add path to container when it is running /* Add path to container when it is running
We use mount propagation mechanism to do it. Take We use mount propagation mechanism to do it. Take
isulad tools add-path /hostpath1:/guest1 for example. syscontainer tools add-path /hostpath1:/guest1 for example.
1. Add a sharing path using hook as belowing. Then every 1. Add a sharing path using hook as belowing. Then every

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL

View File

@ -1,5 +1,5 @@
// Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved. // Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
// isulad-tools is licensed under the Mulan PSL v1. // syscontainer-tools is licensed under the Mulan PSL v1.
// You can use this software according to the terms and conditions of the Mulan PSL v1. // You can use this software according to the terms and conditions of the Mulan PSL v1.
// You may obtain a copy of Mulan PSL v1 at: // You may obtain a copy of Mulan PSL v1 at:
// http://license.coscl.org.cn/MulanPSL // http://license.coscl.org.cn/MulanPSL
@ -20,9 +20,9 @@ import (
"fmt" "fmt"
"os" "os"
"isula.org/isulad-tools/container" "isula.org/syscontainer-tools/container"
"isula.org/isulad-tools/libdevice" "isula.org/syscontainer-tools/libdevice"
"isula.org/isulad-tools/types" "isula.org/syscontainer-tools/types"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/urfave/cli" "github.com/urfave/cli"