Unblock startup if kubernetes API is unavailable (#2126)
This commit is contained in:
parent
fdb31a27f3
commit
6539a10a62
3 changed files with 67 additions and 8 deletions
|
@ -65,6 +65,10 @@ func (k Kubernetes) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.M
|
|||
if k.Fall.Through(state.Name()) {
|
||||
return plugin.NextOrFailure(k.Name(), k.Next, ctx, w, r)
|
||||
}
|
||||
if !k.APIConn.HasSynced() {
|
||||
// If we haven't synchronized with the kubernetes cluster, return server failure
|
||||
return plugin.BackendError(&k, zone, dns.RcodeServerFailure, state, nil /* err */, opt)
|
||||
}
|
||||
return plugin.BackendError(&k, zone, dns.RcodeNameError, state, nil /* err */, opt)
|
||||
}
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue