flyte
flyte copied to clipboard
feat: add custom port support for sandbox
Tracking issue
Closes #7346
Why are the changes needed?
The sandbox currently uses fixed port mappings by default. This becomes an issue when those ports are already occupied on the local machine, making it difficult to start the sandbox in some development environments.
What changes were proposed in this pull request?
This PR adds support for custom sandbox port mappings through a new --ports flag.
Changes made:
- Added a
Portsfield to the sandbox configuration. - Updated sandbox startup logic to use custom ports when provided.
- Updated Docker port parsing to accept user-defined mappings.
- Preserved the existing default behavior when custom ports are not specified.
Example usage:
flytectl sandbox start --ports 8080:30081
How was this patch tested?
- Ran
go build ./... - Verified that the sandbox commands compile successfully.
- Checked that
flytectl sandbox start --helpshows the new--portsflag correctly.
Checklist
- [x] All commits are signed-off.
- [x] Verified changes locally.