only validate mounts for inject if eos >=0.3.1.1 (#1686)

only validate mounts for inject if `>=0.3.1.1`
This commit is contained in:
Aiden McClelland
2022-07-25 12:20:24 -06:00
committed by GitHub
parent 83fe391796
commit 61da050fe8
10 changed files with 74 additions and 36 deletions

View File

@@ -31,12 +31,17 @@ pub struct ConfigActions {
}
impl ConfigActions {
#[instrument]
pub fn validate(&self, volumes: &Volumes, image_ids: &BTreeSet<ImageId>) -> Result<(), Error> {
pub fn validate(
&self,
eos_version: &Version,
volumes: &Volumes,
image_ids: &BTreeSet<ImageId>,
) -> Result<(), Error> {
self.get
.validate(volumes, image_ids, true)
.validate(eos_version, volumes, image_ids, true)
.with_ctx(|_| (crate::ErrorKind::ValidateS9pk, "Config Get"))?;
self.set
.validate(volumes, image_ids, true)
.validate(eos_version, volumes, image_ids, true)
.with_ctx(|_| (crate::ErrorKind::ValidateS9pk, "Config Set"))?;
Ok(())
}