Skip to content

Commit 57ac852

Browse files
Add a network namespace parameter to the CreateVM request
The current network namespace parameter nested in the JailerConfig parameter requires specifying the entire jailer configuration, which is not convenient and doesn't allow using the noop jailer with a network namespace. To overcome this limitation, add a new NetNS parameter to the CreateVM request. See also a similar change in firecracker-microvm/firecracker-go-sdk#155. Signed-off-by: Georgiy Lebedev <[email protected]>
1 parent 2a60b1c commit 57ac852

File tree

3 files changed

+77
-62
lines changed

3 files changed

+77
-62
lines changed

proto/firecracker.pb.go

+72-62
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/firecracker.proto

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ message CreateVMRequest {
4141
string MetricsFifoPath = 13;
4242

4343
FirecrackerBalloonDevice BalloonDevice = 14;
44+
45+
// The network namespace of the VM.
46+
string NetNS = 15;
4447
}
4548

4649
message CreateVMResponse {

runtime/service.go

+2
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,8 @@ func (s *service) buildVMConfiguration(req *proto.CreateVMRequest) (*firecracker
985985

986986
if req.JailerConfig != nil {
987987
cfg.NetNS = req.JailerConfig.NetNS
988+
} else {
989+
cfg.NetNS = req.NetNS
988990
}
989991

990992
s.logger.Debugf("using socket path: %s", cfg.SocketPath)

0 commit comments

Comments
 (0)