Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
try-import ./envoy/.bazelrc

# Common flags for all builds
build --platform_mappings=envoy/bazel/platform_mappings
build --define=google_grpc=disabled
build --define=hot_restart=disabled
build --define=tcmalloc=disabled
Expand Down
2 changes: 1 addition & 1 deletion envoy
Submodule envoy updated 692 files
5 changes: 4 additions & 1 deletion library/common/config/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,10 @@ R"(
connect_timeout: *connect_timeout
lb_policy: CLUSTER_PROVIDED
cluster_type: *base_cluster_type
transport_socket: { name: envoy.transport_sockets.raw_buffer }
transport_socket:
name: envoy.transport_sockets.raw_buffer
typed_config:
"@type": type.googleapis.com/envoy.extensions.transport_sockets.raw_buffer.v3.RawBuffer
upstream_connection_options: *upstream_opts
circuit_breakers: *circuit_breakers_settings
typed_extension_protocol_options: *h1_protocol_options
Expand Down
13 changes: 7 additions & 6 deletions library/common/extensions/key_value/platform/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ namespace KeyValue {
PlatformKeyValueStore::PlatformKeyValueStore(Event::Dispatcher& dispatcher,
std::chrono::milliseconds save_interval,
PlatformInterface& platform_interface,
const std::string& key)
: KeyValueStoreBase(dispatcher, save_interval), platform_interface_(platform_interface),
key_(key) {
uint64_t max_entries, const std::string& key)
: KeyValueStoreBase(dispatcher, save_interval, max_entries),
platform_interface_(platform_interface), key_(key) {
const std::string contents = platform_interface.read(key);
if (!parseContents(contents, store_)) {
if (!parseContents(contents)) {
ENVOY_LOG(warn, "Failed to parse key value store contents {}", key);
}
}
Expand All @@ -41,8 +41,9 @@ PlatformKeyValueStoreFactory::createStore(const Protobuf::Message& config,
typed_config.config().typed_config(), validation_visitor);
auto milliseconds =
std::chrono::milliseconds(DurationUtil::durationToMilliseconds(file_config.save_interval()));
return std::make_unique<PlatformKeyValueStore>(
dispatcher, milliseconds, platform_interface_.value().get(), file_config.key());
return std::make_unique<PlatformKeyValueStore>(dispatcher, milliseconds,
platform_interface_.value().get(),
file_config.max_entries(), file_config.key());
}

REGISTER_FACTORY(PlatformKeyValueStoreFactory, KeyValueStoreFactory);
Expand Down
3 changes: 2 additions & 1 deletion library/common/extensions/key_value/platform/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class PlatformInterface {
class PlatformKeyValueStore : public KeyValueStoreBase {
public:
PlatformKeyValueStore(Event::Dispatcher& dispatcher, std::chrono::milliseconds save_interval,
PlatformInterface& platform_interface, const std::string& key);
PlatformInterface& platform_interface, uint64_t max_entries,
const std::string& key);
// KeyValueStore
void flush() override;

Expand Down
3 changes: 3 additions & 0 deletions library/common/extensions/key_value/platform/platform.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ message PlatformKeyValueStoreConfig {

// The interval at which the key value store should be saved.
google.protobuf.Duration save_interval = 2;

// The maximum number of entries that can be stored in the cache.
uint64 max_entries = 3;
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class PlatformStoreTest : public testing::Test {

void createStore() {
flush_timer_ = new NiceMock<Event::MockTimer>(&dispatcher_);
store_ =
std::make_unique<PlatformKeyValueStore>(dispatcher_, save_interval_, mock_platform_, key_);
store_ = std::make_unique<PlatformKeyValueStore>(dispatcher_, save_interval_, mock_platform_,
std::numeric_limits<uint64_t>::max(), key_);
}
NiceMock<Event::MockDispatcher> dispatcher_;
std::string key_{"key"};
Expand Down
3 changes: 3 additions & 0 deletions test/kotlin/integration/SetLoggerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import org.junit.Test
private const val apiListenerType =
"type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.EnvoyMobileHttpConnectionManager"
private const val assertionFilterType = "type.googleapis.com/envoymobile.extensions.filters.http.assertion.Assertion"
private const val testLoggerFilterType = "type.googleapis.com/envoymobile.extensions.filters.http.test_logger.TestLogger"
private const val config =
"""
static_resources:
Expand Down Expand Up @@ -43,6 +44,8 @@ static_resources:
status: 200
http_filters:
- name: test_logger
typed_config:
"@type": $testLoggerFilterType
- name: envoy.filters.http.assertion
typed_config:
"@type": $assertionFilterType
Expand Down
4 changes: 4 additions & 0 deletions test/swift/integration/SetLoggerTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ final class LoggerTests: XCTestCase {
let emhcmType = "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.EnvoyMobileHttpConnectionManager"
// swiftlint:disable:next line_length
let assertionFilterType = "type.googleapis.com/envoymobile.extensions.filters.http.assertion.Assertion"
// swiftlint:disable:next line_length
let testLoggerFilterType = "type.googleapis.com/envoymobile.extensions.filters.http.test_logger.TestLogger"
let config =
"""
static_resources:
Expand Down Expand Up @@ -40,6 +42,8 @@ static_resources:
status: 200
http_filters:
- name: test_logger
typed_config:
"@type": \(testLoggerFilterType)
- name: envoy.filters.http.assertion
typed_config:
"@type": \(assertionFilterType)
Expand Down