mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-10-05 09:53:21 +08:00
Fixes prometheus gauges
Fix session close. Now PWD gets disconnected from network before deleting it.
This commit is contained in:
@@ -142,6 +142,17 @@ func ConnectNetwork(containerId, networkId string) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
func DisconnectNetwork(containerId, networkId string) error {
|
||||
err := c.NetworkDisconnect(context.Background(), networkId, containerId, true)
|
||||
|
||||
if err != nil {
|
||||
log.Printf("Disconnection of container from network err [%s]\n", err)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeleteNetwork(id string) error {
|
||||
err := c.NetworkRemove(context.Background(), id)
|
||||
|
Reference in New Issue
Block a user