Commit Graph

188 Commits

Author SHA1 Message Date
Ahmet Alp Balkan
6c3977d574 kubens: Add facility to store state file
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:56 -07:00
Ahmet Alp Balkan
de2867a622 Implement list (via exec kubectl), clearer color settings
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:56 -07:00
Ahmet Alp Balkan
c4252b5795 Move kubeconfig loader utils to cmdutil pkg
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:56 -07:00
Ahmet Alp Balkan
1982becb15 kubens: Start implementing stubs
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:56 -07:00
Ahmet Alp Balkan
342d21683b Create test utils for crafting kubeconfig strings
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:56 -07:00
Ahmet Alp Balkan
62d8dad7d5 extract kubeconfig test utils to a type
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:56 -07:00
Ahmet Alp Balkan
68b842f39b do not fail on non-existing kubeconfig files
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:56 -07:00
Ahmet Alp Balkan
0e50f15393 Better success msgs, handle -d without args
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:56 -07:00
Ahmet Alp Balkan
f4f558004a Tidy up colors, help msgs, TODOs
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:56 -07:00
Ahmet Alp Balkan
7598c4d4dd Create printer pkg, fix color force enable/disable
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:56 -07:00
Ahmet Alp Balkan
bef0a4cca7 Move kubeconfig utility to a shared pkg
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:56 -07:00
Ahmet Alp Balkan
d5546f062d Extend test coverage
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:55 -07:00
Ahmet Alp Balkan
bf5b715798 Fix UnsupportedOp tests through custom comparer
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:55 -07:00
Ahmet Alp Balkan
a01db6ecde Re-introduce DEBUG env var stack traces
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:55 -07:00
Ahmet Alp Balkan
280fcec765 Update tests for homeDir and kubeconfigPath()
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:55 -07:00
Ahmet Alp Balkan
c82e299daa Unify errors from kubeconfig.Parse
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:55 -07:00
Ahmet Alp Balkan
5aaccdf801 Extract env vars to a file + test
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:55 -07:00
Ahmet Alp Balkan
936964dde5 Support for fzf, color ignore/force knobs
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:55 -07:00
Ahmet Alp Balkan
1f4eed962a Move all yaml logic to pkg/kubeconfig
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:55 -07:00
Ahmet Alp Balkan
492e3e7053 Move ctx-related YAML parse methods to pkg
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:55 -07:00
Ahmet Alp Balkan
7013899503 Use kubeconfig pkg for parsing utils
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:55 -07:00
Ahmet Alp Balkan
7f3e441ff2 kubeconfig pkg for loading/parsing
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:55 -07:00
Ahmet Alp Balkan
bb95141fc5 add printSuccess, pass writers to print funcs
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:55 -07:00
Ahmet Alp Balkan
28051b1fd7 define Run(stdout,stderr) method on **Ops
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:55 -07:00
Ahmet Alp Balkan
5b3796ba1c add some TODOs
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:55 -07:00
Ahmet Alp Balkan
1284b822a5 Fix bugs for test pass, update tests
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:55 -07:00
Ahmet Alp Balkan
cb103701ac Add support for renaming contexts
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:55 -07:00
Ahmet Alp Balkan
5eabeab47e Support for -d (deleting contexts)
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:55 -07:00
Ahmet Alp Balkan
c5f17b83e7 Add support for -u/--unset
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:55 -07:00
Ahmet Alp Balkan
94e8d3b4c7 Add support for -c/--current
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:55 -07:00
Ahmet Alp Balkan
ff6326c122 Integrate ctx swap, check for wrong ctx names
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:54 -07:00
Ahmet Alp Balkan
8aaefb8a94 Save last context name in state file
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:54 -07:00
Ahmet Alp Balkan
f51f8be7f9 Add utils for r/w ~/.kube/kubectx file
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:54 -07:00
Ahmet Alp Balkan
4fdd2898b7 Implement switch via editing yaml in-place
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:54 -07:00
Ahmet Alp Balkan
3c6fa48260 Implement context listing
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:54 -07:00
Ahmet Alp Balkan
b1afdbf375 Implement facilities to parse kubeconfig file
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:54 -07:00
Ahmet Alp Balkan
3fdc1855c0 Add logic to determine kubeconfig path
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:54 -07:00
Ahmet Alp Balkan
df8957403c Support help op, add color to error
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:54 -07:00
Ahmet Alp Balkan
eee1c23654 Handle supported operation in main
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:54 -07:00
Ahmet Alp Balkan
6c9273e582 Start porting to Go: parse flags
Parse help/list/swap command line flags.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:52:54 -07:00
drorlevywork
37c765684f feat(completion): Improve kubens fish completions (#204)
This change covers all of the supported arguments and switches for the kubens command

Co-authored-by: Dror Levy <Dror@tablecheck.com>
2020-04-17 08:30:17 -07:00
Ahmet Alp Balkan
d0c9679d85 Update README.md 2020-04-07 14:30:29 -07:00
Ahmet Alp Balkan
e388bfa616 Remove ubuntu indication from install guide 2020-04-07 14:28:24 -07:00
Sébastien Maintrot
db8b706612 Update README about fzf and Unix composability (#197) 2020-03-08 10:24:24 -07:00
Rajat Jindal
06289683dd use v0.0.37 of krew-release-bot (#196)
use v0.0.37 of krew-release-bot
2020-02-29 08:51:38 -08:00
Ahmet Alp Balkan
d3295e5b7a Release v0.8.0 v0.8.0 2020-02-20 15:12:06 -08:00
rob salmond
3369d42e2d add unset flag (#187)
* add unset flag

* test unsetting selected context

* update readme with new unset flag

* testdata notes

* set a current context

* cleanup

* omit fixture changes
2020-02-04 09:39:47 -08:00
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