Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ser-io
Copy link
Member

@ser-io ser-io commented Feb 26, 2025

No description provided.

@ser-io ser-io force-pushed the fixed-port branch 2 times, most recently from a240408 to 7a81643 Compare February 27, 2025 18:35
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)
Copy link
Member

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?

Copy link
Member Author

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.

Comment on lines 142 to 151
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)
}
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, used ContainerInspect.

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.

2 participants