Skip to content

Commit

Permalink
shortening line
Browse files Browse the repository at this point in the history
  • Loading branch information
paigerube14 committed Nov 7, 2024
1 parent b276603 commit 50ffc54
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/krkn_lib/k8s/krkn_kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1913,7 +1913,6 @@ def get_kubernetes_core_objects_count(
:return: a dictionary of Kinds and the number of objects counted
"""


result = dict[str, int]()

try:
Expand Down Expand Up @@ -1948,7 +1947,6 @@ def get_kubernetes_core_objects_count(
except ApiException:
pass
return result


def get_kubernetes_custom_objects_count(
self, objects: list[str]
Expand Down Expand Up @@ -1979,12 +1977,11 @@ def get_kubernetes_custom_objects_count(
)
for resource in data.resources:
if resource.kind in objects:
custom_resource = (
self.custom_object_client.list_cluster_custom_object(
group=api.name,
version=api.preferred_version.version,
plural=resource.name,
)
cust_cli = self.custom_object_client
custom_resource = cust_cli.list_cluster_custom_object(
group=api.name,
version=api.preferred_version.version,
plural=resource.name,
)
result[resource.kind] = len(custom_resource["items"])

Expand All @@ -1994,7 +1991,9 @@ def get_kubernetes_custom_objects_count(

def get_api_resources_by_group(self, group, version):
try:
api_response = self.custom_object_client.get_api_resources(group,version)
api_response = self.custom_object_client.get_api_resources(
group, version
)
return api_response
except Exception:
pass
Expand Down

0 comments on commit 50ffc54

Please sign in to comment.