mirror of
https://github.com/getcompanion-ai/computer-host.git
synced 2026-04-15 20:03:06 +00:00
host daemon touches (#4)
* feat: launch config tests * feat: readiness probe port alignment
This commit is contained in:
parent
e2f9e54970
commit
592df1e1df
10 changed files with 439 additions and 49 deletions
|
|
@ -33,6 +33,8 @@ type driveRequest struct {
|
|||
PathOnHost string `json:"path_on_host"`
|
||||
}
|
||||
|
||||
type entropyRequest struct{}
|
||||
|
||||
type faultResponse struct {
|
||||
FaultMessage string `json:"fault_message"`
|
||||
}
|
||||
|
|
@ -56,6 +58,10 @@ type networkInterfaceRequest struct {
|
|||
IfaceID string `json:"iface_id"`
|
||||
}
|
||||
|
||||
type serialRequest struct {
|
||||
SerialOutPath string `json:"serial_out_path"`
|
||||
}
|
||||
|
||||
type vsockRequest struct {
|
||||
GuestCID int64 `json:"guest_cid"`
|
||||
UDSPath string `json:"uds_path"`
|
||||
|
|
@ -98,6 +104,10 @@ func (c *apiClient) PutDrive(ctx context.Context, drive driveRequest) error {
|
|||
return c.do(ctx, http.MethodPut, endpoint, drive, nil, http.StatusNoContent)
|
||||
}
|
||||
|
||||
func (c *apiClient) PutEntropy(ctx context.Context) error {
|
||||
return c.do(ctx, http.MethodPut, "/entropy", entropyRequest{}, nil, http.StatusNoContent)
|
||||
}
|
||||
|
||||
func (c *apiClient) PutMachineConfig(ctx context.Context, spec MachineSpec) error {
|
||||
body := machineConfigRequest{
|
||||
MemSizeMib: spec.MemoryMiB,
|
||||
|
|
@ -117,6 +127,17 @@ func (c *apiClient) PutNetworkInterface(ctx context.Context, network NetworkAllo
|
|||
return c.do(ctx, http.MethodPut, endpoint, body, nil, http.StatusNoContent)
|
||||
}
|
||||
|
||||
func (c *apiClient) PutSerial(ctx context.Context, serialOutPath string) error {
|
||||
return c.do(
|
||||
ctx,
|
||||
http.MethodPut,
|
||||
"/serial",
|
||||
serialRequest{SerialOutPath: serialOutPath},
|
||||
nil,
|
||||
http.StatusNoContent,
|
||||
)
|
||||
}
|
||||
|
||||
func (c *apiClient) PutVsock(ctx context.Context, spec VsockSpec) error {
|
||||
body := vsockRequest{
|
||||
GuestCID: int64(spec.CID),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue