Skip to content

Commit f05df40

Browse files
authored
impr(compute): Remove the deprecated CLI arg alias for remote-ext-config. (neondatabase#12087)
Also moves it from `String` to `Url`.
1 parent f6c0f6c commit f05df40

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

compute_tools/src/bin/compute_ctl.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ struct Cli {
6464
pub pgbin: String,
6565

6666
/// The base URL for the remote extension storage proxy gateway.
67-
/// Should be in the form of `http(s)://<gateway-hostname>[:<port>]`.
68-
#[arg(short = 'r', long, alias = "remote-ext-config")]
69-
pub remote_ext_base_url: Option<String>,
67+
#[arg(short = 'r', long)]
68+
pub remote_ext_base_url: Option<Url>,
7069

7170
/// The port to bind the external listening HTTP server to. Clients running
7271
/// outside the compute will talk to the compute through this port. Keep

compute_tools/src/compute.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ use std::time::{Duration, Instant};
3131
use std::{env, fs};
3232
use tokio::spawn;
3333
use tracing::{Instrument, debug, error, info, instrument, warn};
34+
use url::Url;
3435
use utils::id::{TenantId, TimelineId};
3536
use utils::lsn::Lsn;
3637
use utils::measured_stream::MeasuredReader;
@@ -96,7 +97,7 @@ pub struct ComputeNodeParams {
9697
pub internal_http_port: u16,
9798

9899
/// the address of extension storage proxy gateway
99-
pub remote_ext_base_url: Option<String>,
100+
pub remote_ext_base_url: Option<Url>,
100101

101102
/// Interval for installed extensions collection
102103
pub installed_extensions_collection_interval: u64,

compute_tools/src/extension_server.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ use reqwest::StatusCode;
8383
use tar::Archive;
8484
use tracing::info;
8585
use tracing::log::warn;
86+
use url::Url;
8687
use zstd::stream::read::Decoder;
8788

8889
use crate::metrics::{REMOTE_EXT_REQUESTS_TOTAL, UNKNOWN_HTTP_STATUS};
@@ -158,14 +159,14 @@ fn parse_pg_version(human_version: &str) -> PostgresMajorVersion {
158159
pub async fn download_extension(
159160
ext_name: &str,
160161
ext_path: &RemotePath,
161-
remote_ext_base_url: &str,
162+
remote_ext_base_url: &Url,
162163
pgbin: &str,
163164
) -> Result<u64> {
164165
info!("Download extension {:?} from {:?}", ext_name, ext_path);
165166

166167
// TODO add retry logic
167168
let download_buffer =
168-
match download_extension_tar(remote_ext_base_url, &ext_path.to_string()).await {
169+
match download_extension_tar(remote_ext_base_url.as_str(), &ext_path.to_string()).await {
169170
Ok(buffer) => buffer,
170171
Err(error_message) => {
171172
return Err(anyhow::anyhow!(

0 commit comments

Comments
 (0)