Skip to content

Commit 64eb2df

Browse files
authored
Merge pull request #157 from swermin/feat/include-proc-info
Add support for gathering proc files necessary to convert coredump to minidump
2 parents 418125c + 0ac3259 commit 64eb2df

File tree

21 files changed

+1175
-10
lines changed

21 files changed

+1175
-10
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/core-dump-handler/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ The agent pod has the following environment variables and these are all set by t
177177
false (Default): The composer will generate the additional JSON files.
178178
179179
true: The composer will only collect the core dump and save the core parameters as an additional JSON
180+
* COMP_INCLUDE_PROC_INFO - Defines if the composer should get additional proc files from the container process. *Warning:* These files can contain sensitive information regarding the process, use with caution
181+
182+
false (Default): The composer will not collect any pid related files
183+
184+
true: The composer will copy 'auxv', 'cmdline', 'environ', 'maps' and 'status' for every container into the zip
180185
* COMP_CRIO_IMAGE_CMD - The command to use to get image information for the core dump.
181186
182187
"img" (Default): This is the value most crictls expect.
@@ -272,6 +277,7 @@ Image
272277
Composer
273278
* logLevel: The log level for the composer (Default "Warn")
274279
* ignoreCrio: Maps to the COMP_IGNORE_CRIO enviroment variable (Default false)
280+
* includeProcInfo: Maps to the COMP_INCLUDE_PROC_INFO enviroment variable (Default false)
275281
* crioImageCmd: Maps to the COMP_CRIO_IMAGE_CMD enviroment variable (Default "img")
276282
* timeout: Maps to the COMP_TIMEOUT environment variable ("Default 600)
277283
* compression: Maps to the COMP_COMPRESSION environment variable (Default "true")

charts/core-dump-handler/ci/inotify-manage-store.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ storageClass: hostclass
2121

2222
composer:
2323
ignoreCrio: false
24+
includeProcInfo: false
2425
crioImageCmd: "img"
2526
logLevel: "Warn"
2627
# Double curlies are required otherwise helm trys to parse the string

charts/core-dump-handler/ci/interval-manage-store.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ storageClass: hostclass
2121

2222
composer:
2323
ignoreCrio: false
24+
includeProcInfo: false
2425
crioImageCmd: "img"
2526
logLevel: "Warn"
2627
# Double curlies are required otherwise helm trys to parse the string

charts/core-dump-handler/ci/schedule-no-manage-store.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ storageClass: hostclass
2121

2222
composer:
2323
ignoreCrio: false
24+
includeProcInfo: false
2425
crioImageCmd: "img"
2526
logLevel: "Warn"
2627
# Double curlies are required otherwise helm trys to parse the string

charts/core-dump-handler/templates/daemonset.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ spec:
4444
value: {{ .Values.composer.logLevel }}
4545
- name: COMP_IGNORE_CRIO
4646
value: {{ .Values.composer.ignoreCrio | quote }}
47+
- name: COMP_INCLUDE_PROC_INFO
48+
value: {{ .Values.composer.includeProcInfo | quote }}
4749
- name: COMP_CRIO_IMAGE_CMD
4850
value: {{ .Values.composer.crioImageCmd }}
4951
- name: COMP_POD_SELECTOR_LABEL

charts/core-dump-handler/values.schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@
110110
"ignoreCrio": {
111111
"type": "boolean"
112112
},
113+
"includeProcInfo": {
114+
"type": "boolean"
115+
},
113116
"crioImageCmd": {
114117
"type": "string"
115118
},
@@ -130,6 +133,7 @@
130133
"required": [
131134
"crioImageCmd",
132135
"ignoreCrio",
136+
"includeProcInfo",
133137
"logLevel",
134138
"logLength",
135139
"filenameTemplate",

charts/core-dump-handler/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ storageClass: hostclass
2323

2424
composer:
2525
ignoreCrio: false
26+
includeProcInfo: false
2627
crioImageCmd: "img"
2728
logLevel: "Warn"
2829
filenameTemplate: "{uuid}-dump-{timestamp}-{hostname}-{exe_name}-{pid}-{signal}"

core-dump-agent/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@ features = ["tokio-rustls-tls"]
3131
[target.x86_64-unknown-linux-gnu.dependencies.rust-s3]
3232
version = "0.31.0"
3333

34+
[target.aarch64-unknown-linux-gnu.dependencies.rust-s3]
35+
version = "0.31.0"
36+
3437
[dev-dependencies]
3538
fs_extra = "1.2"

core-dump-agent/src/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,9 @@ fn create_env_file(host_location: &str) -> Result<(), std::io::Error> {
466466
let ignore_crio = env::var("COMP_IGNORE_CRIO")
467467
.unwrap_or_else(|_| "false".to_string())
468468
.to_lowercase();
469+
let include_proc_info = env::var("COMP_INCLUDE_PROC_INFO")
470+
.unwrap_or_else(|_| "false".to_string())
471+
.to_lowercase();
469472
let crio_image = env::var("COMP_CRIO_IMAGE_CMD").unwrap_or_else(|_| "img".to_string());
470473
let destination = format!("{}/{}", host_location, ".env");
471474
let use_crio_config = env::var("DEPLOY_CRIO_CONFIG")
@@ -492,7 +495,7 @@ fn create_env_file(host_location: &str) -> Result<(), std::io::Error> {
492495
info!("Creating {} file with LOG_LEVEL={}", destination, loglevel);
493496
let mut env_file = File::create(destination)?;
494497
let text = format!(
495-
"LOG_LEVEL={loglevel}\nIGNORE_CRIO={ignore_crio}\nCRIO_IMAGE_CMD={crio_image}\nUSE_CRIO_CONF={use_crio_config}\nFILENAME_TEMPLATE={filename_template}\nLOG_LENGTH={log_length}\nPOD_SELECTOR_LABEL={pod_selector_label}\nTIMEOUT={timeout}\nCOMPRESSION={compression}\nCORE_EVENTS={core_events}\nEVENT_DIRECTORY={event_directory}\n");
498+
"LOG_LEVEL={loglevel}\nIGNORE_CRIO={ignore_crio}\nINCLUDE_PROC_INFO={include_proc_info}\nCRIO_IMAGE_CMD={crio_image}\nUSE_CRIO_CONF={use_crio_config}\nFILENAME_TEMPLATE={filename_template}\nLOG_LENGTH={log_length}\nPOD_SELECTOR_LABEL={pod_selector_label}\nTIMEOUT={timeout}\nCOMPRESSION={compression}\nCORE_EVENTS={core_events}\nEVENT_DIRECTORY={event_directory}\n");
496499
info!("Writing composer .env \n{}", text);
497500
env_file.write_all(text.as_bytes())?;
498501
env_file.flush()?;

0 commit comments

Comments
 (0)