-
Notifications
You must be signed in to change notification settings - Fork 7
Spawn API #174
Conversation
Signed-off-by: Chris O'Hara <[email protected]>
Signed-off-by: Chris O'Hara <[email protected]>
Signed-off-by: Chris O'Hara <[email protected]>
Signed-off-by: Chris O'Hara <[email protected]>
Signed-off-by: Chris O'Hara <[email protected]>
Signed-off-by: Chris O'Hara <[email protected]>
Signed-off-by: Chris O'Hara <[email protected]>
@@ -156,6 +162,26 @@ func (pm *ProcessManager) Start(moduleSpec ModuleSpec, logSpec *LogSpec) (Proces | |||
} | |||
}() | |||
|
|||
infc, err := netns.InterfaceByName("en0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we avoid hard-coding the interface name here? Maybe instead we could loop over interfaces, skip the loopback, and then return the first address we find?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say let's keep it as-is for now, I think we'll revisit those soon enough that it's not a big concern 👍
|
||
message SpawnResponse { | ||
string process_id = 1; | ||
string ip_address = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we want to return both the ipv4 and ipv6 address when calling spawn, or whether just the ipv4 address is fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to my other comment, I think we'll want to have a more fleshed out description of the process configuration, including the list of network interfaces and their addresses.
This reverts commit b8addc8.
// Addr is a unique IP address for the process. | ||
Addr netip.Addr | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good enough for now but I think we'll want to enhance the model later to have a representation of each network interface exposed to the process :)
@@ -156,6 +162,26 @@ func (pm *ProcessManager) Start(moduleSpec ModuleSpec, logSpec *LogSpec) (Proces | |||
} | |||
}() | |||
|
|||
infc, err := netns.InterfaceByName("en0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say let's keep it as-is for now, I think we'll revisit those soon enough that it's not a big concern 👍
|
||
message SpawnResponse { | ||
string process_id = 1; | ||
string ip_address = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to my other comment, I think we'll want to have a more fleshed out description of the process configuration, including the list of network interfaces and their addresses.
This partially brings back #82, giving guests the ability to spawn and kill processes.