Skip to content

Commit 666ef88

Browse files
committed
Add defensive escaping per copilot comment
1 parent e4880da commit 666ef88

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

runpod/api/mutations/pods.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ def generate_pod_deployment_mutation(
9595
input_fields.append(f"allowedCudaVersions: [{cuda_versions}]")
9696

9797
if container_registry_auth_id is not None:
98-
input_fields.append(f'containerRegistryAuthId: "{container_registry_auth_id}"')
98+
escaped_auth_id = (
99+
container_registry_auth_id.replace(
100+
"\\", "\\\\").replace('"', "\\\"")
101+
)
102+
input_fields.append(f'containerRegistryAuthId: "{escaped_auth_id}"')
99103

100104
# CPU Pod Fields
101105
else:

0 commit comments

Comments
 (0)