mirror of
https://github.com/containers/podman.git
synced 2025-06-27 21:50:18 +08:00
Remove network namespaces from DB on refresh
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #109 Approved by: mheon
This commit is contained in:
@ -98,12 +98,13 @@ func (s *SQLState) Close() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Refresh clears the state after a reboot
|
// Refresh clears the state after a reboot
|
||||||
// Resets mountpoint, PID, state for all containers
|
// Resets mountpoint, PID, state, netns path for all containers
|
||||||
func (s *SQLState) Refresh() (err error) {
|
func (s *SQLState) Refresh() (err error) {
|
||||||
const refresh = `UPDATE containerState SET
|
const refresh = `UPDATE containerState SET
|
||||||
State=?,
|
State=?,
|
||||||
Mountpoint=?,
|
Mountpoint=?,
|
||||||
Pid=?;`
|
Pid=?,
|
||||||
|
NetNSPath=?;`
|
||||||
|
|
||||||
if !s.valid {
|
if !s.valid {
|
||||||
return ErrDBClosed
|
return ErrDBClosed
|
||||||
@ -128,7 +129,8 @@ func (s *SQLState) Refresh() (err error) {
|
|||||||
_, err = tx.Exec(refresh,
|
_, err = tx.Exec(refresh,
|
||||||
ContainerStateConfigured,
|
ContainerStateConfigured,
|
||||||
"",
|
"",
|
||||||
0)
|
0,
|
||||||
|
"")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrapf(err, "error refreshing database state")
|
return errors.Wrapf(err, "error refreshing database state")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user