|
|
|
@ -258,6 +258,35 @@ func getKubeConfigFiles(v *viper.Viper) map[string]string {
|
|
|
|
|
return kubeconfigmap
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// getCaFile finds which of the set of client certificate authorities files exist
|
|
|
|
|
func getCaFile(v *viper.Viper) map[string]string {
|
|
|
|
|
cafilemap := make(map[string]string)
|
|
|
|
|
|
|
|
|
|
for _, component := range v.GetStringSlice("components") {
|
|
|
|
|
s := v.Sub(component)
|
|
|
|
|
if s == nil {
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cafile := findConfigFile(s.GetStringSlice("cafile"))
|
|
|
|
|
if cafile == "" {
|
|
|
|
|
if s.IsSet("defaultcafile") {
|
|
|
|
|
cafile = s.GetString("defaultcafile")
|
|
|
|
|
glog.V(2).Info(fmt.Sprintf("Using default client CA file name '%s' for component %s", cafile, component))
|
|
|
|
|
} else {
|
|
|
|
|
glog.V(2).Info(fmt.Sprintf("Missing client CA file for %s", component))
|
|
|
|
|
cafile = component
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
glog.V(2).Info(fmt.Sprintf("Component %s uses client CA file '%s'", component, cafile))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cafilemap[component] = cafile
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return cafilemap
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// verifyBin checks that the binary specified is running
|
|
|
|
|
func verifyBin(bin string) bool {
|
|
|
|
|
|
|
|
|
|