aboutsummaryrefslogtreecommitdiff
path: root/libpod/boltdb_state_freebsd.go
blob: d0a2d4f28e2fcaac264940280e52a1ffa3ef6afa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//go:build freebsd
// +build freebsd

package libpod

// replaceNetNS handle network namespace transitions after updating a
// container's state.
func replaceNetNS(netNSPath string, ctr *Container, newState *ContainerState) error {
	if netNSPath != "" {
		// On FreeBSD, we just record the network jail's name in our state.
		newState.NetNS = &jailNetNS{Name: netNSPath}
	} else {
		newState.NetNS = nil
	}
	return nil
}

// getNetNSPath retrieves the netns path to be stored in the database
func getNetNSPath(ctr *Container) string {
	if ctr.state.NetNS != nil {
		return ctr.state.NetNS.Name
	} else {
		return ""
	}
}