Fully go to v2 of the xds proto

Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben
2020-07-14 13:55:19 +02:00
parent 45ff6dd1c4
commit e177ae25a4
3 changed files with 5 additions and 5 deletions

View File

@@ -11,7 +11,7 @@ of clusters. A cluster is defined as: "A group of logically similar endpoints th
connects to." Each cluster has a name, which *traffic* extends to be a domain name. See "Naming connects to." Each cluster has a name, which *traffic* extends to be a domain name. See "Naming
Clusters" below. Clusters" below.
The use case for this plugin is when a cluster has endpoints running in multiple (Kubernetes?) The use case for this plugin is when a cluster has endpoints running in multiple (e.g. Kubernetes)
clusters and you need to steer traffic to (or away) from these endpoints, i.e. endpoint A needs to clusters and you need to steer traffic to (or away) from these endpoints, i.e. endpoint A needs to
be upgraded, so all traffic to it is drained. Or the entire Kubernetes needs to upgraded, and *all* be upgraded, so all traffic to it is drained. Or the entire Kubernetes needs to upgraded, and *all*
endpoints need to be drained from it. endpoints need to be drained from it.

View File

@@ -12,7 +12,7 @@ import (
"github.com/coredns/coredns/plugin/metrics" "github.com/coredns/coredns/plugin/metrics"
clog "github.com/coredns/coredns/plugin/pkg/log" clog "github.com/coredns/coredns/plugin/pkg/log"
"github.com/coredns/coredns/plugin/pkg/parse" "github.com/coredns/coredns/plugin/pkg/parse"
pkgtls "github.com/coredns/coredns/plugin/pkg/tls" ctls "github.com/coredns/coredns/plugin/pkg/tls"
"github.com/coredns/coredns/plugin/pkg/transport" "github.com/coredns/coredns/plugin/pkg/transport"
"github.com/coredns/coredns/plugin/traffic/xds" "github.com/coredns/coredns/plugin/traffic/xds"
@@ -121,7 +121,7 @@ func parseTraffic(c *caddy.Controller) (*Traffic, error) {
return nil, c.ArgErr() return nil, c.ArgErr()
} }
tlsConfig, err = pkgtls.NewTLSConfigFromArgs(args...) tlsConfig, err = ctls.NewTLSConfigFromArgs(args...)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@@ -13,7 +13,7 @@ import (
"github.com/coredns/coredns/plugin/traffic/xds" "github.com/coredns/coredns/plugin/traffic/xds"
"github.com/coredns/coredns/request" "github.com/coredns/coredns/request"
corepb "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" corepb2 "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
"github.com/miekg/dns" "github.com/miekg/dns"
) )
@@ -129,7 +129,7 @@ func (t *Traffic) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
m.Answer = append(m.Answer, &dns.TXT{ m.Answer = append(m.Answer, &dns.TXT{
Hdr: dns.RR_Header{Name: state.QName(), Rrtype: dns.TypeTXT, Class: dns.ClassINET, Ttl: 5}, Hdr: dns.RR_Header{Name: state.QName(), Rrtype: dns.TypeTXT, Class: dns.ClassINET, Ttl: 5},
Txt: []string{"100", "100", strconv.Itoa(int(sa.Port())), target, corepb.HealthStatus_name[int32(sa.Health)]}}) Txt: []string{"100", "100", strconv.Itoa(int(sa.Port())), target, corepb2.HealthStatus_name[int32(sa.Health)]}})
m.Extra = append(m.Extra, &dns.TXT{Hdr: dns.RR_Header{Name: target, Rrtype: dns.TypeTXT, Class: dns.ClassINET, Ttl: 5}, Txt: []string{sa.Address().String()}}) m.Extra = append(m.Extra, &dns.TXT{Hdr: dns.RR_Header{Name: target, Rrtype: dns.TypeTXT, Class: dns.ClassINET, Ttl: 5}, Txt: []string{sa.Address().String()}})
} }
default: default: