Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions utils/apiUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,17 @@ module.exports = {
}

// get all pods that match the provided label
let podsNames = await bash.runCommand(`g3kubectl get pod --sort-by=.metadata.creationTimestamp -l app=${labelName} -o jsonpath="{.items[*].metadata.name}"`);
console.log(`Found pods with label '${labelName}': ${podsNames}`);
let count = 0;
let podsNames;
while (podsNames === undefined && count < 5) {
podsNames = await bash.runCommand(`g3kubectl get pod --sort-by=.metadata.creationTimestamp -l app=${labelName} -o jsonpath="{.items[*].metadata.name}"`);
console.log(`Found pods with label '${labelName}': ${podsNames}`);
await sleepMS(2000)
count++;
}
if (podsNames === undefined) {
throw new Error(`THE POD name with ${labelName} returned undefined even after 5 tries. GIVING UP.`);
}

// if there's more than 1 pod matching the provided name, the last one
// is the most recent (`--sort-by=.metadata.creationTimestamp`)
Expand Down
Loading