feat(api): add Command and Args fields to SandboxContainer#125
Merged
scotwells merged 2 commits intoMay 29, 2026
Merged
Conversation
Exposes per-container entrypoint and argument overrides on the
SandboxContainer type, mirroring Kubernetes pod-spec semantics:
- Command []string — overrides the image ENTRYPOINT
- Args []string — overrides the image CMD; combined with
Command when both are set
When neither field is set the image's own ENTRYPOINT/CMD are used
unchanged, which is the correct default for standard OCI images
(e.g. hello-world, nginx). Infrastructure providers that translate
Instance specs (such as unikraft-provider) should map these fields
through to the underlying runtime.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
scotwells
added a commit
to datum-cloud/unikraft-provider
that referenced
this pull request
May 29, 2026
…spec
The provider was unconditionally setting `spec.Args = ["/usr/bin/bun run
/usr/src/server.ts"]` for every sandbox container. Any unikernel image
that does not ship /usr/bin/bun would hit a UKC boot assertion and crash.
Changes in this commit
- Remove the hardcode.
- Add mapContainerArgs (instance_mapper.go): maps SandboxContainer.Command
and .Args → UKC CreateInstanceRequest.Args using Kubernetes semantics:
* command + args → append(command, args...)
* command only → command
* args only → args
* neither → nil (UKC uses image's own built-in default args)
- Update instance_controller.go to call mapContainerArgs and migrate to the
updated multicluster-runtime/milo API (ClusterName typed string,
TypedEventHandlerFunc, ProviderRunnable.Start).
- Add instance_mapper_test.go: unit tests covering all four mapping cases,
full buildUnikraftSpecFromContainer passthrough (env, ports, memory),
datum/bun reference image, hello-world no-args, and template annotation.
- Update examples/instance.yaml with a comment showing command/args are
optional for the datum/bun image (its default args are baked in).
- Bump go.datum.net/compute via replace directive (local path) to pick up
the new SandboxContainer.Command and .Args fields added in
datum-cloud/compute#125. Replace the directive with a real version pin
once that PR is tagged.
The datum/bun unikernel image bakes its default command into the image's
own UKC metadata (Image.Args), so it continues to run without specifying
Command/Args in the workload spec.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…stant Four occurrences in instance_writeback_test.go triggered goconst because testInstanceType = "d1-standard-2" already exists in the same package. Replacing all four with the constant keeps golangci-lint at 0 issues. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fa711b9
into
feat/federated-deployment-scheduling
9 checks passed
This was referenced May 29, 2026
Draft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A workload's sandbox container can now specify its own entrypoint command and arguments, overriding the defaults baked into the container image. Users get direct control over how their container starts — running a different binary, passing flags, or pointing at a different script — instead of being locked to whatever the image hardcodes. When both fields are left unset, the image's own default entrypoint and arguments are used unchanged, so existing workloads see no behavior change.
This is the API half of that capability. It adds
Command []stringandArgs []stringtoSandboxContainerinapi/v1alpha/instance_types.go, mirroring Kubernetes pod-spec semantics:Commandoverrides the image's ENTRYPOINT andArgsoverrides CMD, and the two can be combined. The change includes regenerated deepcopy code and CRD manifests.These fields are intent only — the infrastructure provider reads them and passes them through to the runtime. The downstream unikraft-provider maps
command/argsonto the Pod it creates, completing the path from workload spec to a running container.Test plan
make generate manifestsruns clean; working tree unchanged after re-rungo build ./...andgo vet ./...passmake test— all packages passcommandandargsfields onSandboxContainerNotes for reviewers
This PR is stacked on #107 (
feat/federated-deployment-scheduling) and is consumed by a companion unikraft-provider passthrough change.🤖 Generated with Claude Code