Skip to content

Commit

Permalink
fix(k8s): errors in cleanup-cluster-registry command
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald authored and eysi09 committed May 10, 2021
1 parent 54f50e4 commit e17d936
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions core/src/plugins/kubernetes/commands/cleanup-cluster-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ async function runRegistryGarbageCollection(ctx: KubernetesPluginContext, api: K
log,
serviceName: "docker-registry",
resources: [modifiedDeployment],
// The progress deadline is fairly high, so the timeout needs to be extended
timeoutSec: 1000,
})

// Run garbage collection
Expand Down Expand Up @@ -311,6 +313,8 @@ async function runRegistryGarbageCollection(ctx: KubernetesPluginContext, api: K
log,
serviceName: "docker-registry",
resources: [modifiedDeployment],
// The progress deadline is fairly high, so the timeout needs to be extended
timeoutSec: 1000,
})
}

Expand Down Expand Up @@ -465,17 +469,24 @@ async function cleanupBuildSyncVolume({
// Delete the directories
log.info(`Deleting ${dirsToDelete.length} workspace directories.`)

let deleted = 0

await Bluebird.map(
chunk(dirsToDelete, 100),
() =>
runner.exec({
async (dirs) => {
await runner.exec({
log,
command: ["rm", "-rf", ...dirsToDelete],
command: ["rm", "-rf", ...dirs],
timeoutSec: 300,
buffer: true,
}),
})
deleted += dirs.length
log.info(`-> ${deleted} / ${dirsToDelete.length}`)
},
{ concurrency: 20 }
)

log.info("Done!")

log.setSuccess()
}

0 comments on commit e17d936

Please sign in to comment.