* Removes a Docker network if it exists * @param {Object} params * @param {string} params.networkName - Name of the network to remove * @returns {Promise }
({ networkName })
| 909 | * @returns {Promise<void>} |
| 910 | */ |
| 911 | async removeNetwork({ networkName }) { |
| 912 | try { |
| 913 | const network = this.getNetwork({ networkName }) |
| 914 | await network.remove() |
| 915 | } catch (error) { |
| 916 | if (error.statusCode !== 404) { |
| 917 | throw error |
| 918 | } |
| 919 | // Network doesn't exist, that's fine |
| 920 | this.logger.debug( |
| 921 | `Network ${networkName} doesn't exist, skipping removal`, |
| 922 | ) |
| 923 | } |
| 924 | } |
| 925 | } |
| 926 | |
| 927 | export { DockerClient } |
no test coverage detected