Skip to content

go e2b sdk support custom HTTP client and extend sandbox params#38

Open
ZhaoQing7892 wants to merge 2 commits into
openkruise:masterfrom
ZhaoQing7892:fix_e2b_go_sdk
Open

go e2b sdk support custom HTTP client and extend sandbox params#38
ZhaoQing7892 wants to merge 2 commits into
openkruise:masterfrom
ZhaoQing7892:fix_e2b_go_sdk

Conversation

@ZhaoQing7892

Copy link
Copy Markdown
Contributor
  • Add CustomHTTPClient option to e2b SDK for flexible transport configuration
  • Add extended parameters to sandbox query

- Add CustomHTTPClient option to e2b SDK for flexible transport configuration
- Add extended parameters to sandbox query
@kruise-bot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Comment thread e2b/sandbox_api.go
MemoryMB: sb.GetMemoryMB(),
DiskSizeMB: sb.GetDiskSizeMB(),
EnvdVersion: sb.GetEnvdVersion(),
State: string(sb.GetState()),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new VolumeMounts field was added to SandboxInfo (line 28), and the API response type SandboxesGet200ResponseInner includes VolumeMounts (with a GetVolumeMounts() getter). However, convertToSandboxInfo never copies it, so the field will always be empty/nil in List results.

In addition, GetInfo does not populate VolumeMounts either

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

Comment thread e2b/sandbox_api.go
req := s.apiClient.SandboxesApi.V2SandboxesGet(ctx)

if len(opts) > 0 {
o := opts[0]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why choose only the first opts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The params is ...ListSandboxOpts optional

Comment thread e2b/sandbox_api.go
State string
SandboxID string
TemplateID string
Alias string

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alias is never populated in the code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants