firecracker-microvm / firecracker-microvm/firecracker-go-sdk

Should not require socket path to be set in both firecracker.Config and firecracker.VMCommandBuilder

Open
#88 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
672
Forks
166
PR merge metrics
No merged PRs in 30d

Description

The SDK currently requires the socket path to be set in two places, and for it to be set to the same thing:

* [firecracker.Config](https://github.com/firecracker-microvm/firecracker-go-sdk/blob/57448b62dc5998a32cb240f4991f7c5203ef8773/machine.go#L42-L45)
* [firecracker.VMCommandBuilder](https://github.com/firecracker-microvm/firecracker-go-sdk/blob/57448b62dc5998a32cb240f4991f7c5203ef8773/command_builder.go#L36)

`firecracker.VMCommandBuilder` is used for building the command to start the `firecracker` binary. Specifying the socket path here adds the `--api-sock` command-line argument that tells Firecracker to open the socket in a particular location.

`firecracker.Config` is used in the API client so that the client knows how to talk to the Firecracker API.

In order to both start a VM and communicate with it, a user of this SDK is required to specify the socket path in both places. If the user is intending to start a VM and immediately control it (which I think is the most common case), we should make it simpler to do so and allow the field to be specified only once.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.