Skip to content

Commit

Permalink
fix container by name.
Browse files Browse the repository at this point in the history
  • Loading branch information
m1k1o committed Nov 4, 2023
1 parent 0349af9 commit 0a1f150
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
2 changes: 1 addition & 1 deletion internal/room/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
))
}

Expand Down
13 changes: 1 addition & 12 deletions internal/room/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0a1f150

Please sign in to comment.