MCPcopy Index your code
hub / github.com/serverless/serverless / removeNetwork

Method removeNetwork

packages/util/src/docker/index.js:911–924  ·  view source on GitHub ↗

* Removes a Docker network if it exists * @param {Object} params * @param {string} params.networkName - Name of the network to remove * @returns {Promise }

({ networkName })

Source from the content-addressed store, hash-verified

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
927export { DockerClient }

Callers 1

#cleanupMethod · 0.80

Calls 3

getNetworkMethod · 0.95
debugMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected