Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance : don't retrieve all namespaces when checking if one exists #414

Merged
merged 2 commits into from
Apr 10, 2024
Merged
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
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