log.Warnf("Failed to add extra entry '%s' to /etc/hosts in node '%s'",hostsEntry,node.Name)
etcHostsFailureCount++
}
}
ifetcHostsFailureCount<len(cluster.Nodes){
hostRecordSuccessMessage+=fmt.Sprintf("Successfully added host record to /etc/hosts in %d/%d nodes",(len(cluster.Nodes)-etcHostsFailureCount),len(cluster.Nodes))
}
patchCmd:=`test=$(kubectl get cm coredns -n kube-system --template='{{.data.NodeHosts}}' | sed -n -E -e '/[0-9\.]{4,12}\s+host\.k3d\.internal$/!p' -e '$a`+hostsEntry+`' | tr '\n' '^' | xargs -0 printf '{"data": {"NodeHosts":"%s"}}'| sed -E 's%\^%\\n%g') && kubectl patch cm coredns -n kube-system -p="$test"`
log.Warnf("Failed to add extra entry '%s' to /etc/hosts in node '%s'",hostsEntry,node.Name)
etcHostsFailureCount++
}
}
ifetcHostsFailureCount<len(cluster.Nodes){
hostRecordSuccessMessage+=fmt.Sprintf("Successfully added host record to /etc/hosts in %d/%d nodes",(len(cluster.Nodes)-etcHostsFailureCount),len(cluster.Nodes))
}
patchCmd:=`test=$(kubectl get cm coredns -n kube-system --template='{{.data.NodeHosts}}' | sed -n -E -e '/[0-9\.]{4,12}\s+host\.k3d\.internal$/!p' -e '$a`+hostsEntry+`' | tr '\n' '^' | xargs -0 printf '{"data": {"NodeHosts":"%s"}}'| sed -E 's%\^%\\n%g') && kubectl patch cm coredns -n kube-system -p="$test"`