func writeKubeletConfigFile(internal *kubeletconfig.KubeletConfiguration, path string) error {
	// extract the KubeletConfiguration and convert to versioned
	versioned := &v1beta1.KubeletConfiguration{}
	scheme, _, err := scheme.NewSchemeAndCodecs()
	if err != nil {
		return err
	}
	if err := scheme.Convert(internal, versioned, nil); err != nil {
		return err
	}
	// encode
	encoder, err := newKubeletConfigJSONEncoder()
	if err != nil {
		return err
	}
	data, err := runtime.Encode(encoder, versioned)
	if err != nil {
		return err
	}
	// create the directory, if it does not exist
	dir := filepath.Dir(path)
	if err := os.MkdirAll(dir, 0755); err != nil {
		return err
	}
	// write the file
	if err := ioutil.WriteFile(path, data, 0755); err != nil {
		return err
	}
	return nil
}
// writeKubeletConfigFile writes the kubelet config file based on the args and returns the filename
writeKubeletConfigFile writes the kubelet config file based on the args and returns the filename
// writeKubeletConfigFile writes the kubelet config file based on the args and returns the filename
func writeKubeletConfigFile(internal *kubeletconfig.KubeletConfiguration, path string) error {
	versioned := &v1beta1.KubeletConfiguration{}
	scheme, _, err := scheme.NewSchemeAndCodecs()
	if err != nil {
		return err
	}
	if err := scheme.Convert(internal, versioned, nil); err != nil {
		return err
	}
	encoder, err := newKubeletConfigJSONEncoder()
	if err != nil {
		return err
	}
	data, err := runtime.Encode(encoder, versioned)
	if err != nil {
		return err
	}
	dir := filepath.Dir(path)
	if err := os.MkdirAll(dir, 0755); err != nil {
		return err
	}
	if err := ioutil.WriteFile(path, data, 0755); err != nil {
		return err
	}
	return nil
}
func writeKubeletConfigFile ( internal * kubeletconfig . KubeletConfiguration , path string ) error { versioned := & v1beta1 . KubeletConfiguration { } scheme , _ , err := scheme . NewSchemeAndCodecs ( ) if err != nil { return err } if err := scheme . Convert ( internal , versioned , nil ) ; err != nil { return err } encoder , err := newKubeletConfigJSONEncoder ( ) if err != nil { return err } data , err := runtime . Encode ( encoder , versioned ) if err != nil { return err } dir := filepath . Dir ( path ) if err := os . MkdirAll ( dir , 0755 ) ; err != nil { return err } if err := ioutil . WriteFile ( path , data , 0755 ) ; err != nil { return err } return nil }
writeKubeletConfigFile writes the kubelet config file based on the args and returns the filename
writeKubeletConfigFile writes the kubelet config file based on the args and returns the filename
// extract the KubeletConfiguration and convert to versioned // encode // create the directory, if it does not exist // write the file