Skip to content

Commit

Permalink
kubernetes: replace deprecated kubernetes.client.apis with `kuberne…
Browse files Browse the repository at this point in the history
…tes.client.api`

Running a salt state like:
```
$ salt-run state.sls metalk8s.addons.dex.deployed.service-configuration saltenv=metalk8s-2.5.1-dev
```
Returns the following warnings, so let us fix these warnings.

[WARNING ] /usr/lib/python2.7/site-packages/kubernetes/client/apis/__init__.py:12: DeprecationWarning: The package kubernetes.client.apis is renamed and deprecated, use
kubernetes.client.api instead (please note that the trailing s was removed).
  DeprecationWarning
  • Loading branch information
Ebaneck authored and gdemonet committed May 16, 2020
1 parent de9b674 commit d200ee2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions salt/_utils/kubernetes_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
try:
import kubernetes.config
import kubernetes.client as k8s_client
import kubernetes.client.apis as k8s_apis
import kubernetes.client.api as k8s_apis

# Workaround for https://github.com/kubernetes-client/python/issues/376
def set_conditions(self, conditions):
Expand Down Expand Up @@ -88,7 +88,7 @@ def __init__(self, api_cls, name,
method_names=None, all_namespaces_name=None):
if api_cls not in ALL_APIS:
raise ValueError(
'`api_cls` must be an API from `kubernetes.client.apis`'
'`api_cls` must be an API from `kubernetes.client.api`'
)
methods = self.CRUD_METHODS
if isinstance(method_names, six.string_types):
Expand Down

0 comments on commit d200ee2

Please sign in to comment.