Skip to content

Commit dc560e0

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 84d24c1 commit dc560e0

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
@@ -307,18 +307,16 @@ def logs(pod_name: str, follow: bool):
307307

308308

309309
def _logs(pod_name: str, follow: bool):
310-
namespace = get_default_namespace()
311-
312310
if pod_name == "":
313311
try:
314312
pods = get_pods()
315313
pod_list = [item.metadata.name for item in pods.items]
316314
except Exception as e:
317-
print(f"Could not fetch any pods in namespace {namespace}: {e}")
315+
print(f"Could not fetch any pods: {e}")
318316
return
319317

320318
if not pod_list:
321-
print(f"Could not fetch any pods in namespace {namespace}")
319+
print("Could not fetch any pods")
322320
return
323321

324322
q = [

0 commit comments

Comments
 (0)