Skip to content

Commit

Permalink
chore(milvus): embed etcd should use default ports
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Feb 21, 2024
1 parent 154cb34 commit d96395e
Showing 1 changed file with 0 additions and 21 deletions.
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
}

0 comments on commit d96395e

Please sign in to comment.