Code Monkey home page Code Monkey logo

kube-shell's People

Contributors

marcosamorim avatar murali-reddy avatar tao12345666333 avatar vogxn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kube-shell's Issues

ImportError: cannot import name NewConnectionError

[root@lv101 gluster_k8s_vloume]# kube-shell
Traceback (most recent call last):
File "/usr/bin/kube-shell", line 7, in
from kubeshell.main import cli
File "/usr/lib/python2.7/site-packages/kubeshell/main.py", line 6, in
from kubeshell.kubeshell import Kubeshell
File "/usr/lib/python2.7/site-packages/kubeshell/kubeshell.py", line 10, in
from kubeshell.completer import KubectlCompleter
File "/usr/lib/python2.7/site-packages/kubeshell/completer.py", line 11, in
from kubeshell.client import KubernetesClient
File "/usr/lib/python2.7/site-packages/kubeshell/client.py", line 1, in
from urllib3.exceptions import NewConnectionError, ConnectTimeoutError, MaxRetryError
ImportError: cannot import name NewConnectionError

Error after installation

Hi,
I've installed kube-shll to thx to pip and not i obtain an error message when I try to execute kube-shell command:

$ kube-shell
Traceback (most recent call last):
  File "/usr/local/bin/kube-shell", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
    @_call_aside
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 637, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 650, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 834, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (pyasn1 0.3.2 (/home/scraly/.local/lib/python2.7/site-packages), Requirement.parse('pyasn1<0.5.0,>=0.4.1'), set(['pyasn1-modules']))

describe configmap Exception

Typing the following in the kube-shell followed by a space produces an error (provided at the end of the report)

kubectl describe configmap

kube-shell> kubectl describe configmap Exception in thread Thread-73:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_r
    self.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/Users/user/.pyenv/versions/kube-shell/lib/python2.7/site-packages/prompt_toolkit/interface.py", line 860, in n
    completions = list(buffer.completer.get_completions(document, complete_event))
  File "/Users/user/.pyenv/versions/kube-shell/lib/python2.7/site-packages/kubeshell/completer.py", line 246, in get_cs
    resources = self.get_resources(arg, namespace)
  File "/Users/user/.pyenv/versions/kube-shell/lib/python2.7/site-packages/kubeshell/completer.py", line 325, in get_rs
    ret = v1.list_config_map_for_all_namespaces(watch=False)
  File "/Users/user/.pyenv/versions/kube-shell/lib/python2.7/site-packages/kubernetes/client/apis/core_v1_api.py", lins
    (data) = self.list_config_map_for_all_namespaces_with_http_info(**kwargs)
  File "/Users/user/.pyenv/versions/kube-shell/lib/python2.7/site-packages/kubernetes/client/apis/core_v1_api.py", lino
    collection_formats=collection_formats)
  File "/Users/user/.pyenv/versions/kube-shell/lib/python2.7/site-packages/kubernetes/client/api_client.py", line 329,i
    _return_http_data_only, collection_formats, _preload_content, _request_timeout)
  File "/Users/user/.pyenv/versions/kube-shell/lib/python2.7/site-packages/kubernetes/client/api_client.py", line 153,i
    _request_timeout=_request_timeout)
  File "/Users/user/.pyenv/versions/kube-shell/lib/python2.7/site-packages/kubernetes/client/api_client.py", line 361,t
    headers=headers)
  File "/Users/user/.pyenv/versions/kube-shell/lib/python2.7/site-packages/kubernetes/client/rest.py", line 240, in GET
    query_params=query_params)
  File "/Users/user/.pyenv/versions/kube-shell/lib/python2.7/site-packages/kubernetes/client/rest.py", line 217, in ret
    raise ApiException(status=0, reason=msg)
ApiException: (0)
Reason: SSLError
[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)

support scan command

Scan of the live cluster to detect the difference in desired state as expressed in the manifest vs state of the resources.

Couple of e.g

For a replica set replicas running vs replicas desired
For a dameonset are the pods running on each node

Autocomplete does not work in lubuntu

Hi,

I have tried to make server autocompletion work on Ubuntu without success,

I am using zsh but it also does not work with bash. Kubectl autocompletion works outside kube-shell.

I have tried with minikube and also does not work.

I do not get any error or warning message when I start kube-shell. And I still can switch between namespaces with F5.

Regards.

Pod name autocompletion does not work for the kubectl logs command

Issue:
When attempting to use the kubectl logs command, the available pods are not displayed.

Steps to reproduce:
With the kube-shell open, type kubectl logs and hit the tab key

Expected Results:
The available pods are displayed in the shell

Observed Results:
Nothing is displayed

implement shortcuts (ls, rm, edit, context)

ls service
ls pod
ls deployment
ls namespace
ls namespace/pod

rm pod
rm service
rm namespace/pod

context shopsock-prod

There should be autosuggestion as well. for e.g. ls pod TAB shoud drop down the list of pods.

support diff command

In the spirit of git diff:

do a diff between repo with version controlled kube manifest against the live cluster

F5 namespace switch doesn't work (still or again?)

Hello, First of all thanks for you work!

I have been using kube-shell few days and everything it's OK, but namespace switcher doesn't work. There is no errors or something else, just no reaction when i press F5

My system: Ubuntu 16.04
My python: 2.7.12
My kube-shell: 0.0.21 (latest)

I saw similar issue #39
Is there a way to fix it or need to wait for the next release?

Single quotes throw ValueError

Typing a single quote causes the following error:
kube-shell> kubectl get pods --selector=Exception in thread Thread-43:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/local/lib/python2.7/dist-packages/prompt_toolkit/interface.py", line 865, in run
completions = list(buffer.completer.get_completions(document, complete_event))
File "/usr/local/lib/python2.7/dist-packages/kubeshell/completer.py", line 41, in get_completions ON [F10] Exit
tokens = shlex.split(cmdline)
File "/usr/lib/python2.7/shlex.py", line 279, in split
return list(lex)
File "/usr/lib/python2.7/shlex.py", line 269, in next
token = self.get_token()
File "/usr/lib/python2.7/shlex.py", line 96, in get_token
raw = self.read_token()
File "/usr/lib/python2.7/shlex.py", line 172, in read_token
raise ValueError, "No closing quotation"
ValueError: No closing quotation
'

Import error

After:

$ pip install kube-shell
Collecting kube-shell
  Downloading kube-shell-0.0.18.tar.gz
Requirement already satisfied: prompt-toolkit<1.1.0,>=1.0.0 in /usr/local/lib/python2.7/site-packages (from kube-shell)
Requirement already satisfied: Pygments<3.0.0,>=2.1.3 in /usr/local/lib/python2.7/site-packages (from kube-shell)
Collecting fuzzyfinder>=1.0.0 (from kube-shell)
  Downloading fuzzyfinder-1.0.0-py2.py3-none-any.whl
Requirement already satisfied: click<7.0,>=4.0 in /usr/local/lib/python2.7/site-packages (from kube-shell)
Collecting kubernetes>=0.10.0 (from kube-shell)
  Downloading kubernetes-2.0.0-py2.py3-none-any.whl (718kB)
    100% |████████████████████████████████| 727kB 1.9MB/s
Requirement already satisfied: wcwidth in /usr/local/lib/python2.7/site-packages (from prompt-toolkit<1.1.0,>=1.0.0->kube-shell)
Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python2.7/site-packages (from prompt-toolkit<1.1.0,>=1.0.0->kube-shell)
Requirement already satisfied: python-dateutil in /usr/local/lib/python2.7/site-packages (from kubernetes>=0.10.0->kube-shell)
Requirement already satisfied: oauth2client in /usr/local/lib/python2.7/site-packages (from kubernetes>=0.10.0->kube-shell)
Requirement already satisfied: urllib3!=1.21 in /usr/local/lib/python2.7/site-packages (from kubernetes>=0.10.0->kube-shell)
Requirement already satisfied: setuptools in /usr/local/lib/python2.7/site-packages (from kubernetes>=0.10.0->kube-shell)
Collecting certifi (from kubernetes>=0.10.0->kube-shell)
  Downloading certifi-2017.4.17-py2.py3-none-any.whl (375kB)
    100% |████████████████████████████████| 378kB 2.9MB/s
Collecting ipaddress (from kubernetes>=0.10.0->kube-shell)
  Downloading ipaddress-1.0.18-py2-none-any.whl
Collecting websocket-client (from kubernetes>=0.10.0->kube-shell)
  Downloading websocket_client-0.44.0-py2.py3-none-any.whl (199kB)
    100% |████████████████████████████████| 204kB 4.8MB/s
Requirement already satisfied: pyyaml in /usr/local/lib/python2.7/site-packages (from kubernetes>=0.10.0->kube-shell)
Requirement already satisfied: pyasn1>=0.1.7 in /usr/local/lib/python2.7/site-packages (from oauth2client->kubernetes>=0.10.0->kube-shell)
Requirement already satisfied: pyasn1-modules>=0.0.5 in /usr/local/lib/python2.7/site-packages (from oauth2client->kubernetes>=0.10.0->kube-shell)
Requirement already satisfied: httplib2>=0.9.1 in /usr/local/lib/python2.7/site-packages (from oauth2client->kubernetes>=0.10.0->kube-shell)
Requirement already satisfied: rsa>=3.1.4 in /usr/local/lib/python2.7/site-packages (from oauth2client->kubernetes>=0.10.0->kube-shell)
Building wheels for collected packages: kube-shell
  Running setup.py bdist_wheel for kube-shell ... done
  Stored in directory: /Users/blakebarnett/Library/Caches/pip/wheels/38/8d/ae/81b7a9f2c80a31a326b3b528af832f294307e963c3add2fd24
Successfully built kube-shell
Installing collected packages: fuzzyfinder, certifi, ipaddress, websocket-client, kubernetes, kube-shell
Successfully installed certifi-2017.4.17 fuzzyfinder-1.0.0 ipaddress-1.0.18 kube-shell-0.0.18 kubernetes-2.0.0 websocket-client-0.44.0

I get this when running it:

Traceback (most recent call last):
  File "/usr/local/bin/kube-shell", line 7, in <module>
    from kubeshell.main import cli
  File "/usr/local/lib/python2.7/site-packages/kubeshell/main.py", line 18, in <module>
    from kubeshell.kubeshell import Kubeshell
  File "/usr/local/lib/python2.7/site-packages/kubeshell/kubeshell.py", line 10, in <module>
    from prompt_toolkit.key_binding.defaults import load_key_bindings_for_prompt
ImportError: No module named defaults

LICENSE

Which software license is this software distributed under? I think your source code or LICENSE/COPYING file should include the license. Currently as far as I can tell there's a little shield icon in the README.md and that's it.

kubectl get <object> <space> throws exception

When I run commands like kubectl get pods and press space from within kube-shell 'm getting the below error. On a vanilla bash shell I can execute kubectl get just fine.

kube-shell> kubectl get ingress Exception in thread Thread-74:
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/local/lib/python2.7/site-packages/prompt_toolkit/interface.py", line 860, in run
    completions = list(buffer.completer.get_completions(document, complete_event))
  File "/usr/local/lib/python2.7/site-packages/kubeshell/completer.py", line 246, in get_completions
    resources = self.get_resources(arg, namespace)
  File "/usr/local/lib/python2.7/site-packages/kubeshell/completer.py", line 321, in get_resources
    ret = extensionsV1Beta1.list_ingress_for_all_namespaces(watch=False)
  File "/usr/local/lib/python2.7/site-packages/kubernetes/client/apis/extensions_v1beta1_api.py", line 3152, in list_ingress_for_all_namesps
    (data) = self.list_ingress_for_all_namespaces_with_http_info(**kwargs)
  File "/usr/local/lib/python2.7/site-packages/kubernetes/client/apis/extensions_v1beta1_api.py", line 3245, in list_ingress_for_all_namespo
    collection_formats=collection_formats)
  File "/usr/local/lib/python2.7/site-packages/kubernetes/client/api_client.py", line 329, in call_api
    _return_http_data_only, collection_formats, _preload_content, _request_timeout)
  File "/usr/local/lib/python2.7/site-packages/kubernetes/client/api_client.py", line 153, in __call_api
    _request_timeout=_request_timeout)
  File "/usr/local/lib/python2.7/site-packages/kubernetes/client/api_client.py", line 361, in request
    headers=headers)
  File "/usr/local/lib/python2.7/site-packages/kubernetes/client/rest.py", line 240, in GET
    query_params=query_params)
  File "/usr/local/lib/python2.7/site-packages/kubernetes/client/rest.py", line 231, in request
    raise ApiException(http_resp=r)
ApiException: (401)
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({'Date': 'Wed, 05 Jul 2017 14:05:34 GMT', 'Content-Length': '13', 'Content-Type': 'text/plain; charse)
HTTP response body: Unauthorized

kube-shell command not found on mac/zsh

I am using zsh and Sierra, installed kube-shell using pip - pip install kube-shell

It installed fine and gave me this log at the end -

Successfully installed Pygments-2.2.0 click-6.7 fuzzyfinder-2.1.0 httplib2-0.10.3 kube-shell-0.0.23 kubernetes-2.0.0 oauth2client-4.1.2 prompt-toolkit-1.0.15 wcwidth-0.1.7

After this kube-shell command is not found -

pgogia@VSN00243 ~  kube-shell
zsh: command not found: kube-shell

Running this on macOS Sierra and zsh (5.4.2). What step am I missing?

Specific executors for each command

On the line of #31 , for better design we will need have specific executor as well.

So completer handles the auto suggestions, server side completion etc.

Executor will be responsible for exeution once user hits enter on the prompt.

KubectlExecutor
HelmExecutor etc

Offline Install

Hello

I want to install kube-shell in a dark site (no internet connection)
Is that possible?

Thanks

Better support for no context situation

kube-shell works now with a kubeconfig that has one context and that has no context name. I have problems still when I have no context set, in which case kubectl would apparently just use the only context available.

Int his example an error pops up as soon as I hit space after "deployment":

kube-shell> kubectl expose deployment Exception in thread Thread-27:
Traceback (most recent call last):                                                                                                         
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner                                                                    
    self.run()                                                                                                                             
  File "/usr/lib/python3.6/threading.py", line 864, in run                                                                                 
    self._target(*self._args, **self._kwargs)                                                                                              
  File "/home/bzub/.local/lib/python3.6/site-packages/prompt_toolkit/interface.py", line 860, in run                                       
    completions = list(buffer.completer.get_completions(document, complete_event))                                                         
  File "/home/bzub/.local/lib/python3.6/site-packages/kubeshell/completer.py", line 247, in get_completions                                                                                                          
    resources = self.get_resources(arg, namespace)
  File "/home/bzub/.local/lib/python3.6/site-packages/kubeshell/completer.py", line 279, in get_resources
    config.load_kube_config()
  File "/home/bzub/.local/lib/python3.6/site-packages/kubernetes/config/kube_config.py", line 311, in load_kube_config
    client_configuration=client_configuration).load_and_set()
  File "/home/bzub/.local/lib/python3.6/site-packages/kubernetes/config/kube_config.py", line 282, in _get_kube_config_loader_for_yaml_file
    **kwargs)
  File "/home/bzub/.local/lib/python3.6/site-packages/kubernetes/config/kube_config.py", line 118, in __init__
    self.set_active_context(active_context)
  File "/home/bzub/.local/lib/python3.6/site-packages/kubernetes/config/kube_config.py", line 130, in set_active_context
    context_name = self._config['current-context']
  File "/home/bzub/.local/lib/python3.6/site-packages/kubernetes/config/kube_config.py", line 253, in __getitem__
    % (key, self.name))
kubernetes.config.config_exception.ConfigException: Invalid kube-config file. Expected key current-context in kube-config

No context:

$ kubectl config current-context
error: current-context is not set

kubeconfig:

apiVersion: v1
kind: Config
clusters:
- name: local
  cluster:
    server: https://kube-api-test.zbrbdl:443
    certificate-authority-data: removed
users:
- name: kubelet
  user:
    client-certificate-data: removed
    client-key-data: removed
contexts:
- context:
    cluster: local
    user: kubelet

Getting Error object has no attribute 'RbacAuthorizationV1beta1Api'

Can't really say why this started happening all of the sudden. I do not remember updating/upgrading any python libs etc..
File "/usr/local/bin/kube-shell", line 11, in <module> load_entry_point('kube-shell==0.0.23', 'console_scripts', 'kube-shell')() File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 572, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 2755, in load_entry_point return ep.load() File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 2408, in load return self.resolve() File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 2414, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "/Library/Python/2.7/site-packages/kubeshell/main.py", line 6, in <module> from kubeshell.kubeshell import Kubeshell File "/Library/Python/2.7/site-packages/kubeshell/kubeshell.py", line 11, in <module> from kubeshell.lexer import KubectlLexer File "/Library/Python/2.7/site-packages/kubeshell/lexer.py", line 8, in <module> class KubectlLexer(RegexLexer): File "/Library/Python/2.7/site-packages/kubeshell/lexer.py", line 12, in KubectlLexer completer = KubectlCompleter() File "/Library/Python/2.7/site-packages/kubeshell/completer.py", line 21, in __init__ self.kube_client = KubernetesClient() File "/Library/Python/2.7/site-packages/kubeshell/client.py", line 28, in __init__ self.rbacApi = client.RbacAuthorizationV1beta1Api() AttributeError: 'module' object has no attribute 'RbacAuthorizationV1beta1Api'

Make it possible to install via homebrew

I install all my tools via Homebrew (declaratively via the "Bundle" feature) on macOS.

I think kube-shell should be possible to installable via Homebrew as well. You can start curating a brew formula in this repo and I can pilot it by tapping into this repo, then installing the formula. This project meets the criteria (not very new, has enough stars etc) to be accepted into the Homebrew-core repository, so in the future it can be added via:

brew install kube-shell

I really would like to see this happen. Installing things with language-specific package managers (i.e. pip) and using my system-site-packages path for this task doesn’t sound ideal to me.

"kubectl" command not found error..

[root@localhost ~]# kube-shell

kube-shell> kubectl get services
/bin/sh: kubectl: command not found
kube-shell> exit

Any thoughts why this happens?

Trying to make a alias in OS X causes exception

When i try to create a alias in kube-shell i get a exception the instant i press '

so i type alias kc=' and then comes the stacktrace

if i finnish typing my line and press enter the alias gets created

Running in OS X high Sierra.

➜  ~ pip show kube-shell
Name: kube-shell
Version: 0.0.23
Summary: Kubernetes shell: An integrated shell for working with the Kubernetes CLI
Home-page: https://github.com/cloudnativelabs/kube-shell
Author: Cloudnative Labs
Author-email: UNKNOWN
License: Apache License 2.0
Location: /Library/Python/2.7/site-packages
Requires: fuzzyfinder, prompt-toolkit, Pygments, kubernetes, click

kube-shell> alias kc='Exception in thread Thread-21:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/Library/Python/2.7/site-packages/prompt_toolkit/interface.py", line 865, in run
    completions = list(buffer.completer.get_completions(document, complete_event))
  File "/Library/Python/2.7/site-packages/kubeshell/completer.py", line 41, in get_completionsit
    tokens = shlex.split(cmdline)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py", line 279, in split
    return list(lex)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py", line 269, in next
    token = self.get_token()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py", line 96, in get_token
    raw = self.read_token()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py", line 172, in read_token
    raise ValueError, "No closing quotation"
ValueError: No closing quotation

Exit command C / ctrl C exits shell

Its a minor thing , but say I wrote some command and in the middle of it I want to just cancel it with ctrl/c command/c -- that just exists the shell, so question is: Is there a way to go into the new line or exit the current line and not exit kube shell? If so - please let me know -- I tried finding it.

add bottom tool bar support

tool bar need to have below options

  • toggle inline help with dropped down list
  • info on current kubeconfig context used, namespace
  • vi/emacs mode
  • exit

refer to saws/aws-shell for bottom toolbar reference

error switching namespace with F5 shortcut

Hi,

When I hit F5 to switch between namespace an error appears on logs.

2017-09-04 13:52:32,344 [WARNING] kubeshell.kubeshell _:113 - failed namespace switching
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/kubeshell/kubeshell.py", line 110, in _
    KubeConfig.switch_to_next_namespace(Kubeshell.namespace)
  File "/usr/local/lib/python2.7/site-packages/kubeshell/kubeshell.py", line 77, in switch_to_next_namespace
    namespace_resources = completer.get_resources("namespace")
AttributeError: 'KubectlCompleter' object has no attribute 'get_resources'

I'm running kube-shell 0.0.21 on iTerm2
OS: Mac Os 10.12.6

Any solution for this issue?

Thanks.

refactor completor

Refactor current completer code so that there is one global

KubeShellCompleter which will be the entry point, and one that will used by prompt tool kit.

Subsequently specific completers can be called from KubeShellCompleter.

KubectlCompleter
HelmCompleter

etc that can handle completions specific to first token on the prompt.

Support for KUBECONFIG

kubectl uses the KUBECONFIG environment variable. It would be great if kube-shell would honor it as well.

About KUBECONFIG: https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/#set-the-kubeconfig-environment-variable

Current behavior:

 ~> kube-shell
Kube-shell uses ~/.kube/config for server side completion. Could not find ~/.kube/config. Server side completion functionality may not work.
kube-shell> 

Expected behavior:

kube-shell follows path(s) as defined in $KUBECONFIG.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.