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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user