Commit b08f5f08 authored by Yann Hodique's avatar Yann Hodique Committed by GitHub

feat(kurtosis-devnet): expose private ports (#13789)

parent 0c940ad3
...@@ -3,6 +3,7 @@ package descriptors ...@@ -3,6 +3,7 @@ package descriptors
type PortInfo struct { type PortInfo struct {
Host string `json:"host"` Host string `json:"host"`
Port int `json:"port"` Port int `json:"port"`
PrivatePort int `json:"private_port"`
} }
// EndpointMap is a map of service names to their endpoints. // EndpointMap is a map of service names to their endpoints.
......
...@@ -71,6 +71,14 @@ func (e *Inspector) ExtractData(ctx context.Context) (*InspectData, error) { ...@@ -71,6 +71,14 @@ func (e *Inspector) ExtractData(ctx context.Context) (*InspectData, error) {
} }
} }
for port, portSpec := range svcCtx.GetPrivatePorts() {
// avoid non-mapped ports, we shouldn't have to use them.
if p, ok := portMap[port]; ok {
p.PrivatePort = int(portSpec.GetNumber())
portMap[port] = p
}
}
if len(portMap) != 0 { if len(portMap) != 0 {
data.UserServices[svc] = portMap data.UserServices[svc] = portMap
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment