-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding remote env var loading. * Loading env vars from nginx. * Loading env vars from remote proc works, but it doesn't load the correct string? * Notes on how to proceed (nginx out). * Working override env vars. * Fix wrong pid value being used. * Clean files. * Use correct imagePullPolicy. * Simplify env vars handling. Make it select all then filter. * Fix launch.json env. * Remove unused rust features. * Put env vars override behind an enabled bool flag. * Add configuration for setting up override env vars + filter. * Refactor some layer initialization functions to take config, instead of select arguments. Changed name for env vars request/response messages. * Update changelog. Renamed env vars config. Env vars overriding now filters out some keys by default, like PATH (user cant control these defaults). * Fix comment. * local config. * Added config to change image pull policy from env. * Fix clap deprecations. * Remote env changes. * Use clap 3, instead of specifying subversion. * Update cargo.lock. * Use std::env::set_var instead of libc::setenv (plus assert the var is properly set). * Increase initial memory allocation for string buffer that receives env vars. * Change mirrord to custom image for tests. * Add remote env vars test. * Make test app crash on incorrect env vars. * Ignore unrelated tests to make CI go faster. * Env vars now filter + select properly. * Fix include string. * Fix env vars test args. * Added more tests for remote_env. Don't allow user to specify both include + exclude. Removed flag to enable/disable env vars, now controller by having values in the filters. * Fix launch.json. * Use proper test image. * Fix remote_env tests using the wrong option. * Fix comments. * Support include * as an include all env vars. * Log result of tests process. * Failure test should panic. * Less clutter in console for remote env tests. * Debug why test that should panic (and panics), doesn't trigger the test panic (wow what a phrase). * Return exit code -1 if we have an env var selected. * Fix test for panicking remote_env. Re-enable other tests.
- Loading branch information
Showing
17 changed files
with
574 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
use clap::{Args, Parser, Subcommand}; | ||
|
||
#[derive(Parser)] | ||
#[clap(author, version, about, long_about = None)] | ||
pub(super) struct Cli { | ||
#[clap(subcommand)] | ||
pub(super) commands: Commands, | ||
} | ||
|
||
#[derive(Subcommand)] | ||
pub(super) enum Commands { | ||
Exec(ExecArgs), | ||
Extract { | ||
#[clap(value_parser)] | ||
path: String, | ||
}, | ||
} | ||
|
||
#[derive(Args, Debug)] | ||
pub(super) struct ExecArgs { | ||
/// Pod name to mirror. | ||
#[clap(short, long, value_parser)] | ||
pub pod_name: String, | ||
|
||
/// Namespace of the pod to mirror. Defaults to "default". | ||
#[clap(short = 'n', long, value_parser)] | ||
pub pod_namespace: Option<String>, | ||
|
||
/// Namespace to place agent in. | ||
#[clap(short = 'a', long, value_parser)] | ||
pub agent_namespace: Option<String>, | ||
|
||
/// Agent log level | ||
#[clap(short = 'l', long, value_parser)] | ||
pub agent_log_level: Option<String>, | ||
|
||
/// Agent image | ||
#[clap(short = 'i', long, value_parser)] | ||
pub agent_image: Option<String>, | ||
|
||
/// Enable file hooking | ||
#[clap(short = 'f', long, value_parser)] | ||
pub enable_fs: bool, | ||
|
||
/// The env vars to filter out | ||
#[clap(short = 'x', long, value_parser)] | ||
pub override_env_vars_exclude: Option<String>, | ||
|
||
/// The env vars to select | ||
#[clap(short = 's', long, value_parser)] | ||
pub override_env_vars_include: Option<String>, | ||
|
||
/// Binary to execute and mirror traffic into. | ||
#[clap(value_parser)] | ||
pub binary: String, | ||
|
||
/// Agent TTL | ||
#[clap(long, value_parser)] | ||
pub agent_ttl: Option<u16>, | ||
|
||
/// Accept/reject invalid certificates. | ||
#[clap(short = 'c', long, value_parser)] | ||
pub accept_invalid_certificates: bool, | ||
|
||
/// Arguments to pass to the binary. | ||
#[clap(value_parser)] | ||
pub(super) binary_args: Vec<String>, | ||
} |
Oops, something went wrong.