fix: verify PVC exists after creation in ensureAgentDbPvc

Before creating a PVC, ensureAgentDbPvc checks if it exists and creates
it if not. However, the Kubernetes API may return a Success response
without actually creating the resource. This commit adds a verification
step after createPvc to confirm the PVC actually exists before returning.

Fixes FAR-84.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-04-25 21:28:29 +00:00
parent 1de9b67fd3
commit 6accb424d4
5 changed files with 14 additions and 3 deletions
+5
View File
@@ -897,6 +897,11 @@ export async function ensureAgentDbPvc(
},
}, kubeconfigPath);
const verified = await getPvc(namespace, pvcName, kubeconfigPath);
if (!verified) {
throw new Error(`PVC ${pvcName} was not created in namespace ${namespace}`);
}
return pvcName;
}