Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
707bb44
bump envoy-fork, fix extensions
jbohanon Mar 1, 2024
9bdd858
fix FactoryContext from https://github.com/envoyproxy/envoy/pull/31189
jbohanon Mar 1, 2024
0dbab3f
more build fixes
jbohanon Mar 1, 2024
ec872f0
fix MockFactoryContext
jbohanon Mar 4, 2024
be9722b
use xds pkg for unified matcher instead of udpa
jbohanon Mar 4, 2024
d81c403
Merge branch 'main' into jbohanon/envoy-1.29
jbohanon Mar 4, 2024
6526e4b
export the build options
jbohanon Mar 4, 2024
2b0389d
another ServerFactoryContext
jbohanon Mar 4, 2024
ccbeb18
use typed_config for lambda filter test
jbohanon Mar 4, 2024
a7aedaf
runtime flag...?
jbohanon Mar 5, 2024
d7e2a4b
runtime flag...as a string...?
jbohanon Mar 5, 2024
4de8a2f
use nullopt instead of server factory context. why? not sure yet
jbohanon Mar 5, 2024
aa63816
put the server factory context back and try a different runtime flag …
jbohanon Mar 6, 2024
941ed36
nuke le asan
jbohanon Mar 6, 2024
d36e0e1
uhh
jbohanon Mar 6, 2024
6fbd6cf
use libcurl, patch out virtual call to ServerFactoryContext::clusterM…
jbohanon Mar 7, 2024
2ba6011
forgot the patch d'oh
jbohanon Mar 7, 2024
c5922ea
ls on the out dirs
jbohanon Mar 7, 2024
2f8250d
undo commenting creds
jbohanon Mar 7, 2024
7e8e577
add a build dir
jbohanon Mar 7, 2024
efdb1d2
derp
jbohanon Mar 7, 2024
d49d192
what the heck, respect my vars bro
jbohanon Mar 7, 2024
6f70edc
WHY AREN'T WE USING THE RIGHT ENV VARS
jbohanon Mar 7, 2024
33f54b6
look at me. i am the captain now.
jbohanon Mar 8, 2024
bdb84e9
shhh, it can't see you if you don't move
jbohanon Mar 8, 2024
fa8200a
well this is nasty but we're getting somewhere
jbohanon Mar 8, 2024
591b36c
alt+f4
jbohanon Mar 8, 2024
d5871c4
asan
jbohanon Mar 8, 2024
053f304
lower jobs oom-killed
jbohanon Mar 8, 2024
813325c
try some more goofiness with the optref
jbohanon Mar 8, 2024
8a44c49
ci shenanigans
jbohanon Mar 8, 2024
63d0631
server factory context as nullopt
jbohanon Mar 8, 2024
97346fd
ci nonsense
jbohanon Mar 8, 2024
46d8ac2
getting closer
jbohanon Mar 8, 2024
7d2d775
cleanup
jbohanon Mar 8, 2024
0cc9bb2
remove hard-coding override in initialize()
jbohanon Mar 8, 2024
6bfe2a5
bump to 1.29.2
jbohanon Mar 8, 2024
f4c8caf
Merge branch 'main' into jbohanon/envoy-1.29
nfuden Mar 12, 2024
f3ba632
bump to merged
jbohanon Mar 12, 2024
d7b6a07
Merge branch 'jbohanon/envoy-1.29' of ssh://github.com/solo-io/envoy-…
jbohanon Mar 12, 2024
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
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.1.0
6.3.2
2 changes: 1 addition & 1 deletion api/envoy/config/filter/http/transformation/v2/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ api_proto_package(
"@envoy_api//envoy/type:pkg",
"@envoy_api//envoy/type/matcher/v3:pkg",
"@envoy_api//envoy/type/matcher:pkg",
"@com_github_cncf_udpa//xds/type/matcher/v3:pkg",
"@com_github_cncf_xds//xds/type/matcher/v3:pkg",
Comment thread
ben-taussig-solo marked this conversation as resolved.
],
visibility = ["//visibility:public"],
)
20 changes: 20 additions & 0 deletions bazel/extensions/extensions_build_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ EXTENSIONS = {
"envoy.filters.http.aws_lambda": "//source/extensions/filters/http/aws_lambda:config",
"envoy.filters.http.aws_request_signing": "//source/extensions/filters/http/aws_request_signing:config",
"envoy.filters.http.bandwidth_limit": "//source/extensions/filters/http/bandwidth_limit:config",
"envoy.filters.http.basic_auth": "//source/extensions/filters/http/basic_auth:config",
"envoy.filters.http.buffer": "//source/extensions/filters/http/buffer:config",
"envoy.filters.http.cache": "//source/extensions/filters/http/cache:config",
"envoy.filters.http.cdn_loop": "//source/extensions/filters/http/cdn_loop:config",
Expand Down Expand Up @@ -263,6 +264,19 @@ EXTENSIONS = {
"envoy.tracers.skywalking": "//source/extensions/tracers/skywalking:config",
"envoy.tracers.opentelemetry": "//source/extensions/tracers/opentelemetry:config",

#
# OpenTelemetry Resource Detectors
#

"envoy.tracers.opentelemetry.resource_detectors.environment": "//source/extensions/tracers/opentelemetry/resource_detectors/environment:config",
"envoy.tracers.opentelemetry.resource_detectors.dynatrace": "//source/extensions/tracers/opentelemetry/resource_detectors/dynatrace:config",

#
# OpenTelemetry tracer samplers
#

"envoy.tracers.opentelemetry.samplers.always_on": "//source/extensions/tracers/opentelemetry/samplers/always_on:config",

#
# Transport sockets
#
Expand Down Expand Up @@ -482,6 +496,12 @@ EXTENSIONS = {
# Geolocation Provider
#
# "envoy.geoip_providers.maxmind": "//source/extensions/geoip_providers/maxmind:config",

#
# cluster specifier plugin
#

"envoy.router.cluster_specifier_plugin.lua": "//source/extensions/router/cluster_specifiers/lua:config",
Comment thread
nfuden marked this conversation as resolved.
}

# These can be changed to ["//visibility:public"], for downstream builds which
Expand Down
4 changes: 0 additions & 4 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ def _repository_impl(name, **kwargs):
)

def envoy_gloo_dependencies():
# the following 2 patches are needed to support the deprecated cipher
# passthrough and only need to be backported onto envoy v1.25.x
# these should be removed when moving to v1.26.x since this code exists in
# upstream at that point.
_repository_impl("envoy")
_repository_impl("json", build_file = "@envoy_gloo//bazel/external:json.BUILD")
_repository_impl("inja", build_file = "@envoy_gloo//bazel/external:inja.BUILD")
4 changes: 2 additions & 2 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
REPOSITORY_LOCATIONS = dict(
envoy = dict(
# envoy 1.28.1 with backported ext_proc updates
commit = "47d4c36d399b9daae47cd7f6c4d41cf75e7e3ff8",
# envoy 1.29.2 with backported ext_proc updates
commit = "b5c77750dc0f9de19478c89776f580fb9336fc99",
remote = "https://github.com/solo-io/envoy-fork",
),
inja = dict(
Expand Down
8 changes: 8 additions & 0 deletions changelog/v1.29.2-patch1/bump-envoy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
changelog:
- type: DEPENDENCY_BUMP
dependencyOwner: solo-io
dependencyRepo: envoy-fork
dependencyTag: v1.29.2
resolvesIssue: false
description: >-
Update Envoy to latest from forked 1.29.2
15 changes: 10 additions & 5 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/bin/bash
set -e

if [ -n "$ENVOY_DOCKER_BUILD_DIR" ]; then
rm -rf "$ENVOY_DOCKER_BUILD_DIR/envoy/x64/bin/"
else
rm -rf "/build/envoy/x64/bin/"
if [ -z "$BUILD_DIR" ]; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You had mentioned something about this in a comment:

we aren't patching envoy for env vars into do_ci.sh -- we need to set BUILD_DIR because if unset, everything else is overridden in build_setup.sh

Can you say more about this? I think I see the block you're talking about:

if [[ -z "${BUILD_DIR}" ]]; then
    echo "BUILD_DIR not set - defaulting to ~/.cache/envoy-bazel" >&2
    BUILD_DIR="${HOME}/.cache/envoy-bazel"
fi

But does it matter whether we build in the default location?

BUILD_DIR=/build
echo "using build dir: ${BUILD_DIR}"
else
echo "using pre-defined build dir: ${BUILD_DIR}"
fi
export BUILD_DIR

bazel fetch //source/exe:envoy-static

Expand All @@ -32,6 +34,7 @@ fi
export ENVOY_SRCDIR=$SOURCE_DIR

# google cloud build times out when using full throttle.
# additionally, we see builds killed due to OOM at high concurrency.
export NUM_CPUS=10
Comment thread
nfuden marked this conversation as resolved.

# google cloud build doesn't like ipv6
Expand All @@ -42,9 +45,11 @@ export BAZEL_EXTRA_TEST_OPTIONS="--test_env=ENVOY_IP_TEST_VERSIONS=v4only --test
export ENVOY_CONTRIB_BUILD_TARGET="//source/exe:envoy-static"
export ENVOY_CONTRIB_BUILD_DEBUG_INFORMATION="//source/exe:envoy-static.dwp"

export BAZEL_BUILD_EXTRA_OPTIONS
BAZEL_BUILD_EXTRA_OPTIONS+=" --remote_cache=${BAZEL_REMOTE_CACHE}"

export GCP_SERVICE_ACCOUNT_KEY_PATH=$(mktemp -t gcp_service_account.XXXXXX.json)
export GCP_SERVICE_ACCOUNT_KEY_PATH
GCP_SERVICE_ACCOUNT_KEY_PATH=$(mktemp -t gcp_service_account.XXXXXX.json)
echo "${GCP_SERVICE_ACCOUNT_KEY}" | base64 --decode > "${GCP_SERVICE_ACCOUNT_KEY_PATH}"
BAZEL_BUILD_EXTRA_OPTIONS+=" --google_credentials=${GCP_SERVICE_ACCOUNT_KEY_PATH}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,27 @@ AWSLambdaFilterConfigFactory::createFilterFactoryFromProtoTyped(
&proto_config,
const std::string &stats_prefix,
Server::Configuration::FactoryContext &context) {
auto& server_context = context.serverFactoryContext();


// ServerFactoryContext::clusterManager() is not available during server initialization
// therefore we need to pass absl::nullopt in lieu of the server_context to prevent
// the upstream code from attempting to access the method. https://github.com/envoyproxy/envoy/issues/26653
auto chain = std::make_unique<Extensions::Common::Aws::DefaultCredentialsProviderChain>(
context.api(), Extensions::Common::Aws::Utility::fetchMetadata);
auto sts_factory = StsCredentialsProviderFactory::create(context.api(),
context.clusterManager());
server_context.api(), absl::nullopt /* ServerFactoryContextOptRef context */,
// We pass an empty string if we don't have a region
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we default to us-east-1?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after some reflection I think it could be very frustrating to debug issues related to default values in this section -- I think I prefer leaving this as-is

proto_config.has_service_account_credentials() ? proto_config.service_account_credentials().region() : "",
Extensions::Common::Aws::Utility::fetchMetadata);
auto sts_factory = StsCredentialsProviderFactory::create(server_context.api(),
server_context.clusterManager());
auto config = std::make_shared<AWSLambdaConfigImpl>(std::move(chain),
std::move(sts_factory),
context.mainThreadDispatcher(), context.api(), context.threadLocal(), stats_prefix,
context.scope(), proto_config);
server_context.mainThreadDispatcher(), server_context.api(), server_context.threadLocal(), stats_prefix,
server_context.scope(), proto_config);
return
[&context, config]
[&server_context, config]
(Http::FilterChainFactoryCallbacks &callbacks) -> void {
callbacks.addStreamFilter(std::make_shared<AWSLambdaFilter>(
context.clusterManager(), context.api(), config));
server_context.clusterManager(), server_context.api(), config));
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class StsCredentialsProviderFactory {

static StsCredentialsProviderFactoryPtr create(Api::Api &api,
Upstream::ClusterManager &cm);

};

} // namespace AwsLambda
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ NatsStreamingFilterConfigFactory::createFilterFactoryFromProtoTyped(

NatsStreamingFilterConfigSharedPtr config =
std::make_shared<NatsStreamingFilterConfig>(
NatsStreamingFilterConfig(proto_config, context.clusterManager()));
NatsStreamingFilterConfig(proto_config, context.serverFactoryContext().clusterManager()));

Tcp::ConnPoolNats::ClientFactory<Envoy::Nats::Message> &client_factory =
Tcp::ConnPoolNats::ClientFactoryImpl<Envoy::Nats::Message,
Expand All @@ -33,8 +33,8 @@ NatsStreamingFilterConfigFactory::createFilterFactoryFromProtoTyped(

Envoy::Nats::Streaming::ClientPtr nats_streaming_client =
std::make_shared<Envoy::Nats::Streaming::ClientPool>(
config->cluster(), context.clusterManager(), client_factory,
context.threadLocal(), context.api().randomGenerator(), config->opTimeout());
config->cluster(), context.serverFactoryContext().clusterManager(), client_factory,
context.serverFactoryContext().threadLocal(), context.serverFactoryContext().api().randomGenerator(), config->opTimeout());

return [config, nats_streaming_client](
Envoy::Http::FilterChainFactoryCallbacks &callbacks) -> void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void TransformationFilterConfig::addTransformationLegacy(
request_transformation, response_transformation,
on_stream_completion_transformation, clear_route_cache);
if (rule.has_route_transformations()) {
transformer_pair = createTransformations(rule.route_transformations(), context);
transformer_pair = createTransformations(rule.route_transformations(), context.serverFactoryContext());
}
transformer_pairs_.emplace_back(MatcherCopy::Matcher::create(rule.match()),
transformer_pair);
Expand All @@ -38,10 +38,10 @@ void TransformationFilterConfig::addTransformationLegacy(
TransformationFilterConfig::TransformationFilterConfig(
const TransformationConfigProto &proto_config, const std::string &prefix,
Server::Configuration::FactoryContext &context)
: FilterConfig(prefix, context.scope(), proto_config.stage(),
: FilterConfig(prefix, context.serverFactoryContext().scope(), proto_config.stage(),
proto_config.log_request_response_info()) {
if (proto_config.has_matcher()) {
matcher_ = createTransformationMatcher(proto_config.matcher(), context.getServerFactoryContext());
matcher_ = createTransformationMatcher(proto_config.matcher(), context.serverFactoryContext());
return;
}
for (const auto &rule : proto_config.transformations()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ class AWSLambdaFilterTest : public testing::Test {
void setupRoute(bool sessionToken = false, bool noCredentials = false,
bool persistOriginalHeaders = false, bool unwrapAsAlb = false,
bool unmanagedCredentials = false, bool unwrapAsApiGateway = false) {
factory_context_.cluster_manager_.initializeClusters({"fake_cluster"}, {});
factory_context_.cluster_manager_.initializeThreadLocalClusters({"fake_cluster"});
factory_context_.server_factory_context_.cluster_manager_.initializeClusters({"fake_cluster"}, {});
factory_context_.server_factory_context_.cluster_manager_.initializeThreadLocalClusters({"fake_cluster"});

routeconfig_.set_name("func");
routeconfig_.set_qualifier("v1");
Expand Down Expand Up @@ -131,15 +131,15 @@ class AWSLambdaFilterTest : public testing::Test {
filter_config_->propagate_original_routing_=persistOriginalHeaders;

ON_CALL(
*factory_context_.cluster_manager_.thread_local_cluster_.cluster_.info_,
*factory_context_.server_factory_context_.cluster_manager_.thread_local_cluster_.cluster_.info_,
extensionProtocolOptions(SoloHttpFilterNames::get().AwsLambda))
.WillByDefault(
Return(std::make_shared<AWSLambdaProtocolExtensionConfig>(
protoextconfig)));


filter_ = std::make_unique<AWSLambdaFilter>(
factory_context_.cluster_manager_, factory_context_.api_,
factory_context_.server_factory_context_.cluster_manager_, factory_context_.server_factory_context_.api_,
filter_config_);
filter_->setDecoderFilterCallbacks(filter_callbacks_);

Expand Down Expand Up @@ -402,7 +402,7 @@ TEST_F(AWSLambdaFilterTest, SignsDataSetByPreviousFilters) {
auto hex_sha1 = auth1.getBodyHexSha();

filter_ = std::make_unique<AWSLambdaFilter>(
factory_context_.cluster_manager_, factory_context_.api_,
factory_context_.server_factory_context_.cluster_manager_, factory_context_.server_factory_context_.api_,
filter_config_);
filter_->setDecoderFilterCallbacks(filter_callbacks_);

Expand All @@ -423,7 +423,7 @@ TEST_F(AWSLambdaFilterTest, SignsDataSetByPreviousFilters) {
EXPECT_EQ(hex_sha1, hex_sha2);

filter_ = std::make_unique<AWSLambdaFilter>(
factory_context_.cluster_manager_, factory_context_.api_,
factory_context_.server_factory_context_.cluster_manager_, factory_context_.server_factory_context_.api_,
filter_config_);
filter_->setDecoderFilterCallbacks(filter_callbacks_);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ class AWSLambdaTransformerTest : public testing::Test,
}

void setupRoute(bool unwrapAsApiGateway = false, bool wrapAsApiGateway = false) {
factory_context_.cluster_manager_.initializeClusters({"fake_cluster"}, {});
factory_context_.cluster_manager_.initializeThreadLocalClusters({"fake_cluster"});
factory_context_.server_factory_context_.cluster_manager_.initializeClusters({"fake_cluster"}, {});
factory_context_.server_factory_context_.cluster_manager_.initializeThreadLocalClusters({"fake_cluster"});

routeconfig_.set_name("func");
routeconfig_.set_qualifier("v1");
Expand Down Expand Up @@ -109,14 +109,14 @@ class AWSLambdaTransformerTest : public testing::Test,
filter_config_->propagate_original_routing_=false;

ON_CALL(
*factory_context_.cluster_manager_.thread_local_cluster_.cluster_.info_,
*factory_context_.server_factory_context_.cluster_manager_.thread_local_cluster_.cluster_.info_,
extensionProtocolOptions(SoloHttpFilterNames::get().AwsLambda))
.WillByDefault(
Return(std::make_shared<AWSLambdaProtocolExtensionConfig>(
protoextconfig)));

filter_ = std::make_unique<AWSLambdaFilter>(
factory_context_.cluster_manager_, factory_context_.api_,
factory_context_.server_factory_context_.cluster_manager_, factory_context_.server_factory_context_.api_,
filter_config_);
filter_->setDecoderFilterCallbacks(filter_callbacks_);
}
Expand Down
26 changes: 13 additions & 13 deletions test/extensions/filters/http/aws_lambda/config_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ class ConfigTest : public testing::Test {

NiceMock<Event::MockTimer> *prepareTimer() {
NiceMock<Event::MockTimer> *timer =
new NiceMock<Event::MockTimer>(&context_.dispatcher_);
new NiceMock<Event::MockTimer>(&context_.server_factory_context_.dispatcher_);
protoconfig.mutable_use_default_credentials()->set_value(true);
EXPECT_CALL(context_.thread_local_, allocateSlot()).Times(1);
EXPECT_CALL(context_.server_factory_context_.thread_local_, allocateSlot()).Times(1);
return timer;
}

Expand Down Expand Up @@ -84,8 +84,8 @@ TEST_F(ConfigTest, WithUseDefaultCreds) {
std::unique_ptr<NiceMock<MockStsCredentialsProviderFactory>> unique_factory{
sts_factory_};
auto config = std::make_shared<AWSLambdaConfigImpl>(
std::move(cred_provider), std::move(unique_factory), context_.dispatcher_,
context_.api_, context_.thread_local_, "prefix.", *stats_.rootScope(), protoconfig);
std::move(cred_provider), std::move(unique_factory), context_.server_factory_context_.dispatcher_,
context_.server_factory_context_.api_, context_.server_factory_context_.thread_local_, "prefix.", *stats_.rootScope(), protoconfig);

NiceMock<MockStsContextCallbacks> callbacks_1;

Expand Down Expand Up @@ -150,8 +150,8 @@ TEST_F(ConfigTest, FailingToRotate) {
std::unique_ptr<NiceMock<MockStsCredentialsProviderFactory>> unique_factory{
sts_factory_};
auto config = std::make_shared<AWSLambdaConfigImpl>(
std::move(cred_provider), std::move(unique_factory), context_.dispatcher_,
context_.api_, context_.thread_local_, "prefix.", *stats_.rootScope(), protoconfig);
std::move(cred_provider), std::move(unique_factory), context_.server_factory_context_.dispatcher_,
context_.server_factory_context_.api_, context_.server_factory_context_.thread_local_, "prefix.", *stats_.rootScope(), protoconfig);

std::shared_ptr<const AWSLambdaProtocolExtensionConfig> ext_config_1 =
std::make_shared<const AWSLambdaProtocolExtensionConfig>(protoextconfig);
Expand Down Expand Up @@ -200,8 +200,8 @@ TEST_F(ConfigTest, WithProtocolExtensionCreds) {
std::unique_ptr<NiceMock<MockStsCredentialsProviderFactory>> unique_factory{
sts_factory_};
auto config = std::make_shared<AWSLambdaConfigImpl>(
std::move(cred_provider), std::move(unique_factory), context_.dispatcher_,
context_.api_, context_.thread_local_, "prefix.", *stats_.rootScope(), protoconfig);
std::move(cred_provider), std::move(unique_factory), context_.server_factory_context_.dispatcher_,
context_.server_factory_context_.api_, context_.server_factory_context_.thread_local_, "prefix.", *stats_.rootScope(), protoconfig);

NiceMock<MockStsContextCallbacks> callbacks_1;

Expand Down Expand Up @@ -254,10 +254,10 @@ TEST_F(ConfigTest, WithStsCreds) {
setenv("AWS_WEB_IDENTITY_TOKEN_FILE", "test", 1);
setenv("AWS_ROLE_ARN", "test_arn", 1);

EXPECT_CALL(context_.api_.file_system_, fileExists(_))
EXPECT_CALL(context_.server_factory_context_.api_.file_system_, fileExists(_))
.Times(1)
.WillOnce(Return(true));
EXPECT_CALL(context_.api_.file_system_, fileReadToEnd(_))
EXPECT_CALL(context_.server_factory_context_.api_.file_system_, fileReadToEnd(_))
.Times(1)
.WillOnce(Return("web_token"));

Expand All @@ -273,15 +273,15 @@ TEST_F(ConfigTest, WithStsCreds) {
}));

auto watcher = new Filesystem::MockWatcher();
EXPECT_CALL(context_.dispatcher_, createFilesystemWatcher_())
EXPECT_CALL(context_.server_factory_context_.dispatcher_, createFilesystemWatcher_())
.WillOnce(Return(watcher));
EXPECT_CALL(*watcher, addWatch("test", _, _)).Times(1);

std::unique_ptr<NiceMock<MockStsCredentialsProviderFactory>> unique_factory{
sts_factory_};
auto config = std::make_shared<AWSLambdaConfigImpl>(
std::move(cred_provider), std::move(unique_factory), context_.dispatcher_,
context_.api_, context_.thread_local_, "prefix.", *stats_.rootScope(), protoconfig);
std::move(cred_provider), std::move(unique_factory), context_.server_factory_context_.dispatcher_,
context_.server_factory_context_.api_, context_.server_factory_context_.thread_local_, "prefix.", *stats_.rootScope(), protoconfig);

NiceMock<MockStsContextCallbacks> callbacks;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ TEST_F(StsConnectionPoolTest, TestSuccessfulCallback) {
std::unique_ptr<testing::NiceMock<MockStsFetcher>> unique_fetcher{
sts_fetcher_};
auto sts_conn_pool = StsConnectionPool::create(
mock_factory_ctx_.api_, mock_factory_ctx_.dispatcher_, role_arn, role_arn,
mock_factory_ctx_.server_factory_context_.api_, mock_factory_ctx_.server_factory_context_.dispatcher_, role_arn, role_arn,
&pool_callbacks, std::move(unique_fetcher));

// Fetch credentials first call as they are not in the cache
Expand Down Expand Up @@ -133,7 +133,7 @@ TEST_F(StsConnectionPoolTest, TestPostInitAdd) {
std::unique_ptr<testing::NiceMock<MockStsFetcher>> unique_fetcher{
sts_fetcher_};
auto sts_conn_pool = StsConnectionPool::create(
mock_factory_ctx_.api_, mock_factory_ctx_.dispatcher_, role_arn, role_arn,
mock_factory_ctx_.server_factory_context_.api_, mock_factory_ctx_.server_factory_context_.dispatcher_, role_arn, role_arn,
&pool_callbacks, std::move(unique_fetcher));

StsFetcher::Callbacks *lambda_callbacks;
Expand All @@ -154,7 +154,7 @@ TEST_F(StsConnectionPoolTest, TestPostInitAdd) {
auto context_1 = sts_conn_pool->add(&ctx_callbacks);

// Expect the context to be removed
EXPECT_CALL(mock_factory_ctx_.dispatcher_, deferredDelete_(_));
EXPECT_CALL(mock_factory_ctx_.server_factory_context_.dispatcher_, deferredDelete_(_));

context_1->cancel();

Expand Down Expand Up @@ -193,7 +193,7 @@ TEST_F(StsConnectionPoolTest, TestFailure) {
std::unique_ptr<testing::NiceMock<MockStsFetcher>> unique_fetcher{
sts_fetcher_};
auto sts_conn_pool = StsConnectionPool::create(
mock_factory_ctx_.api_, mock_factory_ctx_.dispatcher_, role_arn, role_arn,
mock_factory_ctx_.server_factory_context_.api_, mock_factory_ctx_.server_factory_context_.dispatcher_, role_arn, role_arn,
&pool_callbacks, std::move(unique_fetcher));

// Fetch credentials first call as they are not in the cache
Expand Down
Loading