neon_local: only set --pageserver-config-override=remote_storage during init, not start

This commit is contained in:
Christian Schwarz
2024-05-04 12:30:06 +00:00
parent b96e0b2458
commit 511f593360

View File

@@ -157,15 +157,6 @@ impl PageServerNode {
}
}
if !cli_overrides
.iter()
.any(|c| c.starts_with("remote_storage"))
{
overrides.push(format!(
"remote_storage={{local_path='../{PAGESERVER_REMOTE_STORAGE_DIR}'}}"
));
}
if *http_auth_type != AuthType::Trust || *pg_auth_type != AuthType::Trust {
// Keys are generated in the toplevel repo dir, pageservers' workdirs
// are one level below that, so refer to keys with ../
@@ -220,6 +211,14 @@ impl PageServerNode {
format!("Cannot start pageserver node {node_id} in path that has no string representation: {datadir:?}")
})?;
let mut args = self.pageserver_basic_args(config_overrides, datadir_path_str);
if !config_overrides
.iter()
.any(|c| c.starts_with("remote_storage"))
{
args.push(Cow::Owned(format!(
"--pageserver-config-override=remote_storage={{local_path='../{PAGESERVER_REMOTE_STORAGE_DIR}'}}"
)));
}
args.push(Cow::Borrowed("--init"));
let init_output = Command::new(self.env.pageserver_bin())