Unverified Commit 5d6385a8 authored by renovate[bot]'s avatar renovate[bot] Committed by GitHub
Browse files

housekeeping: github.com/envoyproxy/go-control-plane to v0.10.0 (#1834)

parent ec3eb35c
Showing with 24 additions and 22 deletions
+24 -22
......@@ -19,7 +19,7 @@ require (
github.com/cactus/go-statsd-client/statsd v0.0.0-20200623234511-94959e3146b2
github.com/coreos/go-oidc/v3 v3.1.0
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/envoyproxy/go-control-plane v0.9.9
github.com/envoyproxy/go-control-plane v0.10.0
github.com/envoyproxy/protoc-gen-validate v0.6.2
github.com/fullstorydev/grpcurl v1.8.5
github.com/go-git/go-billy/v5 v5.3.1
......
......@@ -140,8 +140,9 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed h1:OZmjad4L3H8ncOIR8rnb5MREYqG8ixi5+WbeUsquF0c=
github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe h1:QJDJubh0OEcpeGjC7/8uF9tt4e39U/Ya1uyK+itnNPQ=
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
github.com/cockroachdb/cockroach-go v0.0.0-20190925194419-606b3d062051/go.mod h1:XGLbWH/ujMcbPbhZq52Nv6UrCghb1yGn//133kEsvDk=
github.com/containerd/containerd v1.4.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
......@@ -188,8 +189,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
github.com/envoyproxy/go-control-plane v0.9.9 h1:vQLjymTobffN2R0F8eTqw6q7iozfRO5Z0m+/4Vw+/uA=
github.com/envoyproxy/go-control-plane v0.9.9/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
github.com/envoyproxy/go-control-plane v0.10.0 h1:WVt4HEPbdRbRD/PKKPbPnIVavO6gk/h673jWyIJ016k=
github.com/envoyproxy/go-control-plane v0.10.0/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v0.6.2 h1:JiO+kJTpmYGjEodY7O1Zk8oZcNz1+f30UtwtXoFUPzE=
github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws=
......@@ -849,6 +850,7 @@ golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201029080932-201ba4db2418/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
......
......@@ -115,7 +115,7 @@ func (p *Poller) refreshCache(ctx context.Context) {
continue
}
// in order to remove fault, we need to set the snapshot with default ecds config and default runtime resource
emptyResources := make(map[gcpTypes.ResponseType][]gcpTypes.ResourceWithTtl)
emptyResources := make(map[gcpTypes.ResponseType][]gcpTypes.ResourceWithTTL)
p.logger.Debugw("Removing RTDS resource for cluster", "cluster", cluster)
runtime, _ := p.createRuntime([][]*RuntimeKeyValue{}, nil)
......@@ -125,7 +125,7 @@ func (p *Poller) refreshCache(ctx context.Context) {
p.logger.Debugw("Removing ECDS resources for cluster", "cluster", cluster)
resourceNames := p.ecdsConfig.ecdsResourceMap.getResourcesFromCluster(cluster)
resourcesWithTTL := make([]gcpTypes.ResourceWithTtl, 0)
resourcesWithTTL := make([]gcpTypes.ResourceWithTTL, 0)
// iterate over all of the ECDS resource generators and all of the resource names
for _, g := range p.ecdsGeneratorsByTypeUrl {
for _, n := range resourceNames {
......@@ -143,7 +143,7 @@ func (p *Poller) refreshCache(ctx context.Context) {
emptyResources[gcpTypes.ExtensionConfig] = resourcesWithTTL
}
err := p.setSnapshot(emptyResources, cluster)
err := p.setSnapshot(ctx, emptyResources, cluster)
if err != nil {
p.setCacheSnapshotFailureCount.Inc(1)
p.logger.Errorw("Unable to unset the fault for cluster", "cluster", cluster, "error", err)
......@@ -154,7 +154,7 @@ func (p *Poller) refreshCache(ctx context.Context) {
activeFaults := 0
for cluster := range clustersWithResources {
resources := make(map[gcpTypes.ResponseType][]gcpTypes.ResourceWithTtl)
resources := make(map[gcpTypes.ResponseType][]gcpTypes.ResourceWithTTL)
if rs, ok := rtdsResourcesByCluster[cluster]; ok {
p.logger.Debugw("Injecting fault for cluster using RTDS", "cluster", cluster)
......@@ -178,7 +178,7 @@ func (p *Poller) refreshCache(ctx context.Context) {
}
}
err := p.setSnapshot(resources, cluster)
err := p.setSnapshot(ctx, resources, cluster)
if err != nil {
p.logger.Errorw("Unable to set the fault for cluster using ECDS", "cluster", cluster, "error", err)
}
......@@ -191,7 +191,7 @@ func (p *Poller) refreshCache(ctx context.Context) {
// for a given cluster but it's still possible for multiple different experiments to
// control runtime values for one cluster as long as each of them controls different
// key-value pairs.
func (p *Poller) createRuntime(runtimeKeyValues [][]*RuntimeKeyValue, ttl *time.Duration) ([]gcpTypes.ResourceWithTtl, int) {
func (p *Poller) createRuntime(runtimeKeyValues [][]*RuntimeKeyValue, ttl *time.Duration) ([]gcpTypes.ResourceWithTTL, int) {
isUsed := func(usedKeys map[string]bool, keyValues []*RuntimeKeyValue) bool {
for _, kv := range keyValues {
if val, ok := usedKeys[kv.Key]; ok && val {
......@@ -238,25 +238,25 @@ func (p *Poller) createRuntime(runtimeKeyValues [][]*RuntimeKeyValue, ttl *time.
resourceTTL = ttl
}
return []gcpTypes.ResourceWithTtl{{
return []gcpTypes.ResourceWithTTL{{
Resource: &gcpRuntimeServiceV3.Runtime{
Name: p.rtdsConfig.layerName,
Layer: &pstruct.Struct{
Fields: fieldsMap,
},
},
Ttl: resourceTTL,
TTL: resourceTTL,
}}, appliedKeValueSetsCount
}
func (p *Poller) createResourceWithTTLForECDSResource(resource *ECDSResource, ttl *time.Duration) []gcpTypes.ResourceWithTtl {
return []gcpTypes.ResourceWithTtl{{
func (p *Poller) createResourceWithTTLForECDSResource(resource *ECDSResource, ttl *time.Duration) []gcpTypes.ResourceWithTTL {
return []gcpTypes.ResourceWithTTL{{
Resource: resource.ExtensionConfig,
Ttl: ttl,
TTL: ttl,
}}
}
func (p *Poller) setSnapshot(resourceMap map[gcpTypes.ResponseType][]gcpTypes.ResourceWithTtl, cluster string) error {
func (p *Poller) setSnapshot(ctx context.Context, resourceMap map[gcpTypes.ResponseType][]gcpTypes.ResourceWithTTL, cluster string) error {
currentSnapshot, _ := p.cache.GetSnapshot(cluster)
snapshot := gcpCacheV3.Snapshot{}
......@@ -272,7 +272,7 @@ func (p *Poller) setSnapshot(resourceMap map[gcpTypes.ResponseType][]gcpTypes.Re
isNewSnapshotSame = false
}
snapshot.Resources[resourceType] = gcpCacheV3.NewResourcesWithTtl(newComputedVersion, resources)
snapshot.Resources[resourceType] = gcpCacheV3.NewResourcesWithTTL(newComputedVersion, resources)
}
if isNewSnapshotSame {
......@@ -282,7 +282,7 @@ func (p *Poller) setSnapshot(resourceMap map[gcpTypes.ResponseType][]gcpTypes.Re
}
p.logger.Infow("Setting snapshot", "cluster", cluster, "resources", resourceMap)
err := p.cache.SetSnapshot(cluster, snapshot)
err := p.cache.SetSnapshot(ctx, cluster, snapshot)
if err != nil {
return err
}
......
......@@ -141,7 +141,7 @@ func TestRTDSResourcesRefresh(t *testing.T) {
// Verify runtime of cluster "foo"
snapshotFoo, err := cache.GetSnapshot("foo")
assert.NoError(t, err)
rtdsResourcesClusterFoo := snapshotFoo.GetResourcesAndTtl(gcpResourceV3.RuntimeType)
rtdsResourcesClusterFoo := snapshotFoo.GetResourcesAndTTL(gcpResourceV3.RuntimeType)
resourcesClusterFoo := rtdsResourcesClusterFoo[rtdsConfig.layerName]
assert.NotNil(t, resourcesClusterFoo)
fieldsFoo := resourcesClusterFoo.Resource.(*gcpRuntimeServiceV3.Runtime).GetLayer().GetFields()
......@@ -151,7 +151,7 @@ func TestRTDSResourcesRefresh(t *testing.T) {
// Verify runtime of cluster "foo"
snapshotBar, err := cache.GetSnapshot("bar")
assert.NoError(t, err)
rtdsResourcesClusterBar := snapshotBar.GetResourcesAndTtl(gcpResourceV3.RuntimeType)
rtdsResourcesClusterBar := snapshotBar.GetResourcesAndTTL(gcpResourceV3.RuntimeType)
resourcesClusterBar := rtdsResourcesClusterBar[rtdsConfig.layerName]
assert.NotNil(t, resourcesClusterBar)
fieldsBar := resourcesClusterBar.Resource.(*gcpRuntimeServiceV3.Runtime).GetLayer().GetFields()
......
......@@ -217,7 +217,7 @@ func (c *rtdsCallbacks) OnStreamRequest(streamID int64, req *gcpDiscoveryV3.Disc
return nil
}
func (c *rtdsCallbacks) OnStreamResponse(streamID int64, request *gcpDiscoveryV3.DiscoveryRequest, response *gcpDiscoveryV3.DiscoveryResponse) {
func (c *rtdsCallbacks) OnStreamResponse(ctx context.Context, streamID int64, request *gcpDiscoveryV3.DiscoveryRequest, response *gcpDiscoveryV3.DiscoveryResponse) {
c.logger.Debugw("RTDS OnStreamResponse", "streamID", streamID, "cluster", request.Node.Cluster, "version", request.VersionInfo)
c.onStreamResponse(streamID, request.Node.Cluster, request.VersionInfo)
}
......@@ -261,7 +261,7 @@ func (c *ecdsCallbacks) OnStreamRequest(streamID int64, req *gcpDiscoveryV3.Disc
return nil
}
func (c *ecdsCallbacks) OnStreamResponse(streamID int64, request *gcpDiscoveryV3.DiscoveryRequest, response *gcpDiscoveryV3.DiscoveryResponse) {
func (c *ecdsCallbacks) OnStreamResponse(ctx context.Context, streamID int64, request *gcpDiscoveryV3.DiscoveryRequest, response *gcpDiscoveryV3.DiscoveryResponse) {
c.logger.Debugw("ECDS OnStreamResponse", "streamID", streamID, "cluster", request.Node.Cluster, "version", request.VersionInfo)
c.onStreamResponse(streamID, request.Node.Cluster, request.VersionInfo)
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment