Skip to content

Commit 68f8b31

Browse files
YousefSalamameta-codesync[bot]
authored andcommitted
admin: output redaction fetch-key-list keys to stdout when no output file is specified
Summary: `mononoke_admin redaction fetch-key-list` silently discards the fetched keys when `--output-file` is not provided. This adds an `else` branch to print the keys to stdout. Differential Revision: D103866028 fbshipit-source-id: f7a76e485b03b1de4cc38702abf84b4c87e73d87
1 parent 7094551 commit 68f8b31

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

eden/mononoke/tests/integration/test-redaction-config.t

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ Redact file 'c' in commit '$C'
8484
$ cat "$TESTTMP/keys"
8585
content.blake2.000a1a9b74aa3da71fcceb653a62cb6987ae440c2b5c3d7e5d08d7c526b1dca8
8686

87+
fetch-key-list without --output-file prints to stdout
88+
$ mononoke_admin redaction fetch-key-list -R repo $(cat rs_0)
89+
content.blake2.000a1a9b74aa3da71fcceb653a62cb6987ae440c2b5c3d7e5d08d7c526b1dca8
90+
8791
Attempt to redact file 'b' in commit '$COMMIT_B'
8892
This initially fails because it is still reachable in 'master'
8993
$ mononoke_admin redaction create-key-list -R repo -i $COMMIT_B b --main-bookmark master_bookmark --skip-aws-sync

eden/mononoke/tools/admin/src/commands/redaction/create_key_list.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ pub async fn fetch_key_list(
138138
)
139139
})?;
140140
}
141+
} else {
142+
for key in key_list.keys {
143+
println!("{}", key);
144+
}
141145
}
142146
Ok(())
143147
}

0 commit comments

Comments
 (0)