- Notifications
You must be signed in to change notification settings - Fork1k
fix(agent/agentcontainers): improve testing of convertDockerInspect, return correct host port#16887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
80ac9a3
0ecceb0
55998d0
fb78d33
a7d1ea4
393f6e9
95b156e
f8f3000
999469f
8338af3
2f0180e
1ae6015
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import Link from "@mui/material/Link"; | ||
import Tooltip, { type TooltipProps } from "@mui/material/Tooltip"; | ||
import type { | ||
Workspace, | ||
WorkspaceAgentDevcontainer, | ||
@@ -10,7 +11,6 @@ import { portForwardURL } from "utils/portForward"; | ||
import { AgentButton } from "./AgentButton"; | ||
import { AgentDevcontainerSSHButton } from "./SSHButton/SSHButton"; | ||
import { TerminalLink } from "./TerminalLink/TerminalLink"; | ||
type AgentDevcontainerCardProps = { | ||
container: WorkspaceAgentDevcontainer; | ||
@@ -52,13 +52,13 @@ export const AgentDevcontainerCard: FC<AgentDevcontainerCardProps> = ({ | ||
/> | ||
{wildcardHostname !== "" && | ||
container.ports.map((port) => { | ||
const portLabel = `${port.port}/${port.network.toUpperCase()}`; | ||
const hasHostBind = | ||
port.host_port !== undefined && | ||
port.host_port !== null && | ||
port.host_ip !== undefined && | ||
port.host_ip !== null; | ||
| ||
const helperText = hasHostBind | ||
? `${port.host_ip}:${port.host_port}` | ||
: "Not bound to host"; | ||
return ( | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -4273,45 +4273,45 @@ function mockTwoDaysAgo() { | ||
return date.toISOString(); | ||
} | ||
export const MockWorkspaceAgentDevcontainerPorts: TypesGen.WorkspaceAgentDevcontainerPort[] = | ||
[ | ||
{ | ||
port: 1000, | ||
network: "tcp", | ||
host_port: 1000, | ||
host_ip: "0.0.0.0", | ||
}, | ||
{ | ||
port: 2001, | ||
network: "tcp", | ||
host_port: 2000, | ||
host_ip: "::1", | ||
}, | ||
{ | ||
port: 8888, | ||
network: "tcp", | ||
}, | ||
Comment on lines +4290 to +4293 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Just making sure: is it possible for there to be variants of the port value that have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I don't think it likely in practice. | ||
]; | ||
export const MockWorkspaceAgentDevcontainer: TypesGen.WorkspaceAgentDevcontainer = | ||
{ | ||
created_at: "2024-01-04T15:53:03.21563Z", | ||
id: "abcd1234", | ||
name: "container-1", | ||
image: "ubuntu:latest", | ||
labels: { | ||
foo: "bar", | ||
}, | ||
ports: [], | ||
running: true, | ||
status: "running", | ||
volumes: { | ||
"/mnt/volume1": "/volume1", | ||
}, | ||
}; | ||
export const MockWorkspaceAgentListContainersResponse: TypesGen.WorkspaceAgentListContainersResponse = | ||
{ | ||
containers: [MockWorkspaceAgentDevcontainer], | ||
warnings: ["This is a warning"], | ||
}; |
Uh oh!
There was an error while loading.Please reload this page.