Skip to content

feat(sdk/go)!: bundle Create() positional params into CreateSandboxParams - #3197

Closed
rhuss wants to merge 8 commits into
NVIDIA:mainfrom
rhuss:6116-go-sdk-create-params
Closed

rhuss wants to merge 8 commits into
NVIDIA:mainfrom
rhuss:6116-go-sdk-create-params

Conversation

@rhuss

@rhuss rhuss commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Bundle the Go SDK's SandboxInterface.Create() positional parameters (spec, labels) into a CreateSandboxParams struct, separating creation intent from the resolved SandboxSpec type.

Related Issue: Closes #2807

Changes

  • Added CreateSandboxParams struct in sdk/go/openshell/v1/types/sandbox.go
  • Updated SandboxInterface.Create() signature to accept CreateSandboxParams
  • Added CreateSandboxParamsToProto converter with unit tests
  • Updated all call sites: real client, fake client, tests, doc examples, README, error-handling docs
  • Breaking change: all Create() callers must use the new struct-based signature

Testing

  • All 1273 Go SDK tests pass (go test ./...)
  • go build ./... and go vet ./... pass
  • New converter tests cover: empty params, spec-only, labels-only, fully populated
  • 5-agent deep review: 0 findings
  • Spec compliance: 100% (8/8 FR, 4/4 SC)

Checklist

  • Tests pass
  • Breaking change documented in commit message (! suffix)
  • Documentation updated (README, error-handling docs, doc.go examples)
  • Signed off (DCO)

Captures design exploration for NVIDIA#2807 - bundling positional parameters
into a CreateSandboxParams struct. Evaluates three approaches (struct,
full separation, functional options) plus k8s client-go reference.
Decision: creation params struct matching existing SDK conventions.

Signed-off-by: Roland Huß <rhuss@redhat.com>
Signed-off-by: Roland Huß <rhuss@redhat.com>
Signed-off-by: Roland Huß <rhuss@redhat.com>
Signed-off-by: Roland Huß <rhuss@redhat.com>
…rams

Introduce CreateSandboxParams struct that bundles the optional spec and
labels parameters for SandboxInterface.Create(). The new signature is:

  Create(ctx, workspace, name string, params CreateSandboxParams, opts ...CreateOptions)

This replaces the previous positional parameters (spec *SandboxSpec,
labels map[string]string) with a single struct, improving call site
readability and preventing callers from needing to pass nil for unused
fields.

Add CreateSandboxParamsToProto converter with full test coverage.
Update all call sites: real client, fake client, tests, docs, and
examples.

BREAKING CHANGE: SandboxInterface.Create() signature changed.
Callers must wrap spec and labels in a CreateSandboxParams struct.

Closes NVIDIA#2807

Signed-off-by: Roland Huß <rhuss@redhat.com>
Signed-off-by: Roland Huß <rhuss@redhat.com>
@copy-pr-bot

copy-pr-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@rhuss
rhuss marked this pull request as draft September 5, 2026 04:36
Spec artifacts are local development files that should not be part of
the PR. They are excluded via .git/info/exclude going forward.

Signed-off-by: Roland Huß <rhuss@redhat.com>
Signed-off-by: Roland Huß <rhuss@redhat.com>
@rhuss

rhuss commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Closing this PR. After deeper investigation, the original premise was incorrect: DriverConfig is a user-provided field, not a gateway-resolved leak, so a separate creation type isn't needed. The real fix should be coordinated with #2781 by keeping *SandboxSpec as the single creation input and using functional options for metadata fields. See the revised analysis on #2807.

@rhuss rhuss closed this Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(sdk/go): bundle Create() positional parameters into options struct

1 participant