===================================================================== Excited to bring V5 to life. This includes some BREAKING CHANGES to several aspects of ZSH-type scwrypts. Please refer to the readme for upgrade details (specifically docs/upgrade/v4-to-v5.md) --- New Features ------------------------- - ZSH testing library with basic mock capabilities - new scwrypts environment file format includes metadata and more advanced features like optional parent env overrides, selection inheritence, and improved structurual flexibility - speedup cache for non-CI runs of ZSH-type scwrypts - ${scwryptsmodule} syntax now allows a consistent unique-naming scheme for functions in ZSH-type scwrypts while providing better insight into origin of API calls in other modules - reusable, case-statement-driven argument parsers in ZSH-type scwrypts --- Changes ------------------------------ - several utility function renames in ZSH-type scwrypts to improve consistency - documentation comments included in ZSH libraries - ZSH-type scwrypts now allow library modules to live alongside executables (zsh/lib still supported; autodetection determines default) --- Bug Fixes ---------------------------- - hardened environment checking for REQUIRED_ENV variables; this removes the ability to overwrite variables in local function contexts
50 lines
1.1 KiB
Bash
Executable File
50 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env zsh
|
|
use kubectl --group kube
|
|
#####################################################################
|
|
|
|
MAIN() {
|
|
local USAGE="
|
|
usage: [service] [...options...]
|
|
|
|
args:
|
|
service (optional) name of the service to forward locally
|
|
|
|
options:
|
|
--context override context
|
|
--namespace override namespace
|
|
--subsession kube.redis subsession (default 0)
|
|
|
|
to show a required password on screen, use both:
|
|
--password-secret Secret resource
|
|
--password-key key within Secret's 'data'
|
|
|
|
-h, --help show this dialogue and exit
|
|
"
|
|
local CONTEXT NAMESPACE SERVICE
|
|
local SUBSESSION=0
|
|
|
|
while [[ $# -gt 0 ]]
|
|
do
|
|
case $1 in
|
|
--context ) CONTEXT=$2; shift 1 ;;
|
|
--namespace ) NAMESPACE=$2; shift 1 ;;
|
|
--subsession ) SUBSESSION=$2; shift 1 ;;
|
|
|
|
--password-secret ) PASSWORD_SECRET=$2; shift 1 ;;
|
|
--password-key ) PASSWORD_KEY=$2; shift 1 ;;
|
|
|
|
-h | --help ) utils.io.usage; return 0 ;;
|
|
|
|
* )
|
|
[ $SERVICE ] && echo.error "unexpected argument '$2'"
|
|
SERVICE=$1
|
|
;;
|
|
esac
|
|
shift 1
|
|
done
|
|
|
|
utils.check-errors --fail
|
|
|
|
kube.kubectl.serve
|
|
}
|