api: handle field_migrate.rename (#9265)

Description:
api: handle field_migrate.rename in proto migrate.

Risk Level: Low
Testing: CI
Docs Changes: API_VERSIONING.md
Release Notes: N/A

Mirrored from https://github.com/envoyproxy/envoy @ 1f36b1f824152f5e92ba273ecb8ff443bcf99f55
master-ci-test
data-plane-api(CircleCI) 5 years ago
parent 46825043de
commit 7a8fab981f
  1. 3
      API_VERSIONING.md
  2. 1
      envoy/api/v2/route/BUILD
  3. 10
      envoy/api/v2/route/route.proto
  4. 8
      envoy/api/v3alpha/route/route.proto
  5. 5
      envoy/config/filter/http/dynamic_forward_proxy/v2alpha/BUILD
  6. 10
      envoy/config/filter/http/dynamic_forward_proxy/v2alpha/dynamic_forward_proxy.proto
  7. 8
      envoy/config/filter/http/dynamic_forward_proxy/v3alpha/dynamic_forward_proxy.proto
  8. 1
      envoy/service/ratelimit/v2/BUILD
  9. 5
      envoy/service/ratelimit/v2/rls.proto
  10. 3
      envoy/service/ratelimit/v3alpha/rls.proto

@ -141,8 +141,7 @@ guided by annotations in protobuf.
field or enum value. No field may be marked as deprecated unless a replacement for this
functionality exists and the corresponding Envoy implementation is production ready.
* Renames are specified with a `[#rename-at-next-major-version: <new name>]` protobuf comment
annotation.
* Renames are specified with a `[(udpa.annotations.field_migrate).rename = "<new name>"]` annotation.
* We anticipate that `protoxform` will also support `oneof` promotion, package movement, etc. via
similar annotations.

@ -10,5 +10,6 @@ api_proto_package(
"//envoy/type:pkg",
"//envoy/type/matcher:pkg",
"//envoy/type/tracing/v2:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)

@ -18,6 +18,7 @@ import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";
import "udpa/annotations/migrate.proto";
import "validate/validate.proto";
// [#protodoc-title: HTTP route]
@ -749,9 +750,7 @@ message RouteAction {
oneof host_rewrite_specifier {
// Indicates that during forwarding, the host header will be swapped with
// this value.
//
// [#next-major-version: host_rewrite_literal]
string host_rewrite = 6;
string host_rewrite = 6 [(udpa.annotations.field_migrate).rename = "host_rewrite_literal"];
// Indicates that during forwarding, the host header will be swapped with
// the hostname of the upstream host chosen by the cluster manager. This
@ -768,9 +767,8 @@ message RouteAction {
//
// Pay attention to the potential security implications of using this option. Provided header
// must come from trusted source.
//
// [#next-major-version: host_rewrite_header]
string auto_host_rewrite_header = 29;
string auto_host_rewrite_header = 29
[(udpa.annotations.field_migrate).rename = "host_rewrite_header"];
}
// Specifies the upstream timeout for the route. If not specified, the default is 15s. This

@ -734,9 +734,7 @@ message RouteAction {
oneof host_rewrite_specifier {
// Indicates that during forwarding, the host header will be swapped with
// this value.
//
// [#next-major-version: host_rewrite_literal]
string host_rewrite = 6;
string host_rewrite_literal = 6;
// Indicates that during forwarding, the host header will be swapped with
// the hostname of the upstream host chosen by the cluster manager. This
@ -753,9 +751,7 @@ message RouteAction {
//
// Pay attention to the potential security implications of using this option. Provided header
// must come from trusted source.
//
// [#next-major-version: host_rewrite_header]
string auto_host_rewrite_header = 29;
string host_rewrite_header = 29;
}
// Specifies the upstream timeout for the route. If not specified, the default is 15s. This

@ -5,5 +5,8 @@ load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")
licenses(["notice"]) # Apache 2
api_proto_package(
deps = ["//envoy/config/common/dynamic_forward_proxy/v2alpha:pkg"],
deps = [
"//envoy/config/common/dynamic_forward_proxy/v2alpha:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)

@ -8,6 +8,7 @@ option java_multiple_files = true;
import "envoy/config/common/dynamic_forward_proxy/v2alpha/dns_cache.proto";
import "udpa/annotations/migrate.proto";
import "validate/validate.proto";
// [#protodoc-title: Dynamic forward proxy]
@ -35,9 +36,7 @@ message PerRouteConfig {
// :ref:`HCM host rewrite <envoy_api_field_route.RouteAction.host_rewrite>` given that the
// value set here would be used for DNS lookups whereas the value set in the HCM would be used
// for host header forwarding which is not the desired outcome.
//
// [#next-major-version: host_rewrite_literal]
string host_rewrite = 1;
string host_rewrite = 1 [(udpa.annotations.field_migrate).rename = "host_rewrite_literal"];
// Indicates that before DNS lookup, the host header will be swapped with
// the value of this header. If not set or empty, the original host header
@ -48,8 +47,7 @@ message PerRouteConfig {
// :ref:`HCM host rewrite header <envoy_api_field_route.RouteAction.auto_host_rewrite_header>`
// given that the value set here would be used for DNS lookups whereas the value set in the HCM
// would be used for host header forwarding which is not the desired outcome.
//
// [#next-major-version: host_rewrite_header]
string auto_host_rewrite_header = 2;
string auto_host_rewrite_header = 2
[(udpa.annotations.field_migrate).rename = "host_rewrite_header"];
}
}

@ -43,9 +43,7 @@ message PerRouteConfig {
// :ref:`HCM host rewrite <envoy_api_field_api.v3alpha.route.RouteAction.host_rewrite>` given
// that the value set here would be used for DNS lookups whereas the value set in the HCM would
// be used for host header forwarding which is not the desired outcome.
//
// [#next-major-version: host_rewrite_literal]
string host_rewrite = 1;
string host_rewrite_literal = 1;
// Indicates that before DNS lookup, the host header will be swapped with
// the value of this header. If not set or empty, the original host header
@ -57,8 +55,6 @@ message PerRouteConfig {
// <envoy_api_field_api.v3alpha.route.RouteAction.auto_host_rewrite_header>` given that the
// value set here would be used for DNS lookups whereas the value set in the HCM would be used
// for host header forwarding which is not the desired outcome.
//
// [#next-major-version: host_rewrite_header]
string auto_host_rewrite_header = 2;
string host_rewrite_header = 2;
}
}

@ -9,5 +9,6 @@ api_proto_package(
deps = [
"//envoy/api/v2/core:pkg",
"//envoy/api/v2/ratelimit:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)

@ -10,6 +10,7 @@ option java_generic_services = true;
import "envoy/api/v2/core/base.proto";
import "envoy/api/v2/ratelimit/ratelimit.proto";
import "udpa/annotations/migrate.proto";
import "validate/validate.proto";
// [#protodoc-title: Rate Limit Service (RLS)]
@ -102,8 +103,8 @@ message RateLimitResponse {
repeated DescriptorStatus statuses = 2;
// A list of headers to add to the response
// [#next-major-version: rename to response_headers_to_add]
repeated api.v2.core.HeaderValue headers = 3;
repeated api.v2.core.HeaderValue headers = 3
[(udpa.annotations.field_migrate).rename = "response_headers_to_add"];
// A list of headers to add to the request when forwarded
repeated api.v2.core.HeaderValue request_headers_to_add = 4;

@ -116,8 +116,7 @@ message RateLimitResponse {
repeated DescriptorStatus statuses = 2;
// A list of headers to add to the response
// [#next-major-version: rename to response_headers_to_add]
repeated api.v3alpha.core.HeaderValue headers = 3;
repeated api.v3alpha.core.HeaderValue response_headers_to_add = 3;
// A list of headers to add to the request when forwarded
repeated api.v3alpha.core.HeaderValue request_headers_to_add = 4;

Loading…
Cancel
Save