-
Notifications
You must be signed in to change notification settings - Fork 127
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid using harcoded HO port values. #890
base: main
Are you sure you want to change the base?
Conversation
a240408
to
7a81643
Compare
if err != nil { | ||
return nil, err | ||
} | ||
result.DockerContainerID = id | ||
result.ServiceURL = fmt.Sprintf("http://0.0.0.0:%d", port) | ||
result.ServiceURL = fmt.Sprintf("http://%s:2080", ipAddr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can 2080 not be hardcoded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docker image used in the e2e tests have the HO running at 2080 and we don't have logic in place to update the container and change the HO port.
I used a const for the value though.
var found *types.Container | ||
for _, container := range listRes { | ||
if container.ID == id { | ||
found = &container | ||
break | ||
} | ||
} | ||
if found == nil { | ||
return "", fmt.Errorf("container not found: %q", id) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of looping over all containers here, could the client have a ContainerById
method instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, used ContainerInspect.
No description provided.