@@ -59,6 +59,7 @@ func loadConfigurationBytes(client clientset.Interface, w io.Writer, logPrefix,
}elseiferr!=nil{
return[]byte{},fmt.Errorf("an unexpected error happened when trying to get the ConfigMap %q in the %s namespace: %v",constants.MasterConfigurationConfigMap,metav1.NamespaceSystem,err)
}
// TODO: Load the kube-proxy and kubelet ComponentConfig ConfigMaps here as different YAML documents and append to the byte slice
fmt.Fprintf(w,"[%s] FYI: You can look at this config file with 'kubectl -n %s get cm %s -oyaml'\n",logPrefix,metav1.NamespaceSystem,constants.MasterConfigurationConfigMap)
// DetectUnsupportedVersion reads YAML bytes, extracts the TypeMeta information and errors out with an user-friendly message if the API spec is too old for this kubeadm version
// Invalid: The caller asked to not print the componentconfigs if defaulted, but defaultComponentConfigs() wasn't able to create default objects to use for reference
if!ok{
return[]byte{},fmt.Errorf("couldn't create a default componentconfig object")
}
// If the real ComponentConfig object differs from the default, print it out. If not, there's no need to print it out, so skip it
if!reflect.DeepEqual(realobj,defaultedobj){
contentBytes,err:=registration.Marshal(realobj)
iferr!=nil{
return[]byte{},err
}
componentConfigContent[string(kind)]=contentBytes
}
}
}
// Sort the ComponentConfig files by kind when marshalling