aboutsummaryrefslogtreecommitdiff
path: root/libpod/state.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2020-10-29 14:27:36 -0400
committerMatthew Heon <mheon@redhat.com>2020-11-03 16:26:42 -0500
commit844d540d042fe7477e62f8cf28e524fcd756f6c8 (patch)
tree42ff7cfba8d1216e56e7791560c21230333411d1 /libpod/state.go
parent63efde15f14b18f5af385e89936b4ab0868cb357 (diff)
downloadpodman-844d540d042fe7477e62f8cf28e524fcd756f6c8.tar.gz
podman-844d540d042fe7477e62f8cf28e524fcd756f6c8.tar.bz2
podman-844d540d042fe7477e62f8cf28e524fcd756f6c8.zip
Add tests for network aliases
As part of this, we need two new functions, for retrieving all aliases for a network and removing all aliases for a network, both required to test. Also, rework handling for some things the tests discovered were broken (notably conflicts between container name and existing aliases). Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/state.go')
-rw-r--r--libpod/state.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/libpod/state.go b/libpod/state.go
index 6b178ec58..183f773b5 100644
--- a/libpod/state.go
+++ b/libpod/state.go
@@ -106,6 +106,12 @@ type State interface {
SetNetworkAliases(ctr *Container, network string, aliases []string) error
// Remove network aliases for the given container in the given network.
RemoveNetworkAliases(ctr *Container, network string) error
+ // GetAllAliasesForNetwork returns all the aliases for a given
+ // network. Returns a map of alias to container ID.
+ GetAllAliasesForNetwork(network string) (map[string]string, error)
+ // RemoveAllAliasesForNetwork removes all the aliases for a given
+ // network.
+ RemoveAllAliasesForNetwork(network string) error
// Return a container config from the database by full ID
GetContainerConfig(id string) (*ContainerConfig, error)