-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wasm: add api for configuring environment variable in VmConfig #15136
Changes from all commits
c389247
2077a4e
fda8ed6
8bab14a
194471b
1fec667
dd00186
065cbe8
851bd2e
0306a2f
8b602a2
cb9b1df
8fa9a02
dd9568c
d1eb946
e8795f5
824f0e7
a917095
5c1f0f0
fc931d4
d6268a8
041286f
22ee914
2f1e10b
b4e5d56
3ed2309
435f69a
3d6dc03
78ac3f8
4e4ccf7
84a4f5c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,15 +15,21 @@ namespace Extensions { | |
namespace Common { | ||
namespace Wasm { | ||
|
||
// clang-format off | ||
using EnvironmentVariableMap = std::unordered_map<std::string, std::string>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason why this is not absl is that we have decided not to use absl as a dependency in proxy-wasm-cpp-host which is supposed to be used in other proxies in theory. |
||
// clang-format on | ||
|
||
class WasmConfig { | ||
public: | ||
WasmConfig(const envoy::extensions::wasm::v3::PluginConfig& config); | ||
const envoy::extensions::wasm::v3::PluginConfig& config() { return config_; } | ||
proxy_wasm::AllowedCapabilitiesMap& allowedCapabilities() { return allowed_capabilities_; } | ||
EnvironmentVariableMap& environmentVariables() { return envs_; } | ||
|
||
private: | ||
const envoy::extensions::wasm::v3::PluginConfig& config_; | ||
proxy_wasm::AllowedCapabilitiesMap allowed_capabilities_{}; | ||
EnvironmentVariableMap envs_; | ||
}; | ||
|
||
using WasmConfigPtr = std::unique_ptr<WasmConfig>; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we want some notion of env vars elsewhere in xDS as well, so we might want to factor this message to base types. @markdroth thoughts?