Skip to content

Add comment around default network of docker on getIpAddr of docker.go#511

Open
0405ysj wants to merge 1 commit intogoogle:mainfrom
0405ysj:co_doc
Open

Add comment around default network of docker on getIpAddr of docker.go#511
0405ysj wants to merge 1 commit intogoogle:mainfrom
0405ysj:co_doc

Conversation

@0405ysj
Copy link
Collaborator

@0405ysj 0405ysj commented Feb 25, 2026

No description provided.

}

func (m *DockerInstanceManager) getIpAddr(container *types.Container) (string, error) {
// When creating docker instances as default, docker instance gets belonged
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would actually attach the comment on createDockerContainer.

Copy link
Member

Choose a reason for hiding this comment

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

Agree, we should add this comment to an Instance Manger public method implementation. I think GetHostClient is more relevant here, CreateHost could be used as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Rather than CreateHost, I think GetHostClient is suitable place as it deals with Host Orchestrator URL. In fact, CreateHost doesn't do special things around docker instance's IP address.

}

func (m *DockerInstanceManager) getIpAddr(container *types.Container) (string, error) {
// When creating docker instances as default, docker instance gets belonged
Copy link
Member

Choose a reason for hiding this comment

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

Agree, we should add this comment to an Instance Manger public method implementation. I think GetHostClient is more relevant here, CreateHost could be used as well.

@0405ysj 0405ysj force-pushed the co_doc branch 2 times, most recently from e9d516c to 807de99 Compare February 26, 2026 00:58
return nil
}

func (m *DockerInstanceManager) createDockerContainer(ctx context.Context, user accounts.User) (string, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// createDockerContainer creates the cuttlefish host orchestrator container.
// The container is expected to have:
// - an entrypoint set that starts the host orchestrator,
// - network access through the default docker0 bridge interface, and
// - a preconfigured volume created for sharing artifacts (see `uaVolumeName`).
// While the container image name is configurable, we do not intend or want
// to support other containers or alternative command execution in config.
func (m *DockerInstanceManager) createDockerContainer(ctx context.Context, user accounts.User) (string, error) {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Applied your suggestion, but I placed some in the different place.

@0405ysj 0405ysj force-pushed the co_doc branch 2 times, most recently from 5e913a2 to d8e5449 Compare February 27, 2026 08:06
@0405ysj 0405ysj requested a review from 3405691582 February 27, 2026 08:06
const DockerIMType IMType = "docker"

type DockerIMConfig struct {
// We don't intend to support any customized docker images except
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should probably be made into a proper godoc comment for the struct.

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.

3 participants