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)
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(