From c4fc086061b48d88fb52c409187bfac67ec2823c Mon Sep 17 00:00:00 2001 From: thomasliddledba Date: Tue, 20 Jul 2021 07:35:19 -0400 Subject: [PATCH] fixes #3 --- README.md | 4 ++++ bin/kubectxwin.exe | Bin 26624 -> 27136 bytes kubectxwin.ps1 | 14 +++++++++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9e66b7f..7ed1628 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,10 @@ sandbox $ kubectxwin set sandbox Switched to context "sandbox". +$ kubectxwin set 'n/a' +Context "no-context" modified. +Switched to context "no-context". + $ kubectxwin rn sandbox sandbox-old Context "sandbox" renamed to "sandbox-old". diff --git a/bin/kubectxwin.exe b/bin/kubectxwin.exe index 08bd129d55c62c0a930ec04dfb9a67045c0780cb..8fc678100e8c4ea464c7a5a3ef0db7485d08aaec 100644 GIT binary patch delta 1318 zcmZuxOKcNY6uobh1cF8QIi5I%*e3i<#n=QCgetJXNyc^tC&6}-1xdyUV?; zbKdpLKNRzi#1G%Bzx?aJqqOimBTaaOhe$@2R)cMGm5ceN-@hapkb!xkKkF*tH5?Wr z%QlQ462d#m--?K^`Ks6~O8iu;578XLczW<^R8KRVM1x&K0=`Mqz+%L3v)Uc6cD&gy zSG&A*YZBB6TnA{JPEm$pl%y$slG@BaWxP(3cF}2^bW@IY|33?U56))D#`$OD&=BpU z6ivboQa@}4z6Cpu?g=U(zZ?Ce|2h0g)D6NKG{N6zbberV9xBoa>OiL~GWXCd4XcV0 zG7CTuL5G8M1~`XNDe(>=9z~}t9izBH*rO2G=+i}I{w@>ba@yeS=I&quQ*B&j9DEnf z(dV$52mU-}2Ki^RAtGny)$A$@iQ0k+Hccs36JXs}#mKMI$;PpT{35SN?cLZ9J&NF+ zKnJPAab%9eTHrqnb#wT2fJaQfaJbKkxL@~PXz)w|uDk+=j`NMQ9xN+@N%$$0bYS=p zfEUqPNA@AB6L7wP&@#f`ka1Y{wb!RLC~J@OK} z)VdtwU#!56v%nF<YW9l*uIf*M- zop0saJhin&4#y8|<@>p|fLz3Kts5qMuv9#d-&2@Ylh5FfQ{(dSnkbAP>Z$S!xjs@+ zWgT_?URQ@cb$1rRVrB2i`}gb}Z&F{mrN)OZ>MpwDgB=a4|G}rM_B6?_RHzcx#hiQR W$Xekxjs91!h4#6tj{Yqw#*()K?;3^x delta 1057 zcmZuwOH30{6g@KnDnz7qunrYrXcS^KDM?M#8ln5@e{WO5*KbnP1N|;7&p4|ya5ptCwZB9ckVss+;iWXc&bfIY3EN@ z3|$}EgSqD=bge)u0QNGlWH$I^eDYen@ZvZSQ-KNKUCyNC6ieHe|3g)lbM2M0npf+R zyIQ4oP-e7>@+lUmC&Z;A7lT`Ys-1wweHh4->Xa|rqCYhBb51c_m-Ty2x#P0*$4+_X z3hUGMuHd;7gH^pi{)YAP%4JILs>{Yl#s(fSw$8EQL^+T%q#5EiALz>snK4a0V8~DN zfSxg=tE8>ussVV~V|X0^ipcE=wudPLKLXh&C2zg@`IFhZ4MvW1hb!b$p$`p|+NIT>?HU2~D67W+}d*a*7_p%EkEZ`xw^pc#j-1Ec6m)rMO15IM-~K7}cc-Midr{`bwt|DbruRWGTq$FZ4TK}1>6 z&37C=DQznIztZA`N`q9SYC=TuduO#~kU|m>9J8?+s6%xW$C%yse&&a%e>&pL=0vXK z$%k;E6=ZS`f7f6e4d|rUJ{*}Z>qJbZ+lxynmJ$yWwuYcS<|Rq*!%nnfP%^ERORKq0 z(V$xKM%r^KB : switch to context + kubectxwin set | 'n/a' : switch context Note: 'n/a' will create/set a new empty context kubectxwin rn : rename context kubectxwin rm : delete context - kubectxwin help : display usage" + kubectxwin help : display usage + " } function current_context() { @@ -48,7 +49,14 @@ function list_contexts() { } function switch_context($context) { - kubectl config use-context $context + if ($context -eq 'n/a') { + kubectl config set-context no-context + kubectl config use-context no-context + } + else { + kubectl config use-context $context + } + } function main() {