v3.6.0
===================================================================== --- New Features ------------------------- - Introducing an optional plugin for `kubectl` facilitation! Check out 'plugins/kubectl/README.md' for more details. --- Changes ------------------------------ - The function which lists all available scwrypts now ignores directories with a top-level base called "plugins." If this is a name conflict, you will need to define your own `SCWRYPTS__LIST_AVAILABLE_SCWRYPTS__<group>` function! (ref the changes in 'zsh/lib/scwrypts/run.module.zsh')
This commit is contained in:
28
plugins/kubectl/set-context
Executable file
28
plugins/kubectl/set-context
Executable file
@ -0,0 +1,28 @@
|
||||
#!/bin/zsh
|
||||
#####################################################################
|
||||
DEPENDENCIES+=()
|
||||
REQUIRED_ENV+=()
|
||||
|
||||
use kubectl --group kubectl
|
||||
|
||||
CHECK_ENVIRONMENT
|
||||
#####################################################################
|
||||
|
||||
MAIN() {
|
||||
local USAGE="
|
||||
usage: [context]
|
||||
|
||||
args:
|
||||
context the full name of the kubeconfig context to set
|
||||
"
|
||||
local CONTEXT="$1"
|
||||
[ $CONTEXT ] || $(KUBECTL__SELECT_CONTEXT)
|
||||
[ $CONTEXT ] || ERROR 'must provide or select a valid kube context'
|
||||
|
||||
CHECK_ERRORS
|
||||
|
||||
KUBECTL__SET_CONTEXT $CONTEXT
|
||||
}
|
||||
|
||||
#####################################################################
|
||||
MAIN $@
|
Reference in New Issue
Block a user