mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-27 15:57:09 +00:00
genpolicy: add default implementation for get_annotations
- Provide default implementation for get_annontations. - Remove default implementation from structs implementing the trait K8sResource Fixes: #8960 Signed-off-by: Archana Choudhary <archana1@microsoft.com>
This commit is contained in:
parent
7e12d588c0
commit
43e9de8125
@ -18,7 +18,6 @@ use protocols::agent;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_yaml::Value;
|
||||
use std::boxed;
|
||||
use std::collections::BTreeMap;
|
||||
use std::marker::{Send, Sync};
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
@ -90,10 +89,6 @@ impl yaml::K8sResource for List {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
|
||||
fn get_annotations(&self) -> &Option<BTreeMap<String, String>> {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
|
||||
fn use_host_network(&self) -> bool {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ use crate::yaml;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use protocols::agent;
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct NoPolicyResource {
|
||||
@ -57,10 +56,6 @@ impl yaml::K8sResource for NoPolicyResource {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
|
||||
fn get_annotations(&self) -> &Option<BTreeMap<String, String>> {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
|
||||
fn use_host_network(&self) -> bool {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
|
@ -104,10 +104,6 @@ impl yaml::K8sResource for Secret {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
|
||||
fn get_annotations(&self) -> &Option<BTreeMap<String, String>> {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
|
||||
fn use_host_network(&self) -> bool {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
|
@ -66,7 +66,10 @@ pub trait K8sResource {
|
||||
);
|
||||
|
||||
fn get_containers(&self) -> &Vec<pod::Container>;
|
||||
fn get_annotations(&self) -> &Option<BTreeMap<String, String>>;
|
||||
fn get_annotations(&self) -> &Option<BTreeMap<String, String>> {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
|
||||
fn use_host_network(&self) -> bool;
|
||||
fn use_sandbox_pidns(&self) -> bool;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user