Skip to content

Commit

Permalink
Add type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtomlinson committed Jul 1, 2024
1 parent 2e1718e commit f46cb94
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kr8s/_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async def ssl_context(self):
return sslcontext

@property
def namespace(self):
def namespace(self) -> str:
return self._namespace if self._namespace else "default"

@namespace.setter
Expand Down Expand Up @@ -139,8 +139,8 @@ async def _load_kubeconfig(self) -> None:
self.active_context = self.kubeconfig.contexts[0]["name"]

# Load configuration options from the context
if self.namespace is None:
self.namespace = self.kubeconfig.current_namespace
if self._namespace is None:
self._namespace = self.kubeconfig.current_namespace

# If no cluster is found in the context, assume it's a service account
if not self._context["cluster"]:
Expand Down

0 comments on commit f46cb94

Please sign in to comment.