mirror of
https://github.com/containers/podman.git
synced 2025-06-05 22:31:06 +08:00
Do not fetch pod and ctr State on retrieval in Bolt
It's not necessary to fill in state immediately, as we'll be overwriting it on any API call accessing it thanks to syncContainer(). It is also causing races when we fetch it without holding the container lock (which syncContainer() does). As such, just don't retrieve the state on initial pull from the database with Bolt. Also, refactor some Linux-specific netns handling functions out of container_internal_linux.go into boltdb_linux.go. Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #1186 Approved by: rhatdan
This commit is contained in:
@ -6,12 +6,12 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// parseNetNSBoltData sets ctr.state.NetNS, if any, from netNSBytes.
|
||||
// Returns true if the data is valid.
|
||||
func parseNetNSBoltData(ctr *Container, netNSBytes []byte) bool {
|
||||
if netNSBytes != nil {
|
||||
logrus.Errorf("error loading %s: network namespaces are not supported on this platform", ctr.ID())
|
||||
return false
|
||||
}
|
||||
return true
|
||||
// replaceNetNS is exclusive to the Linux platform and is a no-op elsewhere
|
||||
func replaceNetNS(netNSPath string, ctr *Container, newState *containerState) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// getNetNSPath is exclusive to the Linux platform and is a no-op elsewhere
|
||||
func getNetNSPath(ctr *Container) string {
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user