plugin/etcd+kubernetes: Persist truncated state to client if CNAME lookup response is truncated (#4715)

Persist the TC bit to client response for truncated CNAME lookups.
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
Chris O'Haver 2022-02-22 09:38:57 -05:00 committed by GitHub
parent d3a118e1c1
commit 66dc74caeb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 206 additions and 110 deletions

View file

@ -15,7 +15,6 @@ import (
"github.com/coredns/coredns/plugin/kubernetes/object"
"github.com/coredns/coredns/plugin/pkg/dnsutil"
"github.com/coredns/coredns/plugin/pkg/fall"
"github.com/coredns/coredns/plugin/pkg/upstream"
"github.com/coredns/coredns/request"
"github.com/miekg/dns"
@ -35,7 +34,7 @@ import (
type Kubernetes struct {
Next plugin.Handler
Zones []string
Upstream *upstream.Upstream
Upstream Upstreamer
APIServerList []string
APICertAuth string
APIClientCert string
@ -53,6 +52,11 @@ type Kubernetes struct {
autoPathSearch []string // Local search path from /etc/resolv.conf. Needed for autopath.
}
// Upstreamer is used to resolve CNAME or other external targets
type Upstreamer interface {
Lookup(ctx context.Context, state request.Request, name string, typ uint16) (*dns.Msg, error)
}
// New returns a initialized Kubernetes. It default interfaceAddrFunc to return 127.0.0.1. All other
// values default to their zero value, primaryZoneIndex will thus point to the first zone.
func New(zones []string) *Kubernetes {