getAuthInfo returns the clientcmdapi.AuthInfo, or an error if a required auth info is not found.
()
| 422 | |
| 423 | // getAuthInfo returns the clientcmdapi.AuthInfo, or an error if a required auth info is not found. |
| 424 | func (config *DirectClientConfig) getAuthInfo() (clientcmdapi.AuthInfo, error) { |
| 425 | authInfos := config.config.AuthInfos |
| 426 | authInfoName, required := config.getAuthInfoName() |
| 427 | |
| 428 | mergedAuthInfo := clientcmdapi.NewAuthInfo() |
| 429 | if configAuthInfo, exists := authInfos[authInfoName]; exists { |
| 430 | mergo.MergeWithOverwrite(mergedAuthInfo, configAuthInfo) |
| 431 | } else if required { |
| 432 | return clientcmdapi.AuthInfo{}, fmt.Errorf("auth info %q does not exist", authInfoName) |
| 433 | } |
| 434 | mergo.MergeWithOverwrite(mergedAuthInfo, config.overrides.AuthInfo) |
| 435 | |
| 436 | return *mergedAuthInfo, nil |
| 437 | } |
| 438 | |
| 439 | // getCluster returns the clientcmdapi.Cluster, or an error if a required cluster is not found. |
| 440 | func (config *DirectClientConfig) getCluster() (clientcmdapi.Cluster, error) { |
no test coverage detected