Skip to content

Commit

Permalink
run cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
korewaChino committed Jan 8, 2025
1 parent b563d45 commit 2c0e18c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/cloud/cloud_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,7 @@ fn test_generate_cloud_init_config() {
let config = generate_cloud_init_config(password, 9090);
println!("{}", config);
assert!(config.contains("AUTH=chisel:test"));
assert!(config.contains("ExecStart=/usr/local/bin/chisel server --port=9090 --reverse --auth chisel:test"));
assert!(config.contains(
"ExecStart=/usr/local/bin/chisel server --port=9090 --reverse --auth chisel:test"
));
}
1 change: 0 additions & 1 deletion src/cloud/digitalocean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ impl Provisioner for DigitalOceanProvisioner {
exit_node: ExitNode,
node_password: String,
) -> color_eyre::Result<ExitNodeStatus> {

let config = generate_cloud_init_config(&node_password, exit_node.spec.port);

// TODO: Secret reference, not plaintext
Expand Down
8 changes: 6 additions & 2 deletions src/cloud/linode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ impl Provisioner for LinodeProvisioner {
);

// Since we now directly pass in the chisel auth string with the `chisel:` prefix, let's remove the prefix
let root_password = chisel_auth_string.strip_prefix("chisel:").unwrap_or(&chisel_auth_string);
let root_password = chisel_auth_string
.strip_prefix("chisel:")
.unwrap_or(&chisel_auth_string);

let mut instance = api
.create_instance(&self.region, &self.size)
Expand Down Expand Up @@ -179,7 +181,9 @@ impl Provisioner for LinodeProvisioner {
Ok(status)
} else {
warn!("No instance status found, creating new instance");
return self.create_exit_node(auth.clone(), exit_node, node_password).await;
return self
.create_exit_node(auth.clone(), exit_node, node_password)
.await;
}
}
}
12 changes: 10 additions & 2 deletions src/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -633,12 +633,20 @@ async fn reconcile_nodes(obj: Arc<ExitNode>, ctx: Arc<Context>) -> Result<Action
let cloud_resource = if let Some(_status) = node.status.as_ref() {
info!("Updating cloud resource for {}", node.name_any());
provisioner_api
.update_exit_node(api_key_secret.clone(), (*node).clone(), node_password)
.update_exit_node(
api_key_secret.clone(),
(*node).clone(),
node_password,
)
.await?
} else {
info!("Creating cloud resource for {}", node.name_any());
provisioner_api
.create_exit_node(api_key_secret.clone(), (*node).clone(), node_password)
.create_exit_node(
api_key_secret.clone(),
(*node).clone(),
node_password,
)
.await?
};

Expand Down

0 comments on commit 2c0e18c

Please sign in to comment.