Skip to content

Commit

Permalink
chore: linter again
Browse files Browse the repository at this point in the history
  • Loading branch information
TimBeyer committed Aug 18, 2023
1 parent 2ba7f02 commit e1360e0
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions core/src/plugins/kubernetes/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,23 +306,23 @@ export async function cleanupEnvironment({

// Here, we only want to delete namespaces generated by Garden.
const namespacesToDelete = // TODO: This is only mapping over a single thing
// so it should be rewritten to not map
(
await Promise.all(
[namespace].map(async (ns) => {
try {
const annotations = (await api.core.readNamespace(ns)).metadata.annotations || {}
return annotations[gardenAnnotationKey("generated")] === "true" ? ns : null
} catch (err) {
if (err.statusCode === 404) {
return null
} else {
throw err
// so it should be rewritten to not map
(
await Promise.all(
[namespace].map(async (ns) => {
try {
const annotations = (await api.core.readNamespace(ns)).metadata.annotations || {}
return annotations[gardenAnnotationKey("generated")] === "true" ? ns : null
} catch (err) {
if (err.statusCode === 404) {
return null
} else {
throw err
}
}
}
})
)
).filter(Boolean)
})
)
).filter(Boolean)

if (namespacesToDelete.length === 0) {
return {}
Expand Down

0 comments on commit e1360e0

Please sign in to comment.