INNER CODE UNIT · Go
Client
krisnova/naml · client.go:63
func Client() (*kubernetes.Clientset, error) {
if cachedClient != nil {
return cachedClient, nil
}
// Windows support requires us to split on ";" instead of ":"
// I personally have no use case to care for this. Pull requests accepted.
configs := strings.Split(kubeConfigPathValue, ":")
if len(configs) > 1 {
for _, config := range configs {
client, err := ClientFromPath(path.Join(homedir.HomeDir(), KubeconfigDefaultDirectory, config))
if err == nil {
// Just pick the first one
return client, nil
}
}
// If we get here, we have no valid config
// We can just silently try and fail...