container-device-interface 0.1.2

CDI (Container Device Interface), is a specification, for container-runtimes, to support third-party devices.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::internal::validation::k8s::objectmeta as k8s;
use anyhow::Result;
use std::collections::BTreeMap;

pub fn validate_spec_annotations(name: &str, annotations: &BTreeMap<String, String>) -> Result<()> {
    let path = if !name.is_empty() {
        format!("{}.annotations", name)
    } else {
        "annotations".to_string()
    };

    k8s::validate_annotations(annotations, &path)
}