From b7a3c08087f8f88bffd15146727211d5ca980836 Mon Sep 17 00:00:00 2001 From: Andrew Rowson Date: Wed, 13 Mar 2024 17:28:21 +0000 Subject: [PATCH] JSON stringify and output the whole context in the prompt --- bin/k8s-csi-cleaner | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/k8s-csi-cleaner b/bin/k8s-csi-cleaner index 3ea5eea..dc9744f 100755 --- a/bin/k8s-csi-cleaner +++ b/bin/k8s-csi-cleaner @@ -127,7 +127,7 @@ async function main() { for (let csiVolume of csiVolumes) { let volume_id = csiVolume.volume.volume_id; - let volume_iqn = csiVolume.volume.volume_context.iqn || "Unknown"; + let volume_context = JSON.stringify(csiVolume.volume.volume_context) || "Unknown"; //console.log(`processing csi volume ${volume_id}`); let k8sVolume = k8sVolumes.find((i_k8sVolume) => { let volume_handle = _.get(i_k8sVolume, "spec.csi.volumeHandle", null); @@ -135,7 +135,7 @@ async function main() { }); if (!k8sVolume) { - console.log(`volume ${volume_id} (${volume_iqn}) is NOT in k8s`); + console.log(`volume ${volume_id} (${volume_context}) is NOT in k8s`); if (process.env.DRY_RUN == "1") { continue; } @@ -160,7 +160,7 @@ async function main() { console.log(`skipping delete of csi volume ${volume_id}`); } } else { - console.log(`volume ${volume_id} (${volume_iqn}) is in k8s`); + console.log(`volume ${volume_id} (${volume_context}) is in k8s`); } }