Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Commit

Permalink
remove get client from state
Browse files Browse the repository at this point in the history
  • Loading branch information
madhur-tandon committed Aug 8, 2022
1 parent bccb4d8 commit 419fea3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions mlem/contrib/kubernetes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@ class K8sDeploymentState(DeployState):
type: ClassVar = "kubernetes"
image: Optional[DockerImage]
pod_name: Optional[str]
kube_config_file_path: Optional[str] = None

def get_client(self):
config.load_kube_config(
config_file=self.kube_config_file_path
or os.getenv("KUBECONFIG", default="~/.kube/config")
)


class K8sDeployment(MlemDeployment):
type: ClassVar = "kubernetes"
server: Optional[Server] = None
state_type: ClassVar = K8sDeploymentState
image_name: Optional[str] = None
kube_config_file_path: Optional[str] = None

def _get_client(self, state: K8sDeploymentState):
config.load_kube_config(
config_file=self.kube_config_file_path
or os.getenv("KUBECONFIG", default="~/.kube/config")
)


class K8sEnv(MlemEnv[K8sDeployment]):
Expand Down

0 comments on commit 419fea3

Please sign in to comment.