version: remove named features

and use version comparison for the push code that previously used it.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2024-11-21 10:13:38 +01:00
parent 2f4c9f784e
commit fda1f99479

View File

@ -20,14 +20,6 @@ use proxmox_schema::api;
description: "Version repository id",
type: String,
},
"features": {
description: "List of supported features",
type: Array,
items: {
type: String,
description: "Feature id",
},
},
}
)]
#[derive(serde::Deserialize, serde::Serialize)]
@ -35,8 +27,6 @@ pub struct ApiVersionInfo {
pub version: String,
pub release: String,
pub repoid: String,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub features: Vec<String>,
}
pub type ApiVersionMajor = u64;
@ -48,7 +38,6 @@ pub struct ApiVersion {
pub minor: ApiVersionMinor,
pub release: ApiVersionRelease,
pub repoid: String,
pub features: Vec<String>,
}
impl TryFrom<ApiVersionInfo> for ApiVersion {
@ -76,13 +65,6 @@ impl TryFrom<ApiVersionInfo> for ApiVersion {
minor,
release,
repoid: value.repoid.clone(),
features: value.features.clone(),
})
}
}
impl ApiVersion {
pub fn supports_feature(&self, feature: &str) -> bool {
self.features.iter().any(|f| f == feature)
}
}