Skip to content

Commit 47340d1

Browse files
committed
Move k8sutil to kubernetes/util and update imports
1 parent c120630 commit 47340d1

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed
File renamed without changes.

k8sutil/kube_config.py renamed to kubernetes/util/kube_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import urllib3
2121
import yaml
22-
from k8sclient import configuration
22+
from kubernetes.client import configuration
2323
from oauth2client.client import GoogleCredentials
2424

2525
_temp_files = []
@@ -157,7 +157,7 @@ def get_with_name(self, name):
157157

158158
def load_kube_config(config_file):
159159
"""Loads authentication and cluster information from kube-config file
160-
and store them in k8sclient.configuration."""
160+
and store them in kubernetes.client.configuration."""
161161

162162
with open(config_file) as f:
163163
config = _node('kube-config', yaml.load(f))

k8sutil/watch.py renamed to kubernetes/util/watch.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import json
1616
import pydoc
1717

18-
import k8sclient
18+
from kubernetes import client
1919

2020
PYDOC_RETURN_LABEL = ":return:"
2121

@@ -62,7 +62,7 @@ class Watch(object):
6262
def __init__(self, return_type=None):
6363
self._raw_return_type = return_type
6464
self._stop = False
65-
self._api_client = k8sclient.ApiClient()
65+
self._api_client = client.ApiClient()
6666

6767
def stop(self):
6868
self._stop = True
@@ -98,8 +98,8 @@ def stream(self, func, *args, **kwargs):
9898
'object' value will be the same as 'raw_object'.
9999
100100
Example:
101-
v1 = k8sclient.CoreV1Api()
102-
watch = k8sutil.Watch()
101+
v1 = client.CoreV1Api()
102+
watch = util.Watch()
103103
for e in watch.stream(v1.list_namespace, resource_version=1127):
104104
type = e['type']
105105
object = e['object'] # object is one of type return_type
File renamed without changes.

0 commit comments

Comments
 (0)