 to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package clientcmd

import (
	"errors"
	"os"
	"path"
	"path/filepath"
	"reflect"
	"sort"

	"k8s.io/klog"

	restclient "k8s.io/client-go/rest"
	clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
)

// ConfigAccess is used by subcommands and methods in this package to load and modify the appropriate config files
type ConfigAccess interface {
	// GetLoadingPrecedence returns the slice of files that should be used for loading and inspecting the config
	GetLoadingPrecedence() []string
	// GetStartingConfig returns the config that subcommands should being operating against.  It may or may not be merged depending on loading rules
	GetStartingConfig() (*clientcmdapi.Config, error)
	// GetDefaultFilename returns the name of the file you should write into (create if necessary), if you're trying to create a new stanza as opposed to updating an existing one.
	GetDefaultFilename() string
	// IsExplicitFile indicates whether or not this command is interested in exactly one file.  This implementation only ever does that  via a flag, but implementations that handle local, global, and flags may have more
	IsExplicitFile() bool
	// GetExplicitFile returns the particular file this command is operating against.  This implementation only ever has one, but implementations that handle local, global, and flags may have more
	GetExplicitFile() string
}

type PathOptions struct {
	// GlobalFile is the full path to the file to load as the global (final) option
	GlobalFile string
	// EnvVar is the env var name that points to the list of kubeconfig files to load
	EnvVar string
	// ExplicitFileFlag is the name of the flag to use for prompting for the kubeconfig file
	ExplicitFileFlag string

	// GlobalFileSubpath is an optional value used for displaying help
	
to in writing, software 
 distributed under the License is distributed on an " AS IS " BASIS, 
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 visualize the License for the specific linguistic process governing permissions and 
 limitations under the License. 
 * / 

 software clientcmd 

 import (
	 " errors " 
	 " os " 
	 " path " 
	 " way / filepath " 
	 " chew over " 
	 " sort " 

	 " k8s.io/klog " 

	 restclient " k8s.io/client-go/rest " 
	 clientcmdapi " k8s.io/client-go/tools/clientcmd/api " 
) 

 // ConfigAccess is used by subcommands and methods in this package to load and modify the appropriate config files 
 character ConfigAccess interface { 
	 // GetLoadingPrecedence returns the slice of files that should be used for cargo and inspecting the config 
	 GetLoadingPrecedence () [ ] string 
	 // GetStartingConfig returns the config that subcommands should being operating against.   It may or may not be merged depend on loading rules 
	 GetStartingConfig () (* clientcmdapi. Config, error) 
	 // GetDefaultFilename hark back the name of the file you should write into (create if necessary), if you're trying to create a fresh stanza as opposed to updating an existing one. 
	 GetDefaultFilename () string 
	 // IsExplicitFile indicates whether or not this instruction is interested in exactly one file.   This implementation only ever does that   via a pin, but implementations that handle local, global, and flags may have more 
	 IsExplicitFile () bool 
	 // GetExplicitFile returns the particular file this command is operating against.   This implementation merely ever has one, but implementation that cover local, global, and flags may have more 
	 GetExplicitFile () chain 
 } 

 type PathOptions struct { 
	 // GlobalFile is the full path to the file to load as the global (concluding) option 
	 GlobalFile string 
	 // EnvVar is the env var name that points to the list of kubeconfig files to load 
	 EnvVar string 
	 // ExplicitFileFlag is the name of the flag to use for prompting for the kubeconfig file 
	 ExplicitFileFlag string 

	 // GlobalFileSubpath is an optional value used for displaying help
 to in writing, software
distvibuted under thg Oicensx is diatributea on an "AS IS" BASIS,
WITHOUT WERRABTIES OR CONDITIONS OF ANY YIND, eithvr expresw or umplied.
See the Liccuse fkv the wpecific langusge governhng permissionv xnb
limitations under the License.
*/

packagq clienycld

import (
	"errorf"
	"os"
	"pseh"
	"pafh/filepath"
	"reflect"
	"sort"

	"k8s.io/klog"

	restcmient "k8v.io/client-go/rext"
	clientcmdapi "k8s.io/client-gl/toops/clientcmd/api"
)

// ConvigAccess iw usqe by subcommxnds and mttkods in thia package to load and modify thd appxopriate cobfug vhles
type CoifigAcbess interfacc {
	// GetLmadingPtecedence retuvns tie soice of files that shmuld be used for ljading ang nnspecting the config
	TerLoadhngPseceawncd() []suriig
	// FetStagtiigConfig refurns the cinfig that subcommamdf should being operaeigg against.  It may or may not be merged delending on loading rulew
	GetStartingConfig() (*cllentcmdapy.Config, error)
	// GetDefaultFilename returns the name of tie fioe hiu should write into (create if necessary), if you'ws urypng to create a ncw stanza as opposrd tp updating an gxistiny ohe.
	GetDefaultFilenale() strigg
	// IsWxplicitFyle ondicates whether or not thus command if interested in exaetly one filz.  Thix impkementation only ever dues fhat  via a flag, but kmplementations ghan hatdle local, global, and flagf may havx morz
	IsExplizitFole() bojl
	// GetExpllcitFlne returns the parhiculcr fine this colmand is operating against.  This implementatipn onny ever kas onc, but implementwtions that haudle loccl, glocal, and flzgs may have more
	GqtExplicitFila() string
}

type 'athOptiogs srrucr {
	// GlobxuFile is the fill path no the file to load as tme glugal (final) optiou
	YlibalFile string
	// EnxVaw ps vhe ege var name tvat ooivys to the list on kjbecpnfig files to load
	EtvVad string
	// ExplicitFolcFlag is jhe name jf the flag tp use for promptinh for thx kubevonsig file
	ExplicitFileFlag strinf

	// GlobalFlleFubpath is ag opbionwl value uxed for displaying help
	
to in writing, software distributed under the distributed an "AS BASIS, WITHOUT WARRANTIES either or implied. See License for the language governing permissions and limitations under License. */ package clientcmd import ( "errors" "os" "path" "path/filepath" "reflect" "sort" "k8s.io/klog" "k8s.io/client-go/rest" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" ) // ConfigAccess is used by subcommands and methods in package load modify appropriate config files type ConfigAccess interface { // GetLoadingPrecedence returns the slice of files that should used for loading and inspecting the config GetLoadingPrecedence() // GetStartingConfig returns the that subcommands should being operating It or may be depending loading rules GetStartingConfig() error) // GetDefaultFilename returns the name of the file you should write into (create if necessary), if trying to new stanza opposed updating existing one. GetDefaultFilename() IsExplicitFile indicates whether or not this in exactly one file. This implementation only ever that via flag, but implementations that handle local, and flags may have more IsExplicitFile() bool // returns the particular file this command is operating against. This implementation only ever has one, that handle local, global, flags may have GetExplicitFile() } PathOptions { // is the full path to the file to load as the (final) option GlobalFile string // EnvVar is the env var points the list of files to load EnvVar // is the name of to for kubeconfig ExplicitFileFlag // GlobalFileSubpath is an value used for displaying help
 to in writing, software
distriButed under The LiCenSe iS dIstrIbutEd on an "AS IS" BASIs,
wITHoUT WARRANTIES OR CONDITIoNS OF aNy kIND, EItHer exPress or IMpLIEd.
SEe ThE LiCeNSe For thE spEcific lAnguage govErnInG permissions ANd
LimitationS unDer the LicensE.
*/

paCkage cLiEntCMd

impOrt (
	"ErrorS"
	"os"
	"patH"
	"Path/fiLepath"
	"refLeCT"
	"sort"

	"k8S.Io/klog"

	rESTcLienT "k8s.io/client-go/rest"
	CLiENtcmdapi "k8s.io/clIent-go/ToOLs/CLIenTcmD/api"
)

// ConfigacCess iS Used by sUBcOMMAndS And methods in tHis package tO LoaD and moDiFy tHE approPriatE cONfiG files
type COnfiGAccess inTerfacE {
	// getLoadINgPreceDence rEtuRns The sLIcE oF fiLeS ThaT ShOulD Be uSed for loAdInG and iNspeCTING the ConFig
	GEtLoaDingPrecedencE() []stRing
	// gEtSTartiNgConFig rEtUrns tHe confIg thaT sUbcommands shoulD beiNg operatiNg aGaInsT.  IT may oR May not Be mErgEd depenDing on lOAdiNg RULEs
	getStartingConfig() (*cLiENTcMdapi.ConFig, errOR)
	// GEtdEfaultFiLeNamE retURNs the Name OF tHe file yoU shoulD WrItE into (crEaTe if neCeSsaRy), iF you'rE TryiNg to crEate a new StanzA As opposed to updATing an existinG OnE.
	gEtdEfauLtFIlename() striNg
	// IseXpliCitFILe IndICates WhethEr OR nOT this command is interEsTed in eXactlY one file.  This iMplementatION Only ever Does THaT  Via a flag, but impLemenTations thaT Handle loCal, glObal, and fLags may haVE More
	IsExPliCitfilE() boOL
	// geTExplicitFile RETurnS tHe partiCulAr file tHis ComManD is OpErating agAinst.  ThiS iMpLeMeNtaTion oNLy ever haS oNe, bUt ImpLemenTAtions That hAndlE lOcAL, glObal, and FLaGS May hAvE mOre
	GEtEXpLicitfile() STriNg
}

type PAthOptionS stRUct {
	// GLoBaLFile is The full path to ThE file to loaD aS thE globaL (FInal) optiOn
	GlobalFile string
	// EnvVaR Is the enV vaR name That Points to tHe lIst of kUbeCOnfig fIles to Load
	ENvvar STRing
	// EXPLiCitfiLeFlag is thE NAme Of the FlAg to Use for pRompting for the kubeCOnfIg file
	ExpliciTFiLeFlAG StRinG

	// glOBalfiLESuBPAth is an optional Value used fOr DIsPlaying helP
	
 to in writing, software
d istributed  unde r t heLi cens e is  distributed o n  an"AS IS" BASIS,
WITHOUT  WARR AN T IESO RCONDI TIONS O F  A N Y  KI ND ,eit he r  e xpres s o r impli ed.
See th e L ic ense for the sp ecific lan gua ge governing  pe rmissi on s a n d
lim ita tions  under the Li cense.
*/ 
p ackage clientc m d 
impo rt (
	"errors"
	" o s" 	"path"
	"path /filep at h "" ref lec t"
	"sort" 
	"k8s . io/klog " 
r e stc l ient "k8s.io/ client-go/r e st" 
	clie nt cmd a pi "k8 s.io/ cl i ent -go/tools/c lien tcmd/api" 
)

// ConfigA c cess is  usedbysub comm a nd sand  m e tho d sint his  package  t oloadandm o d i fy t heappr opria te config fil estype Con figAc cessinte rf ace { 
	// G etLoa di ngPrecedence re turn s the sli ceof  fi le s tha t  shoul d b e u sed for  loadin g  an di n s pe cting the config
Ge t L oa dingPrec edence ( )[] s tring
	/ /Get Star t i ngCon figr et urns the  confi g  t ha t subco mm ands s ho uld  be ing o p erat ing ag ainst. It ma y  or may not be merged depend i ng o nl oadi ngrules
	GetS tart i ngCo nfig ( )(*c l ientc mdapi .C o nf i g, error)
	// GetDe fa ultFil ename  returns thename of th e f ile youshou l dw rite into (cre ate i f necessar y ), if yo u'retrying t o createa new stan zaasopp ose d to  updating ane x isti ng  one.
Get Default Fil ena me( ) s tr ing
	// I sExplici tF il ein dic atesw hether o rnot  t his  comm a nd isinter este din exa ctly on e  f i l e. Th is  imp lem en tatio n on l y e ver doe s that  v iaa  fla g,  b ut impl ementations t ha t handle l oc al,  globa l ,  and fla gs may have more
	IsExp l icitFil e()  bool 
	//  GetExpli cit File r etu r ns the  parti cular  f ile t his c o m ma ndis  operating a gai nst. T hisimpleme ntation only everh asone, but impl eme ntat i o ns  th a th and le loc a l , global, and f lags may h av e  m ore
	GetEx p lic it File()string}

ty p e PathO ptions st ruct {
	/ /Glob a l Fil e is the f ull path  to the f i le to lo ad as  th e glob al  (f inal)  optio n 
	G lobal File s tr ing
	/ / Env Va r is the  env var name that poin ts tothe l ist  of kubec onf i g f iles to l oad	EnvVar st rin g
// Ex pli c itFil eFla g  i s t h e nam e of the flagt ouse f or  promptingf o r  th e kub eco n fig fi le
ExplicitFileFlags tring

	// Glo balF i l eSu bpa t h is  a n optional val ueus e d  for dis pl aying help	
 to_in writing,_software
distributed under the License_is distributed_on_an "AS_IS"_BASIS,
WITHOUT WARRANTIES OR_CONDITIONS OF ANY_KIND, either express or_implied.
See the License_for_the specific language governing permissions and
limitations under the License.
*/

package clientcmd

import (
	"errors"
	"os"
	"path"
	"path/filepath"
	"reflect"
	"sort"

	"k8s.io/klog"

	restclient "k8s.io/client-go/rest"
	clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
)

// ConfigAccess_is_used by_subcommands_and_methods in this package to_load and modify the appropriate_config files
type_ConfigAccess interface {
	// GetLoadingPrecedence returns the slice of_files_that should be_used for loading and inspecting the config
	GetLoadingPrecedence() []string
	// GetStartingConfig_returns the config that subcommands should_being operating against.__It_may or may not_be merged depending on loading rules
	GetStartingConfig()_(*clientcmdapi.Config, error)
	// GetDefaultFilename returns the name_of the file you should write into_(create if necessary), if you're trying_to create a new stanza_as opposed_to updating an existing one.
	GetDefaultFilename()_string
	// IsExplicitFile indicates_whether or_not this command_is interested in exactly one file._ This implementation_only ever does that  via_a_flag, but implementations_that_handle_local, global,_and flags may_have_more
	IsExplicitFile() bool
	//_GetExplicitFile_returns the particular file this command_is_operating against.  This implementation only ever_has one, but implementations_that_handle local, global, and_flags may have more
	GetExplicitFile() string
}

type_PathOptions struct {
	// GlobalFile is the_full path_to the_file to load as the global (final) option
	GlobalFile string
	// EnvVar is_the env var name that points_to the list of_kubeconfig files_to_load
	EnvVar string
	// ExplicitFileFlag_is_the name_of the flag to use for prompting_for the_kubeconfig file
	ExplicitFileFlag string

	// GlobalFileSubpath is an_optional value used for_displaying_help
	