Add context to net ns symlink removal errors
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
parent
8ea79e755f
commit
f94948d8ec
1 changed files with 6 additions and 2 deletions
|
@ -59,10 +59,14 @@ func (ns *NetNs) symlinkCreate(name string) error {
|
||||||
|
|
||||||
func (ns *NetNs) symlinkRemove() error {
|
func (ns *NetNs) symlinkRemove() error {
|
||||||
if err := ns.symlink.Close(); err != nil {
|
if err := ns.symlink.Close(); err != nil {
|
||||||
return err
|
return fmt.Errorf("failed to close net ns symlink: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return os.RemoveAll(ns.symlink.Name())
|
if err := os.RemoveAll(ns.symlink.Name()); err != nil {
|
||||||
|
return fmt.Errorf("failed to remove net ns symlink: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func isSymbolicLink(path string) (bool, error) {
|
func isSymbolicLink(path string) (bool, error) {
|
||||||
|
|
Loading…
Reference in a new issue