Skip to content

Commit 0adb0e3

Browse files
authored
Merge pull request #24 from kernel/release-please--branches--main--changes--next
release: 0.10.0
2 parents 5fc15d8 + b32e262 commit 0adb0e3

8 files changed

Lines changed: 70 additions & 14 deletions

File tree

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.9.8"
2+
".": "0.10.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 37
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-0541294848c0b8de2c31a105855c740dc98d1480dd27a20a52d7bc291ba001d8.yml
3-
openapi_spec_hash: 03714883bdadb4a6a743a7faec477a05
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-fa1e2bdf81a0cf5ecd0c01200b07d0bc08861f834b539c751aa0fec0496fdf2c.yml
3+
openapi_spec_hash: c70af233ec40cdc23b9a2886b508905e
44
config_hash: d452c139da1e46a44a68b91e8a40de72

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## 0.10.0 (2026-02-13)
4+
5+
Full Changelog: [v0.9.8...v0.10.0](https://github.com/kernel/hypeman-go/compare/v0.9.8...v0.10.0)
6+
7+
### Features
8+
9+
* Add metadata field to instances ([8ce4014](https://github.com/kernel/hypeman-go/commit/8ce40145c0f6db8e928efa9c2909521a6d452579))
10+
* Better stop behavior ([12cfb4e](https://github.com/kernel/hypeman-go/commit/12cfb4e4ddfc198c65b09efeb73c8db0fd609f5f))
11+
312
## 0.9.8 (2026-02-11)
413

514
Full Changelog: [v0.9.7...v0.9.8](https://github.com/kernel/hypeman-go/compare/v0.9.7...v0.9.8)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Or to pin the version:
2828
<!-- x-release-please-start-version -->
2929

3030
```sh
31-
go get -u 'github.com/kernel/hypeman-go@v0.9.8'
31+
go get -u 'github.com/kernel/hypeman-go@v0.10.0'
3232
```
3333

3434
<!-- x-release-please-end -->

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Methods:
4242
- <code title="get /instances/{id}/logs">client.Instances.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceService.Logs">Logs</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>, query <a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceLogsParams">InstanceLogsParams</a>) (\*<a href="https://pkg.go.dev/builtin#string">string</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4343
- <code title="post /instances/{id}/restore">client.Instances.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceService.Restore">Restore</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) (\*<a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4444
- <code title="post /instances/{id}/standby">client.Instances.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceService.Standby">Standby</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) (\*<a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
45-
- <code title="post /instances/{id}/start">client.Instances.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceService.Start">Start</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) (\*<a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
45+
- <code title="post /instances/{id}/start">client.Instances.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceService.Start">Start</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>, body <a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceStartParams">InstanceStartParams</a>) (\*<a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4646
- <code title="get /instances/{id}/stat">client.Instances.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceService.Stat">Stat</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>, query <a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceStatParams">InstanceStatParams</a>) (\*<a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#PathInfo">PathInfo</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4747
- <code title="post /instances/{id}/stop">client.Instances.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceService.Stop">Stop</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) (\*<a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4848

instance.go

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,14 @@ func (r *InstanceService) Standby(ctx context.Context, id string, opts ...option
133133
}
134134

135135
// Start a stopped instance
136-
func (r *InstanceService) Start(ctx context.Context, id string, opts ...option.RequestOption) (res *Instance, err error) {
136+
func (r *InstanceService) Start(ctx context.Context, id string, body InstanceStartParams, opts ...option.RequestOption) (res *Instance, err error) {
137137
opts = slices.Concat(r.Options, opts)
138138
if id == "" {
139139
err = errors.New("missing required id parameter")
140140
return
141141
}
142142
path := fmt.Sprintf("instances/%s/start", id)
143-
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &res, opts...)
143+
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
144144
return
145145
}
146146

@@ -195,6 +195,11 @@ type Instance struct {
195195
DiskIoBps string `json:"disk_io_bps"`
196196
// Environment variables
197197
Env map[string]string `json:"env"`
198+
// App exit code (null if VM hasn't exited)
199+
ExitCode int64 `json:"exit_code,nullable"`
200+
// Human-readable description of exit (e.g., "command not found", "killed by signal
201+
// 9 (SIGKILL) - OOM")
202+
ExitMessage string `json:"exit_message"`
198203
// GPU information attached to the instance
199204
GPU InstanceGPU `json:"gpu"`
200205
// Whether a snapshot exists for this instance
@@ -205,6 +210,8 @@ type Instance struct {
205210
//
206211
// Any of "cloud-hypervisor", "qemu", "vz".
207212
Hypervisor InstanceHypervisor `json:"hypervisor"`
213+
// User-defined key-value metadata
214+
Metadata map[string]string `json:"metadata"`
208215
// Network configuration of the instance
209216
Network InstanceNetwork `json:"network"`
210217
// Writable overlay disk size (human-readable)
@@ -230,10 +237,13 @@ type Instance struct {
230237
State respjson.Field
231238
DiskIoBps respjson.Field
232239
Env respjson.Field
240+
ExitCode respjson.Field
241+
ExitMessage respjson.Field
233242
GPU respjson.Field
234243
HasSnapshot respjson.Field
235244
HotplugSize respjson.Field
236245
Hypervisor respjson.Field
246+
Metadata respjson.Field
237247
Network respjson.Field
238248
OverlaySize respjson.Field
239249
Size respjson.Field
@@ -465,8 +475,14 @@ type InstanceNewParams struct {
465475
SkipKernelHeaders param.Opt[bool] `json:"skip_kernel_headers,omitzero"`
466476
// Number of virtual CPUs
467477
Vcpus param.Opt[int64] `json:"vcpus,omitzero"`
478+
// Override image CMD (like docker run <image> <command>). Omit to use image
479+
// default.
480+
Cmd []string `json:"cmd,omitzero"`
468481
// Device IDs or names to attach for GPU/PCI passthrough
469482
Devices []string `json:"devices,omitzero"`
483+
// Override image entrypoint (like docker run --entrypoint). Omit to use image
484+
// default.
485+
Entrypoint []string `json:"entrypoint,omitzero"`
470486
// Environment variables
471487
Env map[string]string `json:"env,omitzero"`
472488
// GPU configuration for the instance
@@ -475,6 +491,8 @@ type InstanceNewParams struct {
475491
//
476492
// Any of "cloud-hypervisor", "qemu", "vz".
477493
Hypervisor InstanceNewParamsHypervisor `json:"hypervisor,omitzero"`
494+
// User-defined key-value metadata for the instance
495+
Metadata map[string]string `json:"metadata,omitzero"`
478496
// Network configuration for the instance
479497
Network InstanceNewParamsNetwork `json:"network,omitzero"`
480498
// Volumes to attach to the instance at creation time
@@ -572,6 +590,22 @@ const (
572590
InstanceLogsParamsSourceHypeman InstanceLogsParamsSource = "hypeman"
573591
)
574592

593+
type InstanceStartParams struct {
594+
// Override image CMD for this run. Omit to keep previous value.
595+
Cmd []string `json:"cmd,omitzero"`
596+
// Override image entrypoint for this run. Omit to keep previous value.
597+
Entrypoint []string `json:"entrypoint,omitzero"`
598+
paramObj
599+
}
600+
601+
func (r InstanceStartParams) MarshalJSON() (data []byte, err error) {
602+
type shadow InstanceStartParams
603+
return param.MarshalObject(r, (*shadow)(&r))
604+
}
605+
func (r *InstanceStartParams) UnmarshalJSON(data []byte) error {
606+
return apijson.UnmarshalRoot(data, r)
607+
}
608+
575609
type InstanceStatParams struct {
576610
// Path to stat in the guest filesystem
577611
Path string `query:"path,required" json:"-"`

instance_test.go

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ func TestInstanceNewWithOptionalParams(t *testing.T) {
2727
option.WithAPIKey("My API Key"),
2828
)
2929
_, err := client.Instances.New(context.TODO(), hypeman.InstanceNewParams{
30-
Image: "docker.io/library/alpine:latest",
31-
Name: "my-workload-1",
32-
Devices: []string{"l4-gpu"},
33-
DiskIoBps: hypeman.String("100MB/s"),
30+
Image: "docker.io/library/alpine:latest",
31+
Name: "my-workload-1",
32+
Cmd: []string{"echo", "hello"},
33+
Devices: []string{"l4-gpu"},
34+
DiskIoBps: hypeman.String("100MB/s"),
35+
Entrypoint: []string{"/bin/sh", "-c"},
3436
Env: map[string]string{
3537
"PORT": "3000",
3638
"NODE_ENV": "production",
@@ -40,6 +42,10 @@ func TestInstanceNewWithOptionalParams(t *testing.T) {
4042
},
4143
HotplugSize: hypeman.String("2GB"),
4244
Hypervisor: hypeman.InstanceNewParamsHypervisorCloudHypervisor,
45+
Metadata: map[string]string{
46+
"team": "backend",
47+
"purpose": "staging",
48+
},
4349
Network: hypeman.InstanceNewParamsNetwork{
4450
BandwidthDownload: hypeman.String("1Gbps"),
4551
BandwidthUpload: hypeman.String("1Gbps"),
@@ -182,7 +188,7 @@ func TestInstanceStandby(t *testing.T) {
182188
}
183189
}
184190

185-
func TestInstanceStart(t *testing.T) {
191+
func TestInstanceStartWithOptionalParams(t *testing.T) {
186192
t.Skip("Prism tests are disabled")
187193
baseURL := "http://localhost:4010"
188194
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
@@ -195,7 +201,14 @@ func TestInstanceStart(t *testing.T) {
195201
option.WithBaseURL(baseURL),
196202
option.WithAPIKey("My API Key"),
197203
)
198-
_, err := client.Instances.Start(context.TODO(), "id")
204+
_, err := client.Instances.Start(
205+
context.TODO(),
206+
"id",
207+
hypeman.InstanceStartParams{
208+
Cmd: []string{"string"},
209+
Entrypoint: []string{"string"},
210+
},
211+
)
199212
if err != nil {
200213
var apierr *hypeman.Error
201214
if errors.As(err, &apierr) {

internal/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
package internal
44

5-
const PackageVersion = "0.9.8" // x-release-please-version
5+
const PackageVersion = "0.10.0" // x-release-please-version

0 commit comments

Comments
 (0)