mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 15:05:20 +00:00
remove auth-path from kubeconfig
This commit is contained in:
@@ -96,16 +96,12 @@ func ShortenConfig(config *Config) {
|
||||
}
|
||||
|
||||
// Flatten changes the config object into a self contained config (useful for making secrets)
|
||||
// AuthPath is not handled.
|
||||
func FlattenConfig(config *Config) error {
|
||||
for key, authInfo := range config.AuthInfos {
|
||||
baseDir, err := MakeAbs(path.Dir(authInfo.LocationOfOrigin), "")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(authInfo.AuthPath) != 0 {
|
||||
return fmt.Errorf("auth path of %v is not empty: %v", key, authInfo.AuthPath)
|
||||
}
|
||||
|
||||
if err := FlattenContent(&authInfo.ClientCertificate, &authInfo.ClientCertificateData, baseDir); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user