Skip to content

Commit

Permalink
pkg/port: ChildContext: remove unused PID field
Browse files Browse the repository at this point in the history
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
  • Loading branch information
AkihiroSuda committed Jun 28, 2023
1 parent 3f63619 commit 2ba2ca7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions pkg/parent/parent.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,7 @@ func Parent(opt Opt) error {
if opt.PortDriver != nil {
msgParentInitPortDriverCompleted.U.ParentInitPortDriverCompleted.PortDriverOpaque = opt.PortDriver.OpaqueForChild()
cctx := &port.ChildContext{
PID: cmd.Process.Pid,
IP: net.ParseIP(msgParentInitNetworkDriverCompleted.U.ParentInitNetworkDriverCompleted.IP).To4(),
IP: net.ParseIP(msgParentInitNetworkDriverCompleted.U.ParentInitNetworkDriverCompleted.IP).To4(),
}
go func() {
portDriverErr <- opt.PortDriver.RunParentDriver(portDriverInitComplete,
Expand Down
2 changes: 0 additions & 2 deletions pkg/port/port.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ type Manager interface {

// ChildContext is used for RunParentDriver
type ChildContext struct {
// PID of the child, can be used for ns-entering to the child namespaces.
PID int
// IP of the tap device
IP net.IP
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/port/testsuite/testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ func testProtoWithPID(t *testing.T, proto string, d port.ParentDriver, childPID
driverErr := make(chan error)
go func() {
cctx := &port.ChildContext{
PID: childPID,
IP: nil, // we don't have tap device in this test suite
IP: nil, // we don't have tap device in this test suite
}
driverErr <- d.RunParentDriver(initComplete, quit, cctx)
}()
Expand Down

0 comments on commit 2ba2ca7

Please sign in to comment.