config: support recovery of original message when upgrading. (#9633)

To better support config dump, deprecated field detection and other debug, it's helpful to leave a type name breadcrumb and be able to synthesize a Protobuf::Message that corresponds to what was delivered on the wire.

While working on this PR, it became apparent that config dump is broken post v3alpha, since a single config dump might have both v2 and v3 Listeners, etc. The only way to resolve this generically is to make the inner resources in config dump Any. This is a breaking API change, but these are v2alpha/v3alpha at this point, so allowed.

Risk level: Low
Testing: new version converter unit test, config dump tests now verify that the correct versioned inner resource is returned.

Fixes #9612

Signed-off-by: Harvey Tuch <htuch@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ 233838a39fb8310ea145e7d758d428d5a37b0306
master-ci-test
data-plane-api(CircleCI) 5 years ago
parent d7158b618b
commit d5c2cdb1c1
  1. 2
      envoy/admin/v2alpha/BUILD
  2. 25
      envoy/admin/v2alpha/config_dump.proto
  3. 4
      envoy/admin/v3alpha/BUILD
  4. 25
      envoy/admin/v3alpha/config_dump.proto

@ -6,8 +6,6 @@ licenses(["notice"]) # Apache 2
api_proto_package(
deps = [
"//envoy/api/v2:pkg",
"//envoy/api/v2/auth:pkg",
"//envoy/api/v2/core:pkg",
"//envoy/config/bootstrap/v2:pkg",
"//envoy/service/tap/v2alpha:pkg",

@ -2,11 +2,6 @@ syntax = "proto3";
package envoy.admin.v2alpha;
import "envoy/api/v2/auth/cert.proto";
import "envoy/api/v2/cluster.proto";
import "envoy/api/v2/listener.proto";
import "envoy/api/v2/route.proto";
import "envoy/api/v2/scoped_route.proto";
import "envoy/config/bootstrap/v2/bootstrap.proto";
import "google/protobuf/any.proto";
@ -69,7 +64,7 @@ message ListenersConfigDump {
// Describes a statically loaded listener.
message StaticListener {
// The listener config.
api.v2.Listener listener = 1;
google.protobuf.Any listener = 1;
// The timestamp when the Listener was last successfully updated.
google.protobuf.Timestamp last_updated = 2;
@ -83,7 +78,7 @@ message ListenersConfigDump {
string version_info = 1;
// The listener config.
api.v2.Listener listener = 2;
google.protobuf.Any listener = 2;
// The timestamp when the Listener was last successfully updated.
google.protobuf.Timestamp last_updated = 3;
@ -134,7 +129,7 @@ message ClustersConfigDump {
// Describes a statically loaded cluster.
message StaticCluster {
// The cluster config.
api.v2.Cluster cluster = 1;
google.protobuf.Any cluster = 1;
// The timestamp when the Cluster was last updated.
google.protobuf.Timestamp last_updated = 2;
@ -149,7 +144,7 @@ message ClustersConfigDump {
string version_info = 1;
// The cluster config.
api.v2.Cluster cluster = 2;
google.protobuf.Any cluster = 2;
// The timestamp when the Cluster was last updated.
google.protobuf.Timestamp last_updated = 3;
@ -182,7 +177,7 @@ message ClustersConfigDump {
message RoutesConfigDump {
message StaticRouteConfig {
// The route config.
api.v2.RouteConfiguration route_config = 1;
google.protobuf.Any route_config = 1;
// The timestamp when the Route was last updated.
google.protobuf.Timestamp last_updated = 2;
@ -195,7 +190,7 @@ message RoutesConfigDump {
string version_info = 1;
// The route config.
api.v2.RouteConfiguration route_config = 2;
google.protobuf.Any route_config = 2;
// The timestamp when the Route was last updated.
google.protobuf.Timestamp last_updated = 3;
@ -218,7 +213,7 @@ message ScopedRoutesConfigDump {
string name = 1;
// The scoped route configurations.
repeated api.v2.ScopedRouteConfiguration scoped_route_configs = 2;
repeated google.protobuf.Any scoped_route_configs = 2;
// The timestamp when the scoped route config set was last updated.
google.protobuf.Timestamp last_updated = 3;
@ -234,7 +229,7 @@ message ScopedRoutesConfigDump {
string version_info = 2;
// The scoped route configurations.
repeated api.v2.ScopedRouteConfiguration scoped_route_configs = 3;
repeated google.protobuf.Any scoped_route_configs = 3;
// The timestamp when the scoped route config set was last updated.
google.protobuf.Timestamp last_updated = 4;
@ -263,7 +258,7 @@ message SecretsConfigDump {
// The actual secret information.
// Security sensitive information is redacted (replaced with "[redacted]") for
// private keys and passwords in TLS certificates.
api.v2.auth.Secret secret = 4;
google.protobuf.Any secret = 4;
}
// StaticSecret specifies statically loaded secret in bootstrap.
@ -277,7 +272,7 @@ message SecretsConfigDump {
// The actual secret information.
// Security sensitive information is redacted (replaced with "[redacted]") for
// private keys and passwords in TLS certificates.
api.v2.auth.Secret secret = 3;
google.protobuf.Any secret = 3;
}
// The statically loaded secrets.

@ -8,12 +8,8 @@ api_proto_package(
deps = [
"//envoy/admin/v2alpha:pkg",
"//envoy/config/bootstrap/v3alpha:pkg",
"//envoy/config/cluster/v3alpha:pkg",
"//envoy/config/core/v3alpha:pkg",
"//envoy/config/listener/v3alpha:pkg",
"//envoy/config/route/v3alpha:pkg",
"//envoy/config/tap/v3alpha:pkg",
"//envoy/extensions/transport_sockets/tls/v3alpha:pkg",
"//envoy/type/v3alpha:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],

@ -3,11 +3,6 @@ syntax = "proto3";
package envoy.admin.v3alpha;
import "envoy/config/bootstrap/v3alpha/bootstrap.proto";
import "envoy/config/cluster/v3alpha/cluster.proto";
import "envoy/config/listener/v3alpha/listener.proto";
import "envoy/config/route/v3alpha/route.proto";
import "envoy/config/route/v3alpha/scoped_route.proto";
import "envoy/extensions/transport_sockets/tls/v3alpha/cert.proto";
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";
@ -85,7 +80,7 @@ message ListenersConfigDump {
"envoy.admin.v2alpha.ListenersConfigDump.StaticListener";
// The listener config.
config.listener.v3alpha.Listener listener = 1;
google.protobuf.Any listener = 1;
// The timestamp when the Listener was last successfully updated.
google.protobuf.Timestamp last_updated = 2;
@ -103,7 +98,7 @@ message ListenersConfigDump {
string version_info = 1;
// The listener config.
config.listener.v3alpha.Listener listener = 2;
google.protobuf.Any listener = 2;
// The timestamp when the Listener was last successfully updated.
google.protobuf.Timestamp last_updated = 3;
@ -164,7 +159,7 @@ message ClustersConfigDump {
"envoy.admin.v2alpha.ClustersConfigDump.StaticCluster";
// The cluster config.
config.cluster.v3alpha.Cluster cluster = 1;
google.protobuf.Any cluster = 1;
// The timestamp when the Cluster was last updated.
google.protobuf.Timestamp last_updated = 2;
@ -183,7 +178,7 @@ message ClustersConfigDump {
string version_info = 1;
// The cluster config.
config.cluster.v3alpha.Cluster cluster = 2;
google.protobuf.Any cluster = 2;
// The timestamp when the Cluster was last updated.
google.protobuf.Timestamp last_updated = 3;
@ -223,7 +218,7 @@ message RoutesConfigDump {
"envoy.admin.v2alpha.RoutesConfigDump.StaticRouteConfig";
// The route config.
config.route.v3alpha.RouteConfiguration route_config = 1;
google.protobuf.Any route_config = 1;
// The timestamp when the Route was last updated.
google.protobuf.Timestamp last_updated = 2;
@ -240,7 +235,7 @@ message RoutesConfigDump {
string version_info = 1;
// The route config.
config.route.v3alpha.RouteConfiguration route_config = 2;
google.protobuf.Any route_config = 2;
// The timestamp when the Route was last updated.
google.protobuf.Timestamp last_updated = 3;
@ -269,7 +264,7 @@ message ScopedRoutesConfigDump {
string name = 1;
// The scoped route configurations.
repeated config.route.v3alpha.ScopedRouteConfiguration scoped_route_configs = 2;
repeated google.protobuf.Any scoped_route_configs = 2;
// The timestamp when the scoped route config set was last updated.
google.protobuf.Timestamp last_updated = 3;
@ -289,7 +284,7 @@ message ScopedRoutesConfigDump {
string version_info = 2;
// The scoped route configurations.
repeated config.route.v3alpha.ScopedRouteConfiguration scoped_route_configs = 3;
repeated google.protobuf.Any scoped_route_configs = 3;
// The timestamp when the scoped route config set was last updated.
google.protobuf.Timestamp last_updated = 4;
@ -324,7 +319,7 @@ message SecretsConfigDump {
// The actual secret information.
// Security sensitive information is redacted (replaced with "[redacted]") for
// private keys and passwords in TLS certificates.
envoy.extensions.transport_sockets.tls.v3alpha.Secret secret = 4;
google.protobuf.Any secret = 4;
}
// StaticSecret specifies statically loaded secret in bootstrap.
@ -341,7 +336,7 @@ message SecretsConfigDump {
// The actual secret information.
// Security sensitive information is redacted (replaced with "[redacted]") for
// private keys and passwords in TLS certificates.
envoy.extensions.transport_sockets.tls.v3alpha.Secret secret = 3;
google.protobuf.Any secret = 3;
}
// The statically loaded secrets.

Loading…
Cancel
Save