fix(agent/agentcontainers): improve testing of convertDockerInspect, return correct host port (#16887)

* Improves separation of concerns between `runDockerInspect` and
`convertDockerInspect`: `runDockerInspect` now just runs the command and
returns the output, while `convertDockerInspect` now does all of the
conversion and parsing logic.
* Improves testing of `convertDockerInspect` using real test fixtures.
* Fixes issue where the container port is returned instead of the host
port.
* Updates UI to link to correct host port. Container port is still
displayed in the button text, but the HostIP:HostPort is shown in a
popover.
* Adds stories for workspace agent UI
This commit is contained in:
Cian Johnston
2025-03-18 14:37:45 +00:00
committed by GitHub
parent 13d0dac795
commit 75b27e8f19
22 changed files with 2612 additions and 114 deletions

View File

@ -1173,10 +1173,12 @@ func TestWorkspaceAgentContainers(t *testing.T) {
Labels: testLabels,
Running: true,
Status: "running",
Ports: []codersdk.WorkspaceAgentListeningPort{
Ports: []codersdk.WorkspaceAgentDevcontainerPort{
{
Network: "tcp",
Port: 80,
Network: "tcp",
Port: 80,
HostIP: "0.0.0.0",
HostPort: 8000,
},
},
Volumes: map[string]string{