!72 syscontainer-tools: sync from master
From: @vegbir Reviewed-by: @zhangsong234, @jingwoo Signed-off-by: @zhangsong234, @jingwoo
This commit is contained in:
commit
2b460565f5
2085
0006-support-ipv6.patch
Normal file
2085
0006-support-ipv6.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,88 @@
|
|||||||
|
From 39ff0ed013102542292f3270ed99babe3964c2a8 Mon Sep 17 00:00:00 2001
|
||||||
|
From: yangjiaqi <yangjiaqi16@huawei.com>
|
||||||
|
Date: Fri, 11 Aug 2023 14:47:05 +0800
|
||||||
|
Subject: [PATCH] use file locks to avoid remounting the sharepath/master dir
|
||||||
|
|
||||||
|
Signed-off-by: yangjiaqi <yangjiaqi16@huawei.com>
|
||||||
|
---
|
||||||
|
utils/transfer.go | 40 +++++++++++++++++++++++++++++++++++-----
|
||||||
|
1 file changed, 35 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/utils/transfer.go b/utils/transfer.go
|
||||||
|
index 9c6d527..789cb99 100644
|
||||||
|
--- a/utils/transfer.go
|
||||||
|
+++ b/utils/transfer.go
|
||||||
|
@@ -20,17 +20,20 @@ import (
|
||||||
|
"path/filepath"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
|
- mymount "isula.org/syscontainer-tools/pkg/mount"
|
||||||
|
"github.com/docker/docker/pkg/mount"
|
||||||
|
+ "github.com/sirupsen/logrus"
|
||||||
|
+ "golang.org/x/sys/unix"
|
||||||
|
|
||||||
|
+ hconfig "isula.org/syscontainer-tools/config"
|
||||||
|
+ mymount "isula.org/syscontainer-tools/pkg/mount"
|
||||||
|
"isula.org/syscontainer-tools/types"
|
||||||
|
- "github.com/sirupsen/logrus"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
masterPath = "/.sharedpath/master"
|
||||||
|
midTransferPath = "/.sharedpath/midpath"
|
||||||
|
slavePath = "/.sharedpath"
|
||||||
|
+ lockFile = "master_locker"
|
||||||
|
)
|
||||||
|
|
||||||
|
/* Add path to container when it is running
|
||||||
|
@@ -171,17 +174,44 @@ func GetSlavePath() string {
|
||||||
|
|
||||||
|
// PrepareHostPath prepare host path
|
||||||
|
func PrepareHostPath(id string) error {
|
||||||
|
+ lockFile := filepath.Join(hconfig.IsuladToolsDir, lockFile)
|
||||||
|
+ // get lock file handler
|
||||||
|
+ f, err := os.OpenFile(lockFile, os.O_RDONLY|os.O_CREATE, 0600)
|
||||||
|
+ if err != nil {
|
||||||
|
+ return err
|
||||||
|
+ }
|
||||||
|
+ defer f.Close()
|
||||||
|
|
||||||
|
- if err := os.MkdirAll(masterPath, 0600); err != nil {
|
||||||
|
- return fmt.Errorf("create host shared path failed, err: %s", err)
|
||||||
|
+ // lock
|
||||||
|
+ if err := unix.Flock(int(f.Fd()), unix.LOCK_EX); err != nil {
|
||||||
|
+ return fmt.Errorf("fail to lock file %v: %v", f.Name(), err)
|
||||||
|
}
|
||||||
|
- if m, _ := mount.Mounted(masterPath); m != true {
|
||||||
|
+ mountErr := func() error {
|
||||||
|
+ mounted, err := mount.Mounted(masterPath)
|
||||||
|
+ if err != nil {
|
||||||
|
+ return fmt.Errorf("fail to know whether %v is mounted: %v", masterPath, err)
|
||||||
|
+ }
|
||||||
|
+ // has mounted
|
||||||
|
+ if mounted {
|
||||||
|
+ return nil
|
||||||
|
+ }
|
||||||
|
+ // do nothing if the directory has already been existed
|
||||||
|
+ if err := os.MkdirAll(masterPath, 0600); err != nil {
|
||||||
|
+ return fmt.Errorf("create host shared path failed, err: %s", err)
|
||||||
|
+ }
|
||||||
|
if err := mount.Mount("none", masterPath, "tmpfs", "size=16m"); err != nil {
|
||||||
|
return fmt.Errorf("mount host shared path failed:, %s", err)
|
||||||
|
}
|
||||||
|
if err := syscall.Mount("none", masterPath, "none", syscall.MS_SHARED|syscall.MS_REC, ""); err != nil {
|
||||||
|
return fmt.Errorf("failed to make mountpoint shared, err: %s", err)
|
||||||
|
}
|
||||||
|
+ return nil
|
||||||
|
+ }()
|
||||||
|
+ if unlockErr := unix.Flock(int(f.Fd()), unix.LOCK_UN); unlockErr != nil {
|
||||||
|
+ logrus.Errorf("failed to unlock %v : %v", f.Name(), unlockErr)
|
||||||
|
+ }
|
||||||
|
+ if mountErr != nil {
|
||||||
|
+ return mountErr
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := os.MkdirAll(filepath.Join(masterPath, id), 0600); err != nil {
|
||||||
|
--
|
||||||
|
2.30.0
|
||||||
|
|
||||||
@ -0,0 +1,58 @@
|
|||||||
|
From 7581283eb8e235ae0923e8c68677e059895a3c9b Mon Sep 17 00:00:00 2001
|
||||||
|
From: yangjiaqi <yangjiaqi16@huawei.com>
|
||||||
|
Date: Thu, 17 Aug 2023 20:12:49 +0800
|
||||||
|
Subject: [PATCH] clean up run/syscontainer-tools/netns/containerid dir residue
|
||||||
|
|
||||||
|
Signed-off-by: yangjiaqi <yangjiaqi16@huawei.com>
|
||||||
|
---
|
||||||
|
hooks/syscontainer-hooks/prestart.go | 22 +++++++++++++++++++++-
|
||||||
|
1 file changed, 21 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/hooks/syscontainer-hooks/prestart.go b/hooks/syscontainer-hooks/prestart.go
|
||||||
|
index a71d26b..8b5756e 100644
|
||||||
|
--- a/hooks/syscontainer-hooks/prestart.go
|
||||||
|
+++ b/hooks/syscontainer-hooks/prestart.go
|
||||||
|
@@ -23,11 +23,13 @@ import (
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
+ "github.com/docker/docker/pkg/mount"
|
||||||
|
"github.com/opencontainers/runc/libcontainer/configs"
|
||||||
|
_ "github.com/opencontainers/runc/libcontainer/nsenter"
|
||||||
|
"github.com/opencontainers/runtime-spec/specs-go"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
|
"golang.org/x/sys/unix"
|
||||||
|
+
|
||||||
|
hconfig "isula.org/syscontainer-tools/config"
|
||||||
|
"isula.org/syscontainer-tools/libdevice"
|
||||||
|
"isula.org/syscontainer-tools/libdevice/nsexec"
|
||||||
|
@@ -251,7 +253,25 @@ func UpdateNetwork(state *configs.HookState, hookConfig *hconfig.ContainerHookCo
|
||||||
|
logrus.Errorf("[device-hook] Failed to Create netns dir %v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
- file, err := os.Create(filepath.Join(hconfig.IsuladToolsDirNetns, state.ID))
|
||||||
|
+ /*
|
||||||
|
+ each container can only be in prestart, running or poststop at the same time,
|
||||||
|
+ so there is no lock protection for the file /run/syscontainer-tools/netns/containerid.
|
||||||
|
+ */
|
||||||
|
+ netnsMountpoint := filepath.Join(hconfig.IsuladToolsDirNetns, state.ID)
|
||||||
|
+ // see if the current network namespace file is mounted
|
||||||
|
+ mounted, err := mount.Mounted(netnsMountpoint)
|
||||||
|
+ if err != nil {
|
||||||
|
+ logrus.Errorf("[device-hook] Failed to get mount info %v: %v", netnsMountpoint, err)
|
||||||
|
+ }
|
||||||
|
+ // has mounted
|
||||||
|
+ if mounted {
|
||||||
|
+ // maybe the previous poststop command was not executed or interrupted, resulting in residual
|
||||||
|
+ if removeErr := RemoveNetworkDevices(state, hookConfig, spec); removeErr != nil {
|
||||||
|
+ logrus.Errorf("[device-hook] Failed to remove network devices and umount netns file and %v is still mounted: %v",
|
||||||
|
+ netnsMountpoint, removeErr)
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ file, err := os.Create(netnsMountpoint)
|
||||||
|
if err != nil {
|
||||||
|
logrus.Errorf("[device-hook] Failed to Create netns file %v", err)
|
||||||
|
return err
|
||||||
|
--
|
||||||
|
2.30.0
|
||||||
|
|
||||||
265
0009-drop-useless-function-error-and-info.patch
Normal file
265
0009-drop-useless-function-error-and-info.patch
Normal file
@ -0,0 +1,265 @@
|
|||||||
|
From f5cc3ac5b6ecd78adbccd6792c2705c850a1c189 Mon Sep 17 00:00:00 2001
|
||||||
|
From: vegbir <yangjiaqi16@huawei.com>
|
||||||
|
Date: Tue, 29 Aug 2023 09:01:50 +0000
|
||||||
|
Subject: [PATCH] drop useless function error and info
|
||||||
|
|
||||||
|
Signed-off-by: vegbir <yangjiaqi16@huawei.com>
|
||||||
|
---
|
||||||
|
container/container.go | 14 +++++++++-----
|
||||||
|
hack/syscontainer-tools_wrapper | 1 -
|
||||||
|
hooks/syscontainer-hooks/poststop.go | 2 +-
|
||||||
|
libdevice/binds_unix.go | 2 +-
|
||||||
|
libdevice/container_work.go | 7 ++++---
|
||||||
|
libnetwork/drivers/eth/driver.go | 9 +++++----
|
||||||
|
pkg/udevd/udevd.go | 9 ++++++---
|
||||||
|
pkg/udevd/udevd_controller.go | 6 ++++--
|
||||||
|
utils/transfer.go | 2 +-
|
||||||
|
utils/utils.go | 12 ++++++++++++
|
||||||
|
10 files changed, 43 insertions(+), 21 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/container/container.go b/container/container.go
|
||||||
|
index 67f6b53..fb9b20f 100644
|
||||||
|
--- a/container/container.go
|
||||||
|
+++ b/container/container.go
|
||||||
|
@@ -125,7 +125,9 @@ func (c *Container) Lock() error {
|
||||||
|
// LOCK_EX means only one process could lock it at one time.
|
||||||
|
// LOCK_NB is not set, using block mode.
|
||||||
|
if err := unix.Flock(int(f.Fd()), unix.LOCK_EX); err != nil {
|
||||||
|
- f.Close()
|
||||||
|
+ if closeErr := f.Close(); closeErr != nil {
|
||||||
|
+ logrus.Warnf("fail to close %v: %v", fileName, closeErr)
|
||||||
|
+ }
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
c.lock = f
|
||||||
|
@@ -147,9 +149,9 @@ func (c *Container) GetCgroupPath() (string, error) {
|
||||||
|
return "", fmt.Errorf("%s: %v", string(out), err)
|
||||||
|
}
|
||||||
|
cgroupPath := strings.Trim(string(out), "\n")
|
||||||
|
- if len(cgroupPath) >= 2 {
|
||||||
|
- cgroupPath = cgroupPath[1 : len(cgroupPath)-1]
|
||||||
|
- }
|
||||||
|
+ if len(cgroupPath) >= 2 {
|
||||||
|
+ cgroupPath = cgroupPath[1 : len(cgroupPath)-1]
|
||||||
|
+ }
|
||||||
|
if cgroupPath == "" {
|
||||||
|
// by default, the cgroup path is "/isulad/<id>"
|
||||||
|
cgroupPath = "/isulad"
|
||||||
|
@@ -204,7 +206,9 @@ func getIsuladContainerSpec(id string) (spec *specs.Spec, err error) {
|
||||||
|
}
|
||||||
|
defer func() {
|
||||||
|
if config != nil {
|
||||||
|
- config.Close()
|
||||||
|
+ if closeErr := config.Close(); closeErr != nil {
|
||||||
|
+ logrus.Warnf("fail to close %v: %v", configPath, closeErr)
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
if err := json.NewDecoder(config).Decode(&spec); err != nil {
|
||||||
|
diff --git a/hack/syscontainer-tools_wrapper b/hack/syscontainer-tools_wrapper
|
||||||
|
index 671eec3..33db18e 100644
|
||||||
|
--- a/hack/syscontainer-tools_wrapper
|
||||||
|
+++ b/hack/syscontainer-tools_wrapper
|
||||||
|
@@ -9,7 +9,6 @@
|
||||||
|
# PURPOSE.
|
||||||
|
# See the Mulan PSL v2 for more details.
|
||||||
|
# Description: syscontainer tools wrapper
|
||||||
|
-# Author: zhangsong234
|
||||||
|
# Create: 2020-01-17
|
||||||
|
|
||||||
|
LOG_DIR=/var/log/hyperagent
|
||||||
|
diff --git a/hooks/syscontainer-hooks/poststop.go b/hooks/syscontainer-hooks/poststop.go
|
||||||
|
index 35f648e..8f03bd7 100644
|
||||||
|
--- a/hooks/syscontainer-hooks/poststop.go
|
||||||
|
+++ b/hooks/syscontainer-hooks/poststop.go
|
||||||
|
@@ -86,7 +86,7 @@ func RemoveNetworkDevices(state *configs.HookState, hookConfig *hconfig.Containe
|
||||||
|
if err := os.Remove(file.Name()); err != nil {
|
||||||
|
logrus.Errorf("Failed to remove fileName err: %v", err)
|
||||||
|
}
|
||||||
|
- file.Close()
|
||||||
|
+ utils.DropError(file.Close())
|
||||||
|
}()
|
||||||
|
|
||||||
|
for _, nic := range hookConfig.NetworkInterfaces {
|
||||||
|
diff --git a/libdevice/binds_unix.go b/libdevice/binds_unix.go
|
||||||
|
index 2c45700..ca784c0 100644
|
||||||
|
--- a/libdevice/binds_unix.go
|
||||||
|
+++ b/libdevice/binds_unix.go
|
||||||
|
@@ -128,7 +128,7 @@ func findPathDevice(path string) (*types.Device, string, error) {
|
||||||
|
reader := bufio.NewReader(stdout)
|
||||||
|
|
||||||
|
// ignore first line.
|
||||||
|
- reader.ReadString('\n')
|
||||||
|
+ utils.DropError(reader.ReadString('\n'))
|
||||||
|
line, err := reader.ReadString('\n')
|
||||||
|
if err != nil {
|
||||||
|
logrus.Errorf("reader.ReadString error: %v", err)
|
||||||
|
diff --git a/libdevice/container_work.go b/libdevice/container_work.go
|
||||||
|
index 050438f..07bfdfa 100644
|
||||||
|
--- a/libdevice/container_work.go
|
||||||
|
+++ b/libdevice/container_work.go
|
||||||
|
@@ -16,7 +16,6 @@ package libdevice
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
- "github.com/sirupsen/logrus"
|
||||||
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
|
"path"
|
||||||
|
@@ -26,6 +25,8 @@ import (
|
||||||
|
"syscall"
|
||||||
|
|
||||||
|
"github.com/docker/docker/pkg/reexec"
|
||||||
|
+ "github.com/sirupsen/logrus"
|
||||||
|
+
|
||||||
|
"isula.org/syscontainer-tools/libdevice/nsexec"
|
||||||
|
"isula.org/syscontainer-tools/pkg/mount"
|
||||||
|
"isula.org/syscontainer-tools/types"
|
||||||
|
@@ -158,7 +159,7 @@ func doMount(pipe *os.File) error {
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("fail to create %s, err: %s", mnt.Destination, err)
|
||||||
|
}
|
||||||
|
- f.Close()
|
||||||
|
+ utils.DropError(f.Close())
|
||||||
|
}
|
||||||
|
return mount.Mount(mnt.Source, mnt.Destination, "none", mnt.Options)
|
||||||
|
}
|
||||||
|
@@ -290,7 +291,7 @@ func doAddBind(pipe *os.File) error {
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("fail to create transfer path,err: %s", err)
|
||||||
|
}
|
||||||
|
- f.Close()
|
||||||
|
+ utils.DropError(f.Close())
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := os.Chown(bind.ContainerPath, bind.UID, bind.GID); err != nil {
|
||||||
|
diff --git a/libnetwork/drivers/eth/driver.go b/libnetwork/drivers/eth/driver.go
|
||||||
|
index 901ec9c..549e186 100644
|
||||||
|
--- a/libnetwork/drivers/eth/driver.go
|
||||||
|
+++ b/libnetwork/drivers/eth/driver.go
|
||||||
|
@@ -26,6 +26,7 @@ import (
|
||||||
|
"isula.org/syscontainer-tools/libnetwork/drivers/common"
|
||||||
|
"isula.org/syscontainer-tools/libnetwork/nsutils"
|
||||||
|
"isula.org/syscontainer-tools/pkg/ethtool"
|
||||||
|
+ "isula.org/syscontainer-tools/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ethDriver struct {
|
||||||
|
@@ -164,10 +165,10 @@ func (d *ethDriver) DeleteIf() (rErr error) {
|
||||||
|
// move the network interface back to the container
|
||||||
|
if err := netlink.LinkSetNsFd(hostNic, int(nsFD.Fd())); err != nil {
|
||||||
|
logrus.Errorf("Recover on failure: failed to move nic(%s) back to container: %v", d.GetHostNicName(), err)
|
||||||
|
- nsFD.Close()
|
||||||
|
+ utils.DropError(nsFD.Close())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
- nsFD.Close()
|
||||||
|
+ utils.DropError(nsFD.Close())
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
// set iface to user desired name
|
||||||
|
@@ -318,10 +319,10 @@ func (d *ethDriver) JoinAndConfigure() (rErr error) {
|
||||||
|
// move the network interface back to the host
|
||||||
|
if err := netlink.LinkSetNsFd(ctrNic, int(initnsFD.Fd())); err != nil {
|
||||||
|
logrus.Errorf("Recover on failure: failed to move nic(%s) back to host: %v", d.GetHostNicName(), err)
|
||||||
|
- initnsFD.Close()
|
||||||
|
+ utils.DropError(initnsFD.Close())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
- initnsFD.Close()
|
||||||
|
+ utils.DropError(initnsFD.Close())
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
// set iface to user desired name
|
||||||
|
diff --git a/pkg/udevd/udevd.go b/pkg/udevd/udevd.go
|
||||||
|
index 22b0cba..2465066 100644
|
||||||
|
--- a/pkg/udevd/udevd.go
|
||||||
|
+++ b/pkg/udevd/udevd.go
|
||||||
|
@@ -16,11 +16,14 @@ package udevd
|
||||||
|
import (
|
||||||
|
"bufio"
|
||||||
|
"fmt"
|
||||||
|
- "github.com/sirupsen/logrus"
|
||||||
|
"os"
|
||||||
|
"os/exec"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
+
|
||||||
|
+ "github.com/sirupsen/logrus"
|
||||||
|
+
|
||||||
|
+ "isula.org/syscontainer-tools/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
func usingUdevd() (bool, error) {
|
||||||
|
@@ -42,8 +45,8 @@ func saveRules(path string, rules []*Rule) error {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
- f.WriteString("## This File is auto-generated by syscontainer-tools.\n")
|
||||||
|
- f.WriteString("## DO NOT EDIT IT\n\n")
|
||||||
|
+ utils.DropError(f.WriteString("## This File is auto-generated by syscontainer-tools.\n"))
|
||||||
|
+ utils.DropError(f.WriteString("## DO NOT EDIT IT\n\n"))
|
||||||
|
for _, r := range rules {
|
||||||
|
if _, err := f.WriteString(fmt.Sprintf("%s\n", r.ToUdevRuleString())); err != nil {
|
||||||
|
logrus.Errorf("f.WriteString err: %s", err)
|
||||||
|
diff --git a/pkg/udevd/udevd_controller.go b/pkg/udevd/udevd_controller.go
|
||||||
|
index d8ca84e..71138d5 100644
|
||||||
|
--- a/pkg/udevd/udevd_controller.go
|
||||||
|
+++ b/pkg/udevd/udevd_controller.go
|
||||||
|
@@ -18,8 +18,10 @@ import (
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
|
- hconfig "isula.org/syscontainer-tools/config"
|
||||||
|
"golang.org/x/sys/unix"
|
||||||
|
+
|
||||||
|
+ hconfig "isula.org/syscontainer-tools/config"
|
||||||
|
+ "isula.org/syscontainer-tools/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
@@ -97,7 +99,7 @@ func (sc *udevdController) Lock() error {
|
||||||
|
// LOCK_EX means only one process could lock it at one time.
|
||||||
|
// LOCK_NB is not set, using block mode.
|
||||||
|
if err := unix.Flock(int(f.Fd()), unix.LOCK_EX); err != nil {
|
||||||
|
- f.Close()
|
||||||
|
+ utils.DropError(f.Close())
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
sc.lock = f
|
||||||
|
diff --git a/utils/transfer.go b/utils/transfer.go
|
||||||
|
index a7f4b31..f164857 100644
|
||||||
|
--- a/utils/transfer.go
|
||||||
|
+++ b/utils/transfer.go
|
||||||
|
@@ -106,7 +106,7 @@ func parepareMountpoint(sPath, dPath, mOpt string, isDir bool) error {
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("Fail to create transfer path,err: %s", err)
|
||||||
|
}
|
||||||
|
- f.Close()
|
||||||
|
+ DropError(f.Close())
|
||||||
|
}
|
||||||
|
|
||||||
|
if m, err := mount.Mounted(dPath); err != nil {
|
||||||
|
diff --git a/utils/utils.go b/utils/utils.go
|
||||||
|
index 31c8d14..3adbf2d 100644
|
||||||
|
--- a/utils/utils.go
|
||||||
|
+++ b/utils/utils.go
|
||||||
|
@@ -184,3 +184,15 @@ func RandomFile(folder string) string {
|
||||||
|
}
|
||||||
|
return path
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+// DropError drop unused error
|
||||||
|
+func DropError(args ...interface{}) {
|
||||||
|
+ argn := len(args)
|
||||||
|
+ if argn == 0 {
|
||||||
|
+ return
|
||||||
|
+ }
|
||||||
|
+ arg := args[argn-1]
|
||||||
|
+ if arg != nil {
|
||||||
|
+ logrus.Warnf("drop error: %v\n", arg)
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
--
|
||||||
|
2.41.0
|
||||||
|
|
||||||
25
0010-fix-log-of-removeUdevRule.patch
Normal file
25
0010-fix-log-of-removeUdevRule.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
From 56a42267650b11f5eb691cb852f0f7a827ed715a Mon Sep 17 00:00:00 2001
|
||||||
|
From: yangjiaqi <yangjiaqi16@huawei.com>
|
||||||
|
Date: Thu, 21 Sep 2023 11:07:21 +0800
|
||||||
|
Subject: [PATCH] fix log of RemoveUdevRule
|
||||||
|
|
||||||
|
---
|
||||||
|
hooks/syscontainer-hooks/poststop.go | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/hooks/syscontainer-hooks/poststop.go b/hooks/syscontainer-hooks/poststop.go
|
||||||
|
index 8f03bd7..f422c4e 100644
|
||||||
|
--- a/hooks/syscontainer-hooks/poststop.go
|
||||||
|
+++ b/hooks/syscontainer-hooks/poststop.go
|
||||||
|
@@ -50,7 +50,7 @@ func RemoveUdevRule(state *configs.HookState, hookConfig *hconfig.ContainerHookC
|
||||||
|
resolvDev := calcPathForDevice(state.Root, dev)
|
||||||
|
device, err := libdevice.ParseDevice(resolvDev)
|
||||||
|
if err != nil {
|
||||||
|
- logrus.Errorf("[device-hook] Add device (%s), parse device failed: %v", resolvDev, err)
|
||||||
|
+ logrus.Errorf("[device-hook] RemoveUdevRule (%s), parse device failed: %v", resolvDev, err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.30.0
|
||||||
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
#Basic Information
|
#Basic Information
|
||||||
Name: syscontainer-tools
|
Name: syscontainer-tools
|
||||||
Version: 0.9
|
Version: 0.9
|
||||||
Release: 55
|
Release: 63
|
||||||
Summary: syscontainer tools for IT, work with iSulad
|
Summary: syscontainer tools for IT, work with iSulad
|
||||||
License: Mulan PSL v2
|
License: Mulan PSL v2
|
||||||
URL: https://gitee.com/openeuler/syscontainer-tools
|
URL: https://gitee.com/openeuler/syscontainer-tools
|
||||||
@ -13,6 +13,12 @@ Patch2: 0002-syscontainer-tools-build-security-option.patch
|
|||||||
Patch3: 0003-enable-external-linkmode-for-cgo-build.patch
|
Patch3: 0003-enable-external-linkmode-for-cgo-build.patch
|
||||||
Patch4: 0004-add-dt-test.patch
|
Patch4: 0004-add-dt-test.patch
|
||||||
Patch5: 0005-add-riscv64-to-syscall-build.patch
|
Patch5: 0005-add-riscv64-to-syscall-build.patch
|
||||||
|
Patch6: 0006-support-ipv6.patch
|
||||||
|
Patch7: 0007-use-file-locks-to-avoid-remounting-the-sharepath-mas.patch
|
||||||
|
Patch8: 0008-clean-up-run-syscontainer-tools-netns-containerid-di.patch
|
||||||
|
Patch9: 0009-drop-useless-function-error-and-info.patch
|
||||||
|
Patch10: 0010-fix-log-of-removeUdevRule.patch
|
||||||
|
|
||||||
%ifarch sw_64
|
%ifarch sw_64
|
||||||
Patch1000: 1000-add-sw_64-support-not-upstream-modified-files.patch
|
Patch1000: 1000-add-sw_64-support-not-upstream-modified-files.patch
|
||||||
%endif
|
%endif
|
||||||
@ -58,8 +64,8 @@ make localtest
|
|||||||
%preun
|
%preun
|
||||||
|
|
||||||
%post
|
%post
|
||||||
GRAPH=`isula info | grep -Eo "iSulad Root Dir:.+" | grep -Eo "\/.*"`
|
GRAPH=`isula info 2>/dev/null | grep -Eo "iSulad Root Dir:.+" | grep -Eo "\/.*"`
|
||||||
if [ "$GRAPH" == "" ]; then
|
if [ x"$GRAPH" == "x" ]; then
|
||||||
GRAPH="/var/lib/isulad"
|
GRAPH="/var/lib/isulad"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -120,6 +126,54 @@ chmod 0640 ${HOOK_SPEC}/hookspec.json
|
|||||||
rm -rfv %{buildroot}
|
rm -rfv %{buildroot}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Dec 25 2023 yangjiaqi <yangjiaqi16@huawei.com> - 0.9-63
|
||||||
|
- Type:bugfix
|
||||||
|
- CVE:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:hide error when isula info is abnormal
|
||||||
|
|
||||||
|
* Mon Dec 25 2023 yangjiaqi<yangjiaqi16@huawei.com> - 0.9-62
|
||||||
|
- Type:bugfix
|
||||||
|
- CVE:NA
|
||||||
|
- SUG:restart
|
||||||
|
- DESC:fix log of removeUdevRule
|
||||||
|
|
||||||
|
* Mon Dec 25 2023 yangjiaqi<yangjiaqi16@huawei.com> - 0.9-61
|
||||||
|
- Type:bugfix
|
||||||
|
- CVE:NA
|
||||||
|
- SUG:restart
|
||||||
|
- DESC:adjust the position of Shenwei patch
|
||||||
|
|
||||||
|
* Mon Dec 25 2023 yangjiaqi<yangjiaqi16@huawei.com> - 0.9-60
|
||||||
|
- Type:bugfix
|
||||||
|
- CVE:NA
|
||||||
|
- SUG:restart
|
||||||
|
- DESC:drop useless function error and info
|
||||||
|
|
||||||
|
* Mon Dec 25 2023 yangjiaqi<yangjiaqi16@huawei.com> - 0.9-59
|
||||||
|
- Type:bugfix
|
||||||
|
- CVE:NA
|
||||||
|
- SUG:restart
|
||||||
|
- DESC:remove redundant symbol
|
||||||
|
|
||||||
|
* Mon Dec 25 2023 yangjiaqi<yangjiaqi16@huawei.com> - 0.9-58
|
||||||
|
- Type:bugfix
|
||||||
|
- CVE:NA
|
||||||
|
- SUG:restart
|
||||||
|
- DESC:clean up run/syscontainer-tools/netns/container_id directory residues in the prestart phase
|
||||||
|
|
||||||
|
* Mon Dec 25 2023 yangjiaqi<yangjiaqi16@huawei.com> - 0.9-57
|
||||||
|
- Type:bugfix
|
||||||
|
- CVE:NA
|
||||||
|
- SUG:restart
|
||||||
|
- DESC:use file locks to avoid remounting the sharepath/master dir
|
||||||
|
|
||||||
|
* Mon Dec 25 2023 yangjiaqi<yangjiaqi16@huawei.com> - 0.9-56
|
||||||
|
- Type:bugfix
|
||||||
|
- CVE:NA
|
||||||
|
- SUG:restart
|
||||||
|
- DESC:support ip6
|
||||||
|
|
||||||
* Tue Oct 17 2023 yangjiaqi<yangjiaqi16@huawei.com> - 0.9-55
|
* Tue Oct 17 2023 yangjiaqi<yangjiaqi16@huawei.com> - 0.9-55
|
||||||
- remove useless patch
|
- remove useless patch
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user