-
Notifications
You must be signed in to change notification settings - Fork 108
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
Prevent config rendering on every process #3011
base: main
Are you sure you want to change the base?
Changes from all commits
44e7351
8726677
938c27e
8c13deb
da63bc7
16d7df1
2aa9588
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Stopped mirrord entering a crash loop when trying to load into some processes like VSCode's `watchdog.js` when the user config contained a call to `get_env()`, which occurred due to missing env - the config is now only rendered once and set into an env var. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -289,10 +289,9 @@ impl MirrordExecution { | |
})?; | ||
|
||
// Provide details for layer to connect to agent via internal proxy | ||
env_vars.insert( | ||
MIRRORD_CONNECT_TCP_ENV.to_string(), | ||
format!("127.0.0.1:{}", address.port()), | ||
); | ||
let mut config = config.clone(); | ||
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. Im a bit worried for container feature behaviour where we split up the env variables for sidecar and main container relying on |
||
config.connect_tcp = Some(format!("127.0.0.1:{}", address.port())); | ||
config.update_env()?; | ||
|
||
// Fixes <https://github.com/metalbear-co/mirrord/issues/1745> | ||
// by disabling the fork safety check in the Objective-C runtime. | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -67,7 +67,7 @@ impl fmt::Display for LinuxCapability { | |||||
/// } | ||||||
/// } | ||||||
/// ``` | ||||||
#[derive(MirrordConfig, Clone, Debug, Serialize)] | ||||||
#[derive(MirrordConfig, Clone, Debug, Serialize, Deserialize, PartialEq)] | ||||||
#[config(map_to = "AgentFileConfig", derive = "JsonSchema")] | ||||||
#[cfg_attr(test, config(derive = "PartialEq"))] | ||||||
pub struct AgentConfig { | ||||||
|
@@ -354,7 +354,7 @@ pub struct AgentConfig { | |||||
/// Create an agent that returns an error after accepting the first client. For testing | ||||||
/// purposes. Only supported with job agents (not with ephemeral agents). | ||||||
#[cfg(all(debug_assertions, not(test)))] // not(test) so that it's not included in the schema json. | ||||||
#[serde(skip_serializing)] | ||||||
#[serde(skip_serializing, skip_deserializing)] | ||||||
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.
Suggested change
|
||||||
#[config(env = "MIRRORD_AGENT_TEST_ERROR", default = false, unstable)] | ||||||
pub test_error: bool, | ||||||
} | ||||||
|
@@ -477,7 +477,7 @@ impl AgentFileConfig { | |||||
} | ||||||
} | ||||||
|
||||||
#[derive(MirrordConfig, Default, PartialEq, Eq, Clone, Debug, Serialize)] | ||||||
#[derive(MirrordConfig, Default, PartialEq, Eq, Clone, Debug, Serialize, Deserialize)] | ||||||
#[config(derive = "JsonSchema")] | ||||||
#[cfg_attr(test, config(derive = "PartialEq, Eq"))] | ||||||
pub struct AgentDnsConfig { | ||||||
|
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.
Instead of
clone
tomut
here, why not take this as&mut
in the function args?