Skip to content

Commit 38e5391

Browse files
committed
k8s: ignore internal namespaces
1 parent 1a4f065 commit 38e5391

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/warnet/k8s.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
CADDY_INGRESS_NAME,
1818
DEFAULT_NAMESPACE,
1919
INGRESS_NAMESPACE,
20+
KUBE_INTERNAL_NAMESPACES,
2021
KUBECONFIG,
2122
LOGGING_NAMESPACE,
2223
)
@@ -362,7 +363,11 @@ def get_kubeconfig_value(jsonpath):
362363
def get_namespaces() -> list[V1Namespace]:
363364
sclient = get_static_client()
364365
try:
365-
return sclient.list_namespace().items
366+
return [
367+
ns
368+
for ns in sclient.list_namespace().items
369+
if ns.metadata.name not in KUBE_INTERNAL_NAMESPACES
370+
]
366371

367372
except ApiException as e:
368373
if e.status == 403:

0 commit comments

Comments
 (0)