| 135 | } |
| 136 | |
| 137 | func NewDefaultPathOptions() *PathOptions { |
| 138 | ret := &PathOptions{ |
| 139 | GlobalFile: RecommendedHomeFile, |
| 140 | EnvVar: RecommendedConfigPathEnvVar, |
| 141 | ExplicitFileFlag: RecommendedConfigPathFlag, |
| 142 | |
| 143 | GlobalFileSubpath: path.Join(RecommendedHomeDir, RecommendedFileName), |
| 144 | |
| 145 | LoadingRules: NewDefaultClientConfigLoadingRules(), |
| 146 | } |
| 147 | ret.LoadingRules.DoNotResolvePaths = true |
| 148 | |
| 149 | return ret |
| 150 | } |
| 151 | |
| 152 | // ModifyConfig takes a Config object, iterates through Clusters, AuthInfos, and Contexts, uses the LocationOfOrigin if specified or |
| 153 | // uses the default destination file to write the results into. This results in multiple file reads, but it's very easy to follow. |