Skip to content

Commit b4d0e2f

Browse files
committed
Adding code review
1 parent 187fbff commit b4d0e2f

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

rust/crd/src/authentication.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,7 @@ mod tests {
765765
error_message
766766
);
767767
}
768+
768769
#[tokio::test]
769770
async fn reject_wrong_principal_claim() {
770771
let error_message = test_resolve_and_expect_error(

rust/crd/src/lib.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -341,12 +341,11 @@ impl AirflowRole {
341341
match &self {
342342
AirflowRole::Webserver => {
343343
// Getting auth commands for AuthClass
344-
let auth_commands = vec![Self::authentication_start_commands(auth_config)];
344+
command.extend(Self::authentication_start_commands(auth_config));
345345
command.extend(vec![
346346
"prepare_signal_handlers".to_string(),
347347
"airflow webserver &".to_string(),
348348
]);
349-
command.extend(auth_commands);
350349
}
351350

352351
AirflowRole::Scheduler => command.extend(vec![
@@ -377,9 +376,10 @@ impl AirflowRole {
377376

378377
command
379378
}
379+
380380
fn authentication_start_commands(
381381
auth_config: &AirflowClientAuthenticationDetailsResolved,
382-
) -> String {
382+
) -> Vec<String> {
383383
let mut commands = Vec::new();
384384

385385
let mut tls_client_credentials = BTreeSet::new();
@@ -401,13 +401,9 @@ impl AirflowRole {
401401
}));
402402
}
403403

404-
commands
405-
.iter()
406-
.flatten()
407-
.cloned()
408-
.collect::<Vec<_>>()
409-
.join("\n")
404+
commands.iter().flatten().cloned().collect::<Vec<_>>()
410405
}
406+
411407
// Adding certificate to the mount path for airflow startup commands
412408
fn add_cert_to_python_certifi_command(cert_file: &str) -> String {
413409
format!("cat {cert_file} >> \"$(python -c 'import certifi; print(certifi.where())')\"")

0 commit comments

Comments
 (0)