diff options
| author | shlomosfez <143969671+shlomosfez@users.noreply.github.com> | 2024-04-02 18:14:23 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-02 18:14:23 +0300 |
| commit | d65cf3d422c825af4f29a5705706c64614ab7820 (patch) | |
| tree | 57c8f80fb2a40a34a5ee179c98861f81d0a5f0b0 /robusta_krr | |
| parent | a005d7ef94e92e5651187586466812803f7ed91f (diff) | |
Load kubeconfig first in case it is provided by CLI arg (#251)
* Load kubeconfig first in case it is provided by CLI arg
* simplify implementation
---------
Co-authored-by: Pavel Zhukov <33721692+LeaveMyYard@users.noreply.github.com>
Diffstat (limited to 'robusta_krr')
| -rw-r--r-- | robusta_krr/core/models/config.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/robusta_krr/core/models/config.py b/robusta_krr/core/models/config.py index d4f04a0..ff6142a 100644 --- a/robusta_krr/core/models/config.py +++ b/robusta_krr/core/models/config.py @@ -138,11 +138,10 @@ class Config(pd.BaseSettings): def load_kubeconfig(self) -> None: try: - config.load_incluster_config() - except ConfigException: config.load_kube_config(config_file=self.kubeconfig, context=self.context) self.inside_cluster = False - else: + except ConfigException: + config.load_incluster_config() self.inside_cluster = True def get_kube_client(self, context: Optional[str] = None): |
