ramilito / kubesess Goto Github PK
View Code? Open in Web Editor NEWKubectl plugin managing sessions
License: MIT License
Kubectl plugin managing sessions
License: MIT License
Is your feature request related to a problem? Please describe.
I want to use homebrew to download
Describe the solution you'd like
want to be able to run the command brew install kubesess
Describe alternatives you've considered
Adding arm binary to releases helps a bit
Additional context
Is your feature request related to a problem? Please describe.
Need tests to trust PR:s
Simplify passing arguments around with globals
The script is responsible for pre-pending environment variable, do it in-app instead so it's testable
Describe the solution you'd like
Use lazy_static for globals
Use tests that calls the binary and validates the output
Describe alternatives you've considered
Not testing and implementing bugs
Is your feature request related to a problem? Please describe.
The kubesess.sh script doesn't support fish shell
Describe the solution you'd like
Include fish variant installation
Describe the bug
skupper and helm use namespace set in .kube/config when switching namespace with kubens
To Reproduce
using these aliases
alias kubectx='export KUBECONFIG=$(kubesess context)'
alias kubens='export KUBECONFIG=$(kubesess namespace)'
kubens
skupper cluster init
helm upgrade
Expected behavior
inits skupper in namespace, upgrade a helm chart in namespace
Desktop (please complete the following information):
macos m1 macbook pro
iterm2
zsh
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
No release is available for arm target.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Having a arm release would be nice.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
cargo install --git https://github.com/Ramilito/kubesess.git
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe.
I can't tab to get suggestions when in zsh/bash shells
Describe the solution you'd like
Add completion support to zsh/bash shells
Is your feature request related to a problem? Please describe.
Need to add comments to the code, not a complex code but the intent is unclear sometimes
Describe the solution you'd like
Add high level comments on what stuff is intended to solve
Describe alternatives you've considered
Additional context
Is your feature request related to a problem? Please describe.
If I have more than a couple of config files to merge, the env variable becomes insufficient.
Using kcd and knd doesn't work if env variable is not used since it kubectl tries to modify the .kube/config file
Describe the solution you'd like
Add the possibility to input a path to a folder where all my configs could reside.
Describe alternatives you've considered
Super long env variable
Additional context
More discussion here: #26
Describe the bug
When starting a selection and then ctrl-c the env gets reset
To Reproduce
Expected behavior
Should not affect the env variable
Screenshots
Desktop (please complete the following information):
Additional context
I'd love to be able to use and upgrade this tool as a kubectl plugin. See https://krew.sigs.k8s.io/docs/developer-guide/distributing-with-krew/.
Is your feature request related to a problem? Please describe.
Changing namespace makes an unnecessary call to kubectl to get the current context.
It should already be available when calling getconfig
Describe the solution you'd like
Use the value from the config
Describe alternatives you've considered
Additional context
Is your feature request related to a problem? Please describe.
We need to improve error handling, today all output is added to the env variable while all errors are swallowed and suppressed.
Describe the solution you'd like
As per @morozov suggestion in #42, we need to make the shell wrapper diffirentiate between stderr and stdout
Describe alternatives you've considered
Displaying the error inside the app and not using the stderr
Describe the bug
Tests cannot be run on fork since they depend on a secret.
Describe the bug
I seem to be getting this error trying to switch to namespaces/context once in a while.
First time I deleted the cache and it fixed the issue, now I'm getting it on one of the environments I work on.
How can I debug the issue?
> kn xxxx
> kgpo
The connection to the server localhost:8080 was refused - did you specify the right host or port?
I dont even have any clusters on localhost:8080 so not sure what it wants
Is your feature request related to a problem? Please describe.
The installation text in readme.md is a manual update.
The version update should be done on release.
Describe the solution you'd like
I want the readme and version to be automatically updated
Describe alternatives you've considered
Manually doing it every time.
Describe the bug
Cursor disappears when ctrl-c while in the select menu
To Reproduce
kubesess context
Expected behavior
Should keep cursor visible
Is your feature request related to a problem? Please describe.
We should handle exit codes in the shell wrapper (bash, @morozov already added it to fish) to allow error handling without the need to reset the env variable.
Describe the solution you'd like
Something similar to what @morozov suggested in #43
Describe alternatives you've considered
The current setup works but is a pain to manage
Describe the bug
A clear and concise description of what the bug is.
Corrupt file when changing context and ns
To Reproduce
Steps to reproduce the behavior:
Change context/ns often and fast
Expected behavior
A clear and concise description of what you expected to happen.
Changing context/ns should not corrupt the state
Is your feature request related to a problem? Please describe.
If we get multiple config files to work, then we could use our own environment variable to handle current session stuff.
Describe the solution you'd like
Merge our env with the main one
Describe alternatives you've considered
Changing KUBECONFIG is risky and makes it harder to identify if we are using a kubesess session.
Additional context
Is your feature request related to a problem? Please describe.
At the moment only context is handled per session, is it possible to handle namespace the same way?
Describe the solution you'd like
A way to make namespace sticky for that session only
Is your feature request related to a problem? Please describe.
Cleaning the cache and resetting the env is fine, but how to debug the actual issue?
Describe the solution you'd like
Expand the troubleshooting guide
Describe the bug
To Reproduce
kc
Expected behavior
Shows the fzf
alternative
Screenshots
$ kc
Possible contexts are:
azure-1
azure-2
azure-3
azure-4
azure-5
azure-6
azure-7
azure-8
Desktop (please complete the following information):
Is your feature request related to a problem? Please describe.
Need to support multiple config files
Describe the solution you'd like
If I have multiple config files, I would expect them to be merged into one
Describe alternatives you've considered
Manually merging them
Is your feature request related to a problem? Please describe.
Should bump version on brew on release.
Is your feature request related to a problem? Please describe.
I want to install from a github release on a mac, the same as I do on linux, but the release binaries are only provided for linux.
Describe the solution you'd like
It seems it is possible to create rust binaries for mac in github actions, e.g. https://github.com/mitsuhiko/rye/blob/main/.github/workflows/release.yml
Describe alternatives you've considered
Use brew on mac or install from source, but that would mean a difference in my dotfiles between mac and linux.
Describe the solution you'd like
A flag to output the current context and namespaces OR environment variables that get populated on context change.
This can then be used to build a custom prompt.
Describe alternatives you've considered
Right now I use kubectx -c
and kubens -c
to get context and namespace to build my prompt. I use this in favor of other solutions because it is significantly faster.
Additional context
Since kubesess
is apparently more efficient than those tools to switch context/namespace, I was wondering if retrieval of current values would perhaps be as fast or even faster.
If this is added, then I wouldn't have a need for kubectx
any longer
Describe the bug
When I change the namespace via kn
(Fish), it takes two attempts to succeed instead of one.
Steps to reproduce
# Check if $KUBECONFIG is set
โ set -q KUBECONFIG && echo Set || echo Not set
Not set
# Try to change the namespace
โ kn strimzi && echo OK || echo Fail
Fail
# Again, check if $KUBECONFIG is set
โ set -q KUBECONFIG && echo Set || echo Not set
Set
# Print $KUBECONFIG value
โ echo $KUBECONFIG
# Again, try to change the namespace
โ kn strimzi && echo OK || echo Fail
OK
Expected behavior
It should take a single attempt to change the namespace.
Desktop (please complete the following information):
Additional context
It looks like kubesess
expects $KUBECONFIG
to be always set. The first failing attempt sets it to an empty string, and the second one succeeds.
Here's what it looks like with additional details:
RUST_BACKTRACE=1 kubesess namespace -c
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/config.rs:110:60
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::panic
3: core::option::Option<T>::unwrap
at /private/tmp/rust-20220923-6877-yszh4a/rustc-1.64.0-src/library/core/src/option.rs:775:21
4: kubesess::config::get_current_session
at /Users/smorozov/Projects/kubesess/src/config.rs:110:34
5: kubesess::modes::namespace
at /Users/smorozov/Projects/kubesess/src/modes.rs:67:18
6: kubesess::Mode::invoke
at /Users/smorozov/Projects/kubesess/src/main.rs:43:32
7: kubesess::main
at /Users/smorozov/Projects/kubesess/src/main.rs:57:5
8: core::ops::function::FnOnce::call_once
at /private/tmp/rust-20220923-6877-yszh4a/rustc-1.64.0-src/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.