42 lines
		
	
	
		
			804 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			804 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/zsh
 | 
						|
use kubectl --group kubectl
 | 
						|
#####################################################################
 | 
						|
 | 
						|
MAIN() {
 | 
						|
	local USAGE="
 | 
						|
	usage: [namespace] [...options...]
 | 
						|
 | 
						|
	args:
 | 
						|
	  namespace   (optional) the full name of the namespace context to set
 | 
						|
 | 
						|
	options:
 | 
						|
	  --subsession   REDIS subsession (default 0)
 | 
						|
 | 
						|
	  -h, --help   show this dialogue and exit
 | 
						|
	"
 | 
						|
	local NAMESPACE
 | 
						|
	local SUBSESSION=0
 | 
						|
 | 
						|
	while [[ $# -gt 0 ]]
 | 
						|
	do
 | 
						|
		case $1 in
 | 
						|
			--subsession ) SUBSESSION=$2; shift 1 ;;
 | 
						|
 | 
						|
			-h | --help ) USAGE; return 0 ;;
 | 
						|
 | 
						|
			* )
 | 
						|
				[ $NAMESPACE ] && ERROR "unexpected argument '$2'"
 | 
						|
				NAMESPACE=$1
 | 
						|
				;;
 | 
						|
		esac
 | 
						|
		shift 1
 | 
						|
	done
 | 
						|
 | 
						|
	[ $NAMESPACE ] || NAMESPACE=$(KUBECTL__SELECT_NAMESPACE)
 | 
						|
	[ $NAMESPACE ] || ERROR 'must provide or select a valid namespace'
 | 
						|
 | 
						|
	CHECK_ERRORS
 | 
						|
 | 
						|
	KUBECTL__SET_NAMESPACE $NAMESPACE
 | 
						|
}
 |