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

chore(milvus): embed etcd should use default ports #2258

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions modules/milvus/milvus.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomize
// Otherwise the milvus container will panic on startup.
createDefaultEmbedEtcdConfig,
},
PostStarts: []testcontainers.ContainerHook{regenerateEmbedEtcdConfig},
},
},
}
Expand Down Expand Up @@ -129,23 +128,3 @@ func createDefaultEmbedEtcdConfig(ctx context.Context, c testcontainers.Containe

return nil
}

// regenerateEmbedEtcdConfig updates the embed etcd config file with the mapped port
func regenerateEmbedEtcdConfig(ctx context.Context, c testcontainers.Container) error {
containerPort, err := c.MappedPort(ctx, "2379/tcp")
if err != nil {
return fmt.Errorf("failed to get mapped port: %w", err)
}

embedEtcdConfig, err := renderEmbedEtcdConfig(containerPort.Int())
if err != nil {
return fmt.Errorf("failed to embed etcd config: %w", err)
}

err = c.CopyToContainer(ctx, embedEtcdConfig, embedEtcdContainerPath, 600)
if err != nil {
return fmt.Errorf("failed to copy embedEtcd.yaml into container: %w", err)
}

return nil
}
Loading