Expose number of containers attached to a conmon-rs process
Opened this issue · 5 comments
As part of the conmon-rs integration with podman, we need a way of querying conmon-rs to get the number of containers already attached to a single conmon-rs process.
This will help us determine whether to add a new container to an existing conmon-rs or to create a new conmon-rs process because we have reached the allowed limit.
Podman plans to keep a list of active conmon-rs processes so that we can go through those and query the number of containers attached to each one before making a decision.
@haircommander PTAL
would a ListContainers like API be useful? instead of just the number, include the IDs as well?
Yes, that would be even better!
This will help us determine whether to add a new container to an existing conmon-rs or to create a new conmon-rs process because we have reached the allowed limit.
Is this something we should handle directly in conmon-rs (the golang client/API of it)?
@saschagrunert yes I believe so. The plan is to use a conmon-rs id (or whatever its unique attribute is) and call the conmon-rs API with that id to get a list of containers (or number of containers) currently attached to that conmon-rs process.
This is the workflow I had in mind, but open to other ideas as well :)