do not use logreader if it doesn't exist
This commit is contained in:
parent
7d4d63f18b
commit
1e9c20e0a9
@ -994,11 +994,15 @@ func corednsAddHost(ctx context.Context, runtime k3drt.Runtime, cluster *k3d.Clu
|
|||||||
break
|
break
|
||||||
} else {
|
} else {
|
||||||
msg := fmt.Sprintf("error patching the CoreDNS ConfigMap to include entry '%s': %+v", hostsEntry, err)
|
msg := fmt.Sprintf("error patching the CoreDNS ConfigMap to include entry '%s': %+v", hostsEntry, err)
|
||||||
readlogs, err := ioutil.ReadAll(logreader)
|
if logreader != nil {
|
||||||
if err != nil {
|
readlogs, err := ioutil.ReadAll(logreader)
|
||||||
l.Log().Debugf("error reading the logs from failed CoreDNS patch exec process in node %s: %v", node.Name, err)
|
if err != nil {
|
||||||
|
l.Log().Debugf("error reading the logs from failed CoreDNS patch exec process in node %s: %v", node.Name, err)
|
||||||
|
} else {
|
||||||
|
msg += fmt.Sprintf("\nLogs: %s", string(readlogs))
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
msg += fmt.Sprintf("\nLogs: %s", string(readlogs))
|
l.Log().Debugf("no logreader returned for exec process")
|
||||||
}
|
}
|
||||||
l.Log().Debugln(msg)
|
l.Log().Debugln(msg)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user