Eis-D-Z commented on a change in pull request #1477:
URL: https://github.com/apache/libcloud/pull/1477#discussion_r475517680
##########
File path: libcloud/compute/drivers/kubevirt.py
##########
@@ -167,10 +165,17 @@ def destroy_node(self, node):
"""
namespace = node.extra['namespace']
name = node.name
- # stop the vmi first
+ # find and delete services for this VM only
+ services = self.ex_list_services(namespace=namespace, node_name=name)
+ for service in services:
+ service_type = service['spec']['type']
+ self.ex_create_service(node=node, ports=[],
Review comment:
Hey,
An empty ports will result in the service being deleted. The
`override_existing_ports` argument was added because there is no general
standard in case there already are some ports forwarded and a user requests
additional ports to be opened. Sometimes he might want to keep the previous,
sometimes not. I thought it would be better to spare the user from manually
deleting in the second case (also I was not brilliant enough to have an
`ex_delete_service` which makes a lot of sense).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]