mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
refactor(tunnel): rename aether-proxy to aether-tunnel
This commit is contained in:
@@ -561,7 +561,7 @@ impl ProxyNodeWriteRepository for InMemoryProxyNodeRepository {
|
||||
};
|
||||
if !node.tunnel_mode {
|
||||
return Err(DataLayerError::InvalidInput(
|
||||
"non-tunnel mode is no longer supported, please upgrade aether-proxy to use tunnel mode"
|
||||
"non-tunnel mode is no longer supported, please upgrade aether-tunnel to use tunnel mode"
|
||||
.to_string(),
|
||||
));
|
||||
}
|
||||
@@ -1163,7 +1163,7 @@ mod tests {
|
||||
dns_failures_delta: Some(0),
|
||||
stream_errors_delta: Some(0),
|
||||
proxy_metadata: Some(json!({"arch": "arm64"})),
|
||||
proxy_version: Some("proxy-v2.2.0".to_string()),
|
||||
proxy_version: Some("tunnel-v2.2.0".to_string()),
|
||||
})
|
||||
.await
|
||||
.expect("heartbeat should succeed")
|
||||
|
||||
@@ -755,7 +755,7 @@ WHERE is_manual = 0
|
||||
};
|
||||
if !node.tunnel_mode {
|
||||
return Err(DataLayerError::InvalidInput(
|
||||
"non-tunnel mode is no longer supported, please upgrade aether-proxy to use tunnel mode"
|
||||
"non-tunnel mode is no longer supported, please upgrade aether-tunnel to use tunnel mode"
|
||||
.to_string(),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -1165,7 +1165,7 @@ impl ProxyNodeWriteRepository for SqlxProxyNodeRepository {
|
||||
};
|
||||
if !existing.tunnel_mode {
|
||||
return Err(DataLayerError::InvalidInput(
|
||||
"non-tunnel mode is no longer supported, please upgrade aether-proxy to use tunnel mode"
|
||||
"non-tunnel mode is no longer supported, please upgrade aether-tunnel to use tunnel mode"
|
||||
.to_string(),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -746,7 +746,7 @@ WHERE is_manual = 0
|
||||
};
|
||||
if !node.tunnel_mode {
|
||||
return Err(DataLayerError::InvalidInput(
|
||||
"non-tunnel mode is no longer supported, please upgrade aether-proxy to use tunnel mode"
|
||||
"non-tunnel mode is no longer supported, please upgrade aether-tunnel to use tunnel mode"
|
||||
.to_string(),
|
||||
));
|
||||
}
|
||||
@@ -1431,7 +1431,7 @@ VALUES ('node-1', 'registered', 'ok', 3)
|
||||
log_level: Some("debug".to_string()),
|
||||
heartbeat_interval: Some(45),
|
||||
scheduling_state: Some(Some("draining".to_string())),
|
||||
upgrade_to: Some(Some("proxy-v2.0.0".to_string())),
|
||||
upgrade_to: Some(Some("tunnel-v2.0.0".to_string())),
|
||||
})
|
||||
.await
|
||||
.expect("remote config should update")
|
||||
|
||||
@@ -570,7 +570,8 @@ fn normalize_proxy_version_label(value: &str) -> Option<String> {
|
||||
}
|
||||
Some(
|
||||
trimmed
|
||||
.strip_prefix("proxy-v")
|
||||
.strip_prefix("tunnel-v")
|
||||
.or_else(|| trimmed.strip_prefix("proxy-v"))
|
||||
.unwrap_or(trimmed)
|
||||
.to_ascii_lowercase(),
|
||||
)
|
||||
@@ -781,7 +782,7 @@ mod tests {
|
||||
fn normalizes_reported_versions_and_clears_completed_upgrade_targets() {
|
||||
let remote_config = json!({
|
||||
"node_name": "edge-1",
|
||||
"upgrade_to": "proxy-v2.0.0",
|
||||
"upgrade_to": "tunnel-v2.0.0",
|
||||
});
|
||||
let proxy_metadata = json!({
|
||||
"version": "2.0.0",
|
||||
@@ -798,7 +799,7 @@ mod tests {
|
||||
);
|
||||
|
||||
let reconciled =
|
||||
reconcile_remote_config_after_heartbeat(Some(&remote_config), Some("proxy-v2.0.0"))
|
||||
reconcile_remote_config_after_heartbeat(Some(&remote_config), Some("tunnel-v2.0.0"))
|
||||
.expect("reconciled config should remain an object");
|
||||
assert_eq!(reconciled.get("upgrade_to"), None);
|
||||
assert_eq!(reconciled.get("node_name"), Some(&json!("edge-1")));
|
||||
|
||||
Reference in New Issue
Block a user