Skip to content

Commit bc09bf1

Browse files
committed
control: remove contrived get_default_namespace
This use of get_default_namespace relies on the brittle idea that get_pods will always use get_default_namespace. Currently, get_pods currently does, in fact, use get_default_namespace. However, I don't like that we use get_default_namespace out of band relative to get_pods. I'd prefer that we do not mention namespaces at all in our message to users unless we can prove it.
1 parent 2033ff4 commit bc09bf1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/warnet/control.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,18 +261,16 @@ def logs(pod_name: str, follow: bool):
261261

262262

263263
def _logs(pod_name: str, follow: bool):
264-
namespace = get_default_namespace()
265-
266264
if pod_name == "":
267265
try:
268266
pods = get_pods()
269267
pod_list = [item.metadata.name for item in pods.items]
270268
except Exception as e:
271-
print(f"Could not fetch any pods in namespace {namespace}: {e}")
269+
print(f"Could not fetch any pods: {e}")
272270
return
273271

274272
if not pod_list:
275-
print(f"Could not fetch any pods in namespace {namespace}")
273+
print("Could not fetch any pods")
276274
return
277275

278276
q = [

0 commit comments

Comments
 (0)