* Removes a Docker network if it exists * @param {Object} params * @param {string} params.networkName - Name of the network to remove * @returns {Promise }
({ networkName })
| 882 | * @returns {Promise<void>} |
| 883 | */ |
| 884 | async removeNetworkIfExists({ networkName }) { |
| 885 | const networks = await this.client.listNetworks() |
| 886 | const network = networks.find((n) => n.Name === networkName) |
| 887 | |
| 888 | if (network) { |
| 889 | this.logger.debug(`Removing Docker network: ${networkName}`) |
| 890 | const networkInstance = this.client.getNetwork(network.Id) |
| 891 | await networkInstance.remove() |
| 892 | } |
| 893 | } |
| 894 | |
| 895 | /** |
| 896 | * Gets a Docker network by name |
nothing calls this directly
no test coverage detected