code: func WriteConfigFile(fileName string, cfg *kubeschedulerconfig.KubeSchedulerConfiguration) error {
  	const mediaType = runtime.ContentTypeYAML
  	info, ok := runtime.SerializerInfoForMediaType(kubeschedulerscheme.Codecs.SupportedMediaTypes(), mediaType)
  	if !ok {
  		return fmt.Errorf("unable to locate encoder -- %q is not a supported media type", mediaType)
  	}
  
  	encoder := kubeschedulerscheme.Codecs.EncoderForVersion(info.Serializer, kubeschedulerconfigv1alpha1.SchemeGroupVersion)
  
  	configFile, err := os.Create(fileName)
  	if err != nil {
  		return err
  	}
  	defer configFile.Close()
  	if err := encoder.Encode(cfg, configFile); err != nil {
  		return err
  	}
  
  	return nil
  }
docs: // WriteConfigFile writes the config into the given file name as YAML.