code: func DeployedDNSAddon(client clientset.Interface) (kubeadmapi.DNSAddOnType, string, error) {
  	deploymentsClient := client.AppsV1().Deployments(metav1.NamespaceSystem)
  	deployments, err := deploymentsClient.List(metav1.ListOptions{LabelSelector: "k8s-app=kube-dns"})
  	if err != nil {
  		return "", "", errors.Wrap(err, "couldn't retrieve DNS addon deployments")
  	}
  
  	switch len(deployments.Items) {
  	case 0:
  		return "", "", nil
  	case 1:
  		addonName := deployments.Items[0].Name
  		addonType := kubeadmapi.CoreDNS
  		if addonName == kubeadmconstants.KubeDNSDeploymentName {
  			addonType = kubeadmapi.KubeDNS
  		}
  		addonImage := deployments.Items[0].Spec.Template.Spec.Containers[0].Image
  		addonImageParts := strings.Split(addonImage, ":")
  		addonVersion := addonImageParts[len(addonImageParts)-1]
  		return addonType, addonVersion, nil
  	default:
  		return "", "", errors.Errorf("multiple DNS addon deployments found: %v", deployments.Items)
  	}
  }
docs: // DeployedDNSAddon returns the type of DNS addon currently deployed