Commit Graph

191 Commits

Author SHA1 Message Date
Rajat Jindal
f48c4198e7 Add krew-release-bot support (#189)
* try github actions

* create release

* open pr using krew-release-bot
2020-01-22 11:30:36 -08:00
Ahmet Alp Balkan
26d3422917
Install option as a kubectl plugin (#182)
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2019-11-11 11:19:34 -08:00
Ahmet Alp Balkan
56e30d2b43
Detect invocation style only in usage() (#183)
- removes global SELF variable
- fixes #181

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2019-11-11 11:15:48 -08:00
Ahmet Alp Balkan
dcb43fdf1b
Release v0.7.1 2019-11-09 16:46:53 -08:00
Ahmet Alp Balkan
e2f7dc0de2
Print plugin-friendly usage string
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2019-11-09 16:46:27 -08:00
Pedro Rodrigues
9645e5c62c Add zsh completion for kubectx subcommand (-d) (#178)
- Add basic completion for subcommand -d.
  Note: Kubectx will suggest all available contexts.

- References:
  - http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Completion-System
  - https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org
2019-10-24 15:25:31 -07:00
Oliver Ford
00a1e12bfb Disable preview when fuzzy-finding (#163)
The user may have global settings that enable the preview pane in fzf.

Whatever the preview command is set as, it probably doesn't render
anything meaningful for kubens - I can't think what would be.

For kubectx, the context yaml itself would _maybe_ be helpful, but it
likely contains secrets, so I don't personally think I'd find it useful
enough to get into.

This commit thus disables the preview, so that if the user did have it
enabled, there's now no pane where there would previously have probably
been an error, such as:

    [bat error]: '<namespace>': No such file or directory (os error 2)
2019-10-11 12:14:32 -04:00
Eugene Aseev
c3dd1e5deb Add missing instruction for zsh on Linux (#173)
* Add missing instruction for zsh on Linux

* Add completion reloading to .zshrc
2019-09-09 08:13:33 -07:00
Ahmet Alp Balkan
a21638226f
Release v0.7.0 2019-08-30 11:50:15 -07:00
Ahmet Alp Balkan
28e7c12f51
Introduce -c/--current options for kubectx/kubens (#171)
Per #127 the user community wants to have this feature, primarily as
-c and --current flags.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2019-08-30 11:49:49 -07:00
ferhat elmas
1652420a15 Enable shellcheck and fix issues (#170) 2019-08-25 12:05:01 -07:00
Ed Vinyard
543e035090 fix typo in "Customizing colors" example (#166) 2019-08-10 11:28:51 -07:00
Nils Breunese
a5e810b837 Add install instructions for MacPorts users (#159) 2019-07-15 10:29:52 -07:00
Christian Rebischke
62f3f27889 changed instructions for arch linux (#152)
I have pushed kubectx to the official repositories.
Users can install it via `pacman` now :)

Signed-off-by: Christian Rebischke <chris@nullday.de>
2019-05-22 17:01:08 +02:00
Ahmet Alp Balkan
4258f03446
Add shields.io badges 2019-05-08 19:39:34 -07:00
Ahmet Alp Balkan
b9614bd2e0
kubectx rename check if old_name is a valid ctx (#139)
Without this safeguard, when user runs `kubectx NEW_NAME=OLD_NAME` where
NEW_NAME is an existing context but OLD_NAME isn't, we end up deleting NEW_NAME
and not doing any renames (because OLD_NAME is not found).

Fixes #136.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2019-04-04 08:59:51 -07:00
Ahmet Alp Balkan
b3732b309e
Update README.md 2019-02-06 10:20:55 -08:00
Tariq Ibrahim
a1bce92cc8 Fix alignment of kubectx help in USAGE text. (#129) 2019-02-04 14:21:45 -08:00
Tariq Ibrahim
1356c37cc0 Fix typos in readme doc. (#126)
* Fix typos in readme doc.

* fix typos
2019-01-30 12:20:37 -08:00
Ahmet Alp Balkan
10c9bd58ca
v0.6.3
- FIX: Show current context/ns color in interactive (fzf) mode. (#109)
- TEST: Add integration tests for kubectx (#111, #113) and kubens (#105, #117)

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2019-01-28 10:11:52 -08:00
Jonathan Liuti
b6e918b084 Remove --with-short-names from doc (#120)
First measure to avoid confusing people.
see #112
2019-01-13 14:56:24 -08:00
Kumbirai Tanekha
402cc2c4b9 add cli tests for kubens (#117)
* split bats test invocation by executable

* add more cli tests for kubens

* clean up kubens tests

* small cleanup to kubens tests
2019-01-03 10:06:13 -08:00
Philippe MARTIN
df557e4fa7 Add more cli tests for kubectx (#113) 2019-01-02 09:47:01 -08:00
Ahmet Alp Balkan
b584d14f90
Show color in interactive mode (#109)
This patch introduces an internal _KUBECTX_FORCE_COLOR environment variable
that overrides color output decision.

With this, fzf output shows the color indicators for ctx/ns and choosing the
option with the color works without any extra handling.

Fixes #89.
Fixes #98.
2018-12-29 11:05:00 -08:00
Philippe MARTIN
acbf324464 test: Add more kubectx tests (#111) 2018-12-25 11:38:45 -08:00
Ahmet Alp Balkan
845f3b690b
test: enable travis-ci with bats (#108)
- add .travis.yml.
- move bats fixtures to .bats extension, since it allows detection of test
files automatically by file extension.
- use BATS_TEST_DIRNAME variable to compute location of COMMAND.
- IMPORTANT: use `echo "$output">&2` before final check so that we can debug
  the test cases by their output

Ref #2.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-12-22 13:22:08 -08:00
Philippe MARTIN
2b5bf4e429 Add simple tests for kubectx/kubens -h/--help (#105) 2018-12-22 13:02:20 -08:00
Eric Bailey
4a7d7cf025
README.md: add fish completion installation hint (#106)
This should work for most users anyway.
2018-12-21 20:30:46 -08:00
Ahmet Alp Balkan
dfeb7df363
Release v0.6.2 2018-11-26 12:23:47 -08:00
Rafael Bodill
407a84ce9e Support XDG_CACHE_HOME environment variable (#93) 2018-11-26 12:21:43 -08:00
Chad Metcalf
ec994aff89 Check for kubectl.exe on Windows (#96)
On the various flavors of bash for Windows kubectl won't resolve as the binary is kubectl.exe.
Simple aliasing doesn't seem to work. So test for both otherwise fail with a not found error.
2018-11-26 12:21:21 -08:00
Robert James Hernandez
3aeb4e76d2 fix subshell error handling (#95)
fixes #5
2018-11-07 09:27:34 -08:00
Ahmet Alp Balkan
517dae9fc8
Adding dependency checker for kubectx and kubens (#92)
Ensure kubectl in PATH for kubectx and kubens.
2018-10-22 10:10:08 -07:00
Robert James Hernandez
083e56f221 Ensure kubectl in PATH for kubens 2018-10-19 22:20:16 -07:00
Robert James Hernandez
6c94248e98 Ensure kubectl in PATH for kubectx 2018-10-19 22:20:03 -07:00
Gianpaolo Macario
244dd5b8a5 kubens: Fix typo in comment (#90) 2018-10-17 09:04:46 -07:00
Ahmet Alp Balkan
121f15d1d3
Update README.md 2018-10-16 20:15:36 -07:00
Ahmet Alp Balkan
21a1e1e963
Add ga-beacon 2018-10-16 20:15:01 -07:00
Mitchell Turner
6811a5f03c Added example of using bash completion (#86)
Added example using bash completion.

Example clones into `~/.kubectx` for people who don't want to make modifications outside of `$HOME`.
2018-09-16 23:31:35 -07:00
Ahmet Alp Balkan
41296a5fcf
README: fix typo in ln cmd for zsh comp
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-09-05 15:26:17 -07:00
schnatterer
34a9e100c8 README: Install completion for zsh & Linux (#80) 2018-09-04 15:59:34 -07:00
Ahmet Alp Balkan
365fa23d87
zsh: fix kubectx completion for 2+ contexts (#81)
fixes #68

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-08-31 15:40:26 -07:00
Oliver
ccc077b6c5 allow disabling interactive mode with fzf (#82)
Introduce KUBECTX_IGNORE_FZF for both kubectx/kubens to force-disable
attempt to enable interactive mode and lookup for fzf(1).
2018-08-31 15:39:43 -07:00
Ahmet Alp Balkan
d931779c0c
Release v0.6.1
- FIX: fix crash when kubectx/kubens is installed --with-short-names and fzf(1)
  is in PATH, but calling the binaries with the wrong name. (#78)
2018-08-24 09:28:10 -07:00
Ahmet Alp Balkan
f01719a5a6
fix: --with-short-names not compatible with fzf (#79)
When kubectx is installed as kctx, FZF_DEFAULT_COMMAND=kubectx won't work.

Fixes #78.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-08-24 09:28:00 -07:00
Ahmet Alp Balkan
46d593305a
Release v0.6.0
- FEATURE: interactive search mode when kubectx and kubens are ran without any
  arguments and fzf(1) is detected in PATH. (#71, #74)
- FIX: kubectx -d now doesn't ignore arguments after the first argument. (#75)
- FIX: empty output bug when TERM=vt100 even though NO_COLOR is set. (#57, #73)
- FIX: --help exits with code 0 now. (#69, #72)
2018-08-23 10:19:12 -07:00
Ahmet Alp Balkan
595c27ada7
fix: ignored args while deleting multiple clusters (#76)
Fixes #75.
2018-08-23 10:17:42 -07:00
Ahmet Alp Balkan
8df92316d6
add support for interactive selection with fzf (#74)
Present a fuzzy search choice in "kubectx" and "kubens" commands without
arguments.

![demo2](https://user-images.githubusercontent.com/159209/44478683-40f16d00-a5f3-11e8-99e2-f32f2a3539c1.gif)

Fixes #71.
2018-08-22 10:08:13 -07:00
Ahmet Alp Balkan
7b23263fc2
ignore errors from tput (to fix TERM=vt100) (#73)
Currently TERM=vt100 is causing kubectx failure since tput is returning
exitcode=1. vt100 does not have colors. Ignoring tput exit code.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-08-22 09:50:34 -07:00
Vít Listík
e368d13eea help exit status 0 (#72) 2018-08-19 16:40:47 -07:00