Commit ffeb2323 authored by shashidharatd's avatar shashidharatd

Avoid removing kube-dns configmap

parent 7b4bec03
...@@ -181,18 +181,14 @@ func deleteConfigMapFromCluster(hostClientset internalclientset.Interface, secre ...@@ -181,18 +181,14 @@ func deleteConfigMapFromCluster(hostClientset internalclientset.Interface, secre
if err != nil { if err != nil {
return err return err
} }
if _, ok := configMap.Data[util.FedDomainMapKey]; !ok {
return clientset.Core().ConfigMaps(metav1.NamespaceSystem).Delete(util.KubeDnsConfigmapName, &metav1.DeleteOptions{})
}
newFedMapValue := removeConfigMapString(configMap.Data[util.FedDomainMapKey], domainMap) if _, ok := configMap.Data[util.FedDomainMapKey]; !ok {
if newFedMapValue != "" { return nil
configMap.Data[util.FedDomainMapKey] = newFedMapValue
_, err := clientset.Core().ConfigMaps(metav1.NamespaceSystem).Update(configMap)
return err
} }
configMap.Data[util.FedDomainMapKey] = removeConfigMapString(configMap.Data[util.FedDomainMapKey], domainMap)
return clientset.Core().ConfigMaps(metav1.NamespaceSystem).Delete(util.KubeDnsConfigmapName, &metav1.DeleteOptions{}) _, err = clientset.Core().ConfigMaps(metav1.NamespaceSystem).Update(configMap)
return err
} }
// deleteSecret deletes the secret with the given name from the host // deleteSecret deletes the secret with the given name from the host
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment