Fix unit tests
Closes:
Approved by: mheon
@@ -511,6 +511,10 @@ func (s *SQLState) SaveContainer(ctr *Container) error {
NetNSPath=?
WHERE Id=?;`
+ if !ctr.valid {
+ return ErrCtrRemoved
+ }
+
netNSPath := ""
if ctr.state.NetNS != nil {
netNSPath = ctr.state.NetNS.Path()
@@ -520,10 +524,6 @@ func (s *SQLState) SaveContainer(ctr *Container) error {
return ErrDBClosed
}
- if !ctr.valid {
- return ErrCtrRemoved
- }
-
tx, err := s.db.Begin()
if err != nil {
return errors.Wrapf(err, "error beginning database transaction")
