Add a way to retrieve all network aliases for a ctr

The original interface only allowed retrieving aliases for a
specific network, not for all networks. This will allow aliases
to be retrieved for every network the container is present in,
in a single DB operation.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
Matthew Heon
2020-10-27 15:50:03 -04:00
parent 6af7e54463
commit 63efde15f1
3 changed files with 105 additions and 1 deletions

View File

@ -100,6 +100,8 @@ type State interface {
// Get network aliases for the given container in the given network.
GetNetworkAliases(ctr *Container, network string) ([]string, error)
// Get all network aliases for the given container.
GetAllNetworkAliases(ctr *Container) (map[string][]string, error)
// Set network aliases for the given container in the given network.
SetNetworkAliases(ctr *Container, network string, aliases []string) error
// Remove network aliases for the given container in the given network.