Skip to content

Comments

feat: support single integer input in PortMapping.fromString#1467

Merged
martin-helmich merged 2 commits intomasterfrom
feat/port-mapping-single-integer
Oct 30, 2025
Merged

feat: support single integer input in PortMapping.fromString#1467
martin-helmich merged 2 commits intomasterfrom
feat/port-mapping-single-integer

Conversation

@martin-helmich
Copy link
Member

Summary

  • PortMapping.fromString() now accepts single port numbers (e.g., "8080") in addition to the existing colon-separated format (e.g., "8080:9090")
  • When a single port is provided, it maps to identical local and remote ports
  • This simplifies the common case where port forwarding uses the same port on both sides

🤖 Generated with Claude Code

martin-helmich and others added 2 commits October 28, 2025 10:54
Extended PortMapping.fromString() to accept single integers (e.g., "8080")
which map to identical local and remote ports. This simplifies the common
case where port forwarding uses the same port on both sides.

- Added parseAndValidatePort helper to consolidate validation logic
- Added isValidPortString to validate integer format before parsing
- Added test cases for single integer input and invalid single port
- Maintained backward compatibility with colon-separated format

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Updated documentation for container commands to reflect the new single port
format support and corrected port mapping descriptions:

- container port-forward: Added documentation for single port format
- container run: Corrected port mapping description (cluster ports, not host
  ports) and documented single port format
- container update: Corrected port mapping description and documented single
  port format

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@martin-helmich martin-helmich force-pushed the feat/port-mapping-single-integer branch from 0288c47 to ae05a44 Compare October 28, 2025 10:59
@martin-helmich martin-helmich merged commit a83a0f3 into master Oct 30, 2025
11 checks passed
@martin-helmich martin-helmich deleted the feat/port-mapping-single-integer branch October 30, 2025 08:27
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.

1 participant