Skip to content

Commit f9eec7c

Browse files
committed
Ignore internal namespaces
1 parent 01b293b commit f9eec7c

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
)
@@ -360,7 +361,11 @@ def get_kubeconfig_value(jsonpath):
360361
def get_namespaces() -> list[V1Namespace]:
361362
sclient = get_static_client()
362363
try:
363-
return sclient.list_namespace().items
364+
return [
365+
ns
366+
for ns in sclient.list_namespace().items
367+
if ns.metadata.name not in KUBE_INTERNAL_NAMESPACES
368+
]
364369

365370
except ApiException as e:
366371
if e.status == 403:

0 commit comments

Comments
 (0)