Skip to content

Commit

Permalink
Performance : don't retrieve all namespaces when checking if one exis…
Browse files Browse the repository at this point in the history
…ts (#414)
  • Loading branch information
olevitt authored Apr 10, 2024
1 parent dd7c487 commit f50c16c
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,11 @@ private String createNamespace(Region region, String namespaceId, Owner owner) {

private boolean isNamespaceAlreadyExisting(Region region, String namespaceId) {
return kubernetesClientProvider
.getRootClient(region)
.namespaces()
.list()
.getItems()
.stream()
.anyMatch(ns -> ns.getMetadata().getName().equals(namespaceId));
.getRootClient(region)
.namespaces()
.withName(namespaceId)
.get()
!= null;
}

private void applyQuotas(
Expand Down

0 comments on commit f50c16c

Please sign in to comment.