mirror of
https://github.com/coredns/coredns.git
synced 2025-10-29 09:14:17 -04:00
Unblock startup if kubernetes API is unavailable (#2126)
This commit is contained in:
committed by
Chris O'Haver
parent
fdb31a27f3
commit
6539a10a62
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user