code: func rewriteResolvFile(resolvFilePath string, dns []string, dnsSearch []string, dnsOptions []string) error {
  	if len(resolvFilePath) == 0 {
  		klog.Errorf("ResolvConfPath is empty.")
  		return nil
  	}
  
  	if _, err := os.Stat(resolvFilePath); os.IsNotExist(err) {
  		return fmt.Errorf("ResolvConfPath %q does not exist", resolvFilePath)
  	}
  
  	var resolvFileContent []string
  	for _, srv := range dns {
  		resolvFileContent = append(resolvFileContent, "nameserver "+srv)
  	}
  
  	if len(dnsSearch) > 0 {
  		resolvFileContent = append(resolvFileContent, "search "+strings.Join(dnsSearch, " "))
  	}
  
  	if len(dnsOptions) > 0 {
  		resolvFileContent = append(resolvFileContent, "options "+strings.Join(dnsOptions, " "))
  	}
  
  	if len(resolvFileContent) > 0 {
  		resolvFileContentStr := strings.Join(resolvFileContent, "\n")
  		resolvFileContentStr += "\n"
  
  		klog.V(4).Infof("Will attempt to re-write config file %s with: \n%s", resolvFilePath, resolvFileContent)
  		if err := rewriteFile(resolvFilePath, resolvFileContentStr); err != nil {
  			klog.Errorf("resolv.conf could not be updated: %v", err)
  			return err
  		}
  	}
  
  	return nil
  }
docs: // rewriteResolvFile rewrites resolv.conf file generated by docker.