Skip to content

Commit

Permalink
fix: waitForPod
Browse files Browse the repository at this point in the history
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
  • Loading branch information
leninmehedy committed Jan 24, 2024
1 parent 1194025 commit 5ba143c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fullstack-network-manager/src/core/kubectl2.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ export class Kubectl2 {
this.logger.debug(`WaitForPod [${fieldSelector}, ${labelSelector}], maxAttempts: ${maxAttempts}`)

return new Promise((resolve, reject) => {
const attempts = 0
let attempts = 0

const check = async () => {
this.logger.debug(`Checking for pod ${fieldSelector}, ${labelSelector} [attempt: ${attempts}/${maxAttempts}]`)
Expand All @@ -626,7 +626,7 @@ export class Kubectl2 {
return resolve(true)
}

if (attempts < maxAttempts) {
if (attempts++ < maxAttempts) {
setTimeout(check, delay)
} else {
reject(new FullstackTestingError(`Expected number of pod (${podCount}) not found ${fieldSelector} ${labelSelector} [maxAttempts = ${maxAttempts}]`))
Expand Down

0 comments on commit 5ba143c

Please sign in to comment.