lordgamez commented on code in PR #1322:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1322#discussion_r866850528


##########
docker/test/integration/minifi/core/KindProxy.py:
##########
@@ -93,14 +102,23 @@ def __create_objects_of_type(self, directory, type):
             file_name_in_container = os.path.join('/var/tmp', file_name)
             self.__copy_file_to_container(full_file_name, 
'kind-control-plane', file_name_in_container)
 
-            (code, output) = 
self.docker_client.containers.get('kind-control-plane').exec_run(['kubectl', 
'apply', '-f', file_name_in_container])
+            (code, _) = 
self.docker_client.containers.get('kind-control-plane').exec_run(['kubectl', 
'apply', '-f', file_name_in_container])
             if code != 0:
                 raise Exception("Could not create kubernetes object from file 
'%s'" % full_file_name)
 
             object_name = file_name.replace(f'.{type}.yml', '')
             found_objects.append(object_name)
         return found_objects
 
+    def __delete_objects_of_type(self, type):
+        for full_file_name in 
glob.iglob(os.path.join(self.resources_directory, f'*.{type}.yml')):
+            file_name = os.path.basename(full_file_name)
+            file_name_in_container = os.path.join('/var/tmp', file_name)
+
+            (code, _) = 
self.docker_client.containers.get('kind-control-plane').exec_run(['kubectl', 
'delete', '-f', file_name_in_container, '--grace-period=0', '--force'])
+            if code != 0:
+                raise Exception("Could not delete kubernetes object from file 
'%s'" % file_name_in_container)

Review Comment:
   I'm not sure I understand. The purpose of this function is to delete the 
kubernetes objects defined in the test cluster, cleaning up after each test 
scenario, so the next test case can use the empty kind cluster. The file needs 
to be there for the `kubectl delete` command to know which objects to delete.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to