diff --git a/control_plane/src/pageserver.rs b/control_plane/src/pageserver.rs index 40b0de95dd..6309494b71 100644 --- a/control_plane/src/pageserver.rs +++ b/control_plane/src/pageserver.rs @@ -369,7 +369,6 @@ impl PageServerNode { evictions_low_residence_duration_metric_threshold: settings .remove("evictions_low_residence_duration_metric_threshold") .map(|x| x.to_string()), - other: Default::default(), }; let request = models::TenantCreateRequest { new_tenant_id, @@ -460,7 +459,6 @@ impl PageServerNode { evictions_low_residence_duration_metric_threshold: settings .remove("evictions_low_residence_duration_metric_threshold") .map(|x| x.to_string()), - other: Default::default(), } }; diff --git a/libs/pageserver_api/src/models.rs b/libs/pageserver_api/src/models.rs index 58024c099d..ccb1a09366 100644 --- a/libs/pageserver_api/src/models.rs +++ b/libs/pageserver_api/src/models.rs @@ -134,6 +134,7 @@ pub struct TimelineCreateRequest { #[serde_as] #[derive(Serialize, Deserialize, Default)] +#[serde(deny_unknown_fields)] pub struct TenantCreateRequest { #[serde(default)] #[serde_as(as = "Option")] @@ -172,22 +173,6 @@ pub struct TenantConfig { pub eviction_policy: Option, pub min_resident_size_override: Option, pub evictions_low_residence_duration_metric_threshold: Option, - #[serde(flatten)] - pub other: HashMap, -} - -pub struct RejectValue(PhantomData<()>); - -impl<'de> serde::Deserialize<'de> for RejectValue { - fn deserialize>(_: D) -> Result { - Err(serde::de::Error::custom("Unrecognized tenant settings")) - } -} - -impl serde::Serialize for RejectValue { - fn serialize(&self, _: S) -> Result { - unreachable!() - } } #[serde_as] @@ -211,6 +196,7 @@ impl TenantCreateRequest { #[serde_as] #[derive(Serialize, Deserialize)] +#[serde(deny_unknown_fields)] pub struct TenantConfigRequest { #[serde_as(as = "DisplayFromStr")] pub tenant_id: TenantId, @@ -245,7 +231,6 @@ impl TenantConfigRequest { eviction_policy: None, min_resident_size_override: None, evictions_low_residence_duration_metric_threshold: None, - other: HashMap::new(), }; TenantConfigRequest { tenant_id, config } }