diff --git a/internal/room/containers.go b/internal/room/containers.go index 1603c49..882a924 100644 --- a/internal/room/containers.go +++ b/internal/room/containers.go @@ -82,7 +82,7 @@ func (manager *RoomManagerCtx) containerById(ctx context.Context, id string) (*d func (manager *RoomManagerCtx) containerByName(ctx context.Context, name string) (*dockerTypes.Container, error) { return manager.containerFilter(ctx, filters.NewArgs( - filters.Arg("name", manager.config.InstanceName+"-"+name), + filters.Arg("label", fmt.Sprintf("m1k1o.neko_rooms.name=%s", name)), )) } diff --git a/internal/room/manager.go b/internal/room/manager.go index c1850aa..bdef7ff 100644 --- a/internal/room/manager.go +++ b/internal/room/manager.go @@ -712,18 +712,7 @@ func (manager *RoomManagerCtx) GetEntryByName(ctx context.Context, name string) return nil, err } - roomEntry, err := manager.containerToEntry(*container) - if err != nil { - return nil, err - } - - // we can match containers starting with given name - // but we want to match only exact name - if roomEntry.Name != name { - return nil, types.ErrRoomNotFound - } - - return roomEntry, nil + return manager.containerToEntry(*container) } func (manager *RoomManagerCtx) Remove(ctx context.Context, id string) error {