Skip to content

Commit

Permalink
runtime: remove upstream_remote_address_use_connection runtime guard (e…
Browse files Browse the repository at this point in the history
…nvoyproxy#38070)

Commit Message: runtime: remove upstream_remote_address_use_connection
runtime guard
Additional Description:

To close envoyproxy#38055


Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

Signed-off-by: wangbaiping(wbpcode) <[email protected]>
Signed-off-by: code <[email protected]>
  • Loading branch information
wbpcode authored Jan 21, 2025
1 parent eb417f4 commit 78fcde4
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 29 deletions.
4 changes: 3 additions & 1 deletion changelogs/current.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ bug_fixes:

removed_config_or_runtime:
# *Normally occurs at the end of the* :ref:`deprecation period <deprecated>`
- area: access_log
change: |
Removed runtime guard ``envoy.reloadable_features.upstream_remote_address_use_connection`` and legacy code paths.
- area: thread_local
change: |
Removed runtime guard ``envoy.reloadable_features.allow_slot_destroy_on_worker_threads`` and legacy code paths.
- area: dns
change: |
Removed runtime flag ``envoy.reloadable_features.dns_details`` and legacy code paths.
Expand Down
10 changes: 0 additions & 10 deletions source/common/formatter/stream_info_formatter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@ getUpstreamRemoteAddress(const StreamInfo::StreamInfo& stream_info) {
return nullptr;
}

// TODO(wbpcode): remove this after the flag is removed.
const bool use_upstream_remote_address = Runtime::runtimeFeatureEnabled(
"envoy.reloadable_features.upstream_remote_address_use_connection");
if (!use_upstream_remote_address) {
if (auto host = opt_ref->upstreamHost(); host != nullptr) {
return host->address();
}
return nullptr;
}

if (auto addr = opt_ref->upstreamRemoteAddress(); addr != nullptr) {
return addr;
}
Expand Down
1 change: 0 additions & 1 deletion source/common/runtime/runtime_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ RUNTIME_GUARD(envoy_reloadable_features_test_feature_true);
RUNTIME_GUARD(envoy_reloadable_features_udp_set_do_not_fragment);
RUNTIME_GUARD(envoy_reloadable_features_udp_socket_apply_aggregated_read_limit);
RUNTIME_GUARD(envoy_reloadable_features_uhv_allow_malformed_url_encoding);
RUNTIME_GUARD(envoy_reloadable_features_upstream_remote_address_use_connection);
RUNTIME_GUARD(envoy_reloadable_features_use_config_in_happy_eyeballs);
RUNTIME_GUARD(envoy_reloadable_features_use_filter_manager_state_for_downstream_end_stream);
RUNTIME_GUARD(envoy_reloadable_features_use_route_host_mutation_for_auto_sni_san);
Expand Down
17 changes: 0 additions & 17 deletions test/common/formatter/substitution_formatter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -729,23 +729,6 @@ TEST(SubstitutionFormatterTest, streamInfoFormatter) {
stream_info.upstreamInfo()->setUpstreamRemoteAddress(default_upstream_remote_address);
}

{
TestScopedRuntime scoped_runtime;
scoped_runtime.mergeValues(
{{"envoy.reloadable_features.upstream_remote_address_use_connection", "false"}});

StreamInfoFormatter upstream_format("UPSTREAM_REMOTE_ADDRESS");

// Has valid upstream remote address but it would not be used because of the runtime feature.
stream_info.upstreamInfo()->setUpstreamRemoteAddress(test_upstream_remote_address);
EXPECT_EQ("10.0.0.1:443", upstream_format.formatWithContext({}, stream_info));
EXPECT_THAT(upstream_format.formatValueWithContext({}, stream_info),
ProtoEq(ValueUtil::stringValue("10.0.0.1:443")));

// Reset to default one.
stream_info.upstreamInfo()->setUpstreamRemoteAddress(default_upstream_remote_address);
}

{
StreamInfoFormatter upstream_format("UPSTREAM_REMOTE_ADDRESS_WITHOUT_PORT");

Expand Down

0 comments on commit 78fcde4

Please sign in to comment.