mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-23 16:00:38 +00:00
all
This commit is contained in:
+4
-3
@@ -54,7 +54,8 @@ use windmill_common::{
|
||||
stats_oss::schedule_stats,
|
||||
triggers::TriggerKind,
|
||||
utils::{
|
||||
create_default_worker_suffix, create_ssh_agent_worker_suffix, worker_name_with_suffix,
|
||||
create_worker_suffix,
|
||||
worker_name_with_suffix,
|
||||
Mode, GIT_VERSION, HOSTNAME, MODE_AND_ADDONS,
|
||||
},
|
||||
worker::{
|
||||
@@ -347,7 +348,7 @@ async fn windmill_main() -> anyhow::Result<()> {
|
||||
"Creating http client for cluster using base internal url {}",
|
||||
std::env::var("BASE_INTERNAL_URL").unwrap_or_default()
|
||||
);
|
||||
let suffix = create_ssh_agent_worker_suffix(&hostname);
|
||||
let suffix = create_worker_suffix(&hostname);
|
||||
(
|
||||
Connection::Http(build_agent_http_client(&suffix)),
|
||||
Some(suffix),
|
||||
@@ -687,7 +688,7 @@ Windmill Community Edition {GIT_VERSION}
|
||||
let suffix = if i == 0 && first_suffix.is_some() {
|
||||
first_suffix.as_ref().unwrap().clone()
|
||||
} else {
|
||||
create_default_worker_suffix(&hostname)
|
||||
create_worker_suffix(&hostname)
|
||||
};
|
||||
|
||||
let worker_conn = WorkerConn {
|
||||
|
||||
@@ -196,22 +196,9 @@ fn instance_name(hostname: &str) -> String {
|
||||
}
|
||||
|
||||
const DEFAULT_WORKER_SUFFIX_LEN: usize = 5;
|
||||
pub const SSH_AGENT_WORKER_SUFFIX: &'static str = "/ssh";
|
||||
|
||||
pub fn create_worker_suffix(hostname: &str, rd_string_len: usize, ssh_ag_worker: bool) -> String {
|
||||
let mut wk_suffix = format!("{}-{}", instance_name(hostname), rd_string(rd_string_len));
|
||||
if ssh_ag_worker {
|
||||
wk_suffix.push_str(SSH_AGENT_WORKER_SUFFIX);
|
||||
}
|
||||
wk_suffix
|
||||
}
|
||||
|
||||
pub fn create_ssh_agent_worker_suffix(hostname: &str) -> String {
|
||||
create_worker_suffix(hostname, DEFAULT_WORKER_SUFFIX_LEN, true)
|
||||
}
|
||||
|
||||
pub fn create_default_worker_suffix(hostname: &str) -> String {
|
||||
create_worker_suffix(hostname, DEFAULT_WORKER_SUFFIX_LEN, false)
|
||||
pub fn create_worker_suffix(hostname: &str) -> String {
|
||||
format!("{}-{}", instance_name(hostname), rd_string(DEFAULT_WORKER_SUFFIX_LEN))
|
||||
}
|
||||
|
||||
pub fn worker_name_with_suffix(is_agent: bool, worker_group: &str, suffix: &str) -> String {
|
||||
|
||||
Reference in New Issue
Block a user