mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
expose lock release error from iptables util
This commit is contained in:
@@ -338,7 +338,7 @@ func (runner *runner) RestoreAll(data []byte, flush FlushFlag, counters RestoreC
|
||||
}
|
||||
|
||||
type iptablesLocker interface {
|
||||
Close()
|
||||
Close() error
|
||||
}
|
||||
|
||||
// restoreInternal is the shared part of Restore/RestoreAll
|
||||
@@ -361,7 +361,11 @@ func (runner *runner) restoreInternal(args []string, data []byte, flush FlushFla
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer locker.Close()
|
||||
defer func(locker iptablesLocker) {
|
||||
if err := locker.Close(); err != nil {
|
||||
glog.Errorf("Failed to close iptables locks: %v", err)
|
||||
}
|
||||
}(locker)
|
||||
}
|
||||
|
||||
// run the command and return the output or an error including the output and error
|
||||
|
||||
Reference in New Issue
Block a user