Move k8sutil to kubernetes/util and update imports
This commit is contained in:
parent
c120630aa3
commit
47340d13d0
@ -19,7 +19,7 @@ import tempfile
|
||||
|
||||
import urllib3
|
||||
import yaml
|
||||
from k8sclient import configuration
|
||||
from kubernetes.client import configuration
|
||||
from oauth2client.client import GoogleCredentials
|
||||
|
||||
_temp_files = []
|
||||
@ -157,7 +157,7 @@ class _node:
|
||||
|
||||
def load_kube_config(config_file):
|
||||
"""Loads authentication and cluster information from kube-config file
|
||||
and store them in k8sclient.configuration."""
|
||||
and store them in kubernetes.client.configuration."""
|
||||
|
||||
with open(config_file) as f:
|
||||
config = _node('kube-config', yaml.load(f))
|
||||
@ -15,7 +15,7 @@
|
||||
import json
|
||||
import pydoc
|
||||
|
||||
import k8sclient
|
||||
from kubernetes import client
|
||||
|
||||
PYDOC_RETURN_LABEL = ":return:"
|
||||
|
||||
@ -62,7 +62,7 @@ class Watch(object):
|
||||
def __init__(self, return_type=None):
|
||||
self._raw_return_type = return_type
|
||||
self._stop = False
|
||||
self._api_client = k8sclient.ApiClient()
|
||||
self._api_client = client.ApiClient()
|
||||
|
||||
def stop(self):
|
||||
self._stop = True
|
||||
@ -98,8 +98,8 @@ class Watch(object):
|
||||
'object' value will be the same as 'raw_object'.
|
||||
|
||||
Example:
|
||||
v1 = k8sclient.CoreV1Api()
|
||||
watch = k8sutil.Watch()
|
||||
v1 = client.CoreV1Api()
|
||||
watch = util.Watch()
|
||||
for e in watch.stream(v1.list_namespace, resource_version=1127):
|
||||
type = e['type']
|
||||
object = e['object'] # object is one of type return_type
|
||||
Loading…
Reference in New Issue
Block a user