mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-15 01:12:56 +00:00
Parse private_ext_prefixes from spec.
TODO: ensure that this spec change is backward/forward compatible
This commit is contained in:
@@ -676,12 +676,12 @@ LIMIT 100",
|
||||
let spec = &pspec.spec;
|
||||
|
||||
// 1. parse private extension paths from spec
|
||||
// TODO parse private extension paths from spec instead of tenant_id
|
||||
let mut private_ext_prefixes = Vec::new();
|
||||
let private_ext_prefixes = match &spec.private_extensions {
|
||||
Some(private_extensions) => private_extensions.clone(),
|
||||
None => Vec::new(),
|
||||
};
|
||||
|
||||
if let Some(tenant_id) = spec.tenant_id {
|
||||
private_ext_prefixes.push(tenant_id.to_string());
|
||||
}
|
||||
info!("private_ext_prefixes: {:?}", &private_ext_prefixes);
|
||||
|
||||
// 2. parse shared_preload_libraries from spec
|
||||
let mut libs_vec = Vec::new();
|
||||
@@ -737,9 +737,12 @@ LIMIT 100",
|
||||
let compute_state = self.state.lock().unwrap().clone();
|
||||
let pspec = compute_state.pspec.as_ref().expect("spec must be set");
|
||||
|
||||
// TODO parse private extension paths from spec instead of tenant_id
|
||||
let tenant_id = pspec.tenant_id.to_string();
|
||||
let private_ext_prefixes: Vec<String> = vec![tenant_id];
|
||||
let private_ext_prefixes = match &pspec.spec.private_extensions {
|
||||
Some(private_extensions) => private_extensions.clone(),
|
||||
None => Vec::new(),
|
||||
};
|
||||
|
||||
info!("private_ext_prefixes: {:?}", &private_ext_prefixes);
|
||||
|
||||
extension_server::download_extension_sql_files(
|
||||
&filename,
|
||||
@@ -759,9 +762,12 @@ LIMIT 100",
|
||||
let compute_state = self.state.lock().unwrap().clone();
|
||||
let pspec = compute_state.pspec.as_ref().expect("spec must be set");
|
||||
|
||||
// TODO parse private extension paths from spec instead of tenant_id
|
||||
let tenant_id = pspec.tenant_id.to_string();
|
||||
let private_ext_prefixes: Vec<String> = vec![tenant_id];
|
||||
let private_ext_prefixes = match &pspec.spec.private_extensions {
|
||||
Some(private_extensions) => private_extensions.clone(),
|
||||
None => Vec::new(),
|
||||
};
|
||||
|
||||
info!("private_ext_prefixes: {:?}", &private_ext_prefixes);
|
||||
|
||||
extension_server::download_library_file(
|
||||
&filename,
|
||||
|
||||
@@ -481,6 +481,7 @@ impl Endpoint {
|
||||
pageserver_connstring: Some(pageserver_connstring),
|
||||
safekeeper_connstrings,
|
||||
storage_auth_token: auth_token.clone(),
|
||||
private_extensions: Some(vec![self.tenant_id.to_string()]), //DEBUG ONLY
|
||||
};
|
||||
let spec_path = self.endpoint_path().join("spec.json");
|
||||
std::fs::write(spec_path, serde_json::to_string_pretty(&spec)?)?;
|
||||
|
||||
@@ -60,6 +60,8 @@ pub struct ComputeSpec {
|
||||
/// If set, 'storage_auth_token' is used as the password to authenticate to
|
||||
/// the pageserver and safekeepers.
|
||||
pub storage_auth_token: Option<String>,
|
||||
|
||||
pub private_extensions: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
#[serde_as]
|
||||
|
||||
Reference in New Issue
Block a user