Pass src_file and dest_filename in kubectl.create_pvc_with_content 92/14592/1
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 24 Sep 2024 12:41:40 +0000 (14:41 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 24 Sep 2024 12:41:40 +0000 (14:41 +0200)
Change-Id: I81d530c170aad0f3d4e84ef9b687863a4c1983b9
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
n2vc/kubectl.py

index f7a0886..7e15269 100644 (file)
@@ -926,15 +926,15 @@ class Kubectl:
         fallback=Exception("Failed creating the pvc"),
     )
     async def create_pvc_with_content(
-        self, name: str, namespace: str, src_folder: str, filename: str
+        self, name: str, namespace: str, src_file: str, dest_filename: str
     ):
         """
         Create a PVC with content
 
         :param: name:       Name of the pvc to be created
         :param: namespace:  Name of the namespace where the pvc will be stored
-        :param: src_folder: Folder where the file to be copied is located
-        :param: filename:   Name of the file to be copied
+        :param: src_file:   File to be copied
+        :param: filename:   Name of the file in the destination folder
         """
         pod_name = f"copy-pod-{name}"
         await self.create_pvc(name=name, namespace=namespace)
@@ -943,8 +943,8 @@ class Kubectl:
             namespace=namespace,
             pod_name=pod_name,
             container_name="copy-container",
-            src_file=f"{src_folder}/{filename}",
-            dest_path=f"/mnt/data/{filename}",
+            src_file=src_file,
+            dest_path=f"/mnt/data/{dest_filename}",
         )
 
     @retry(