Skip to content

Commit

Permalink
Adding code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Maleware committed Nov 11, 2024
1 parent 187fbff commit b4d0e2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
1 change: 1 addition & 0 deletions rust/crd/src/authentication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ mod tests {
error_message
);
}

#[tokio::test]
async fn reject_wrong_principal_claim() {
let error_message = test_resolve_and_expect_error(
Expand Down
14 changes: 5 additions & 9 deletions rust/crd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,11 @@ impl AirflowRole {
match &self {
AirflowRole::Webserver => {
// Getting auth commands for AuthClass
let auth_commands = vec![Self::authentication_start_commands(auth_config)];
command.extend(Self::authentication_start_commands(auth_config));
command.extend(vec![
"prepare_signal_handlers".to_string(),
"airflow webserver &".to_string(),
]);
command.extend(auth_commands);
}

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

command
}

fn authentication_start_commands(
auth_config: &AirflowClientAuthenticationDetailsResolved,
) -> String {
) -> Vec<String> {
let mut commands = Vec::new();

let mut tls_client_credentials = BTreeSet::new();
Expand All @@ -401,13 +401,9 @@ impl AirflowRole {
}));
}

commands
.iter()
.flatten()
.cloned()
.collect::<Vec<_>>()
.join("\n")
commands.iter().flatten().cloned().collect::<Vec<_>>()
}

// Adding certificate to the mount path for airflow startup commands
fn add_cert_to_python_certifi_command(cert_file: &str) -> String {
format!("cat {cert_file} >> \"$(python -c 'import certifi; print(certifi.where())')\"")
Expand Down

0 comments on commit b4d0e2f

Please sign in to comment.