mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-18 07:18:27 +00:00
genpolicy: add default implementation for use_sandbox_pidns
This patch adds a default implementation for the use_sandbox_pidns and updates the structs that implement the K8sResource trait to use the default. Fixes: #8960 Signed-off-by: Archana Choudhary <archana1@microsoft.com>
This commit is contained in:
@@ -98,8 +98,4 @@ impl yaml::K8sResource for ConfigMap {
|
||||
fn get_annotations(&self) -> &Option<BTreeMap<String, String>> {
|
||||
&self.metadata.annotations
|
||||
}
|
||||
|
||||
fn use_sandbox_pidns(&self) -> bool {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
}
|
||||
|
@@ -80,8 +80,4 @@ impl yaml::K8sResource for List {
|
||||
}
|
||||
serde_yaml::to_string(&self).unwrap()
|
||||
}
|
||||
|
||||
fn use_sandbox_pidns(&self) -> bool {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
}
|
||||
|
@@ -34,8 +34,4 @@ impl yaml::K8sResource for NoPolicyResource {
|
||||
fn serialize(&mut self, _policy: &str) -> String {
|
||||
self.yaml.clone()
|
||||
}
|
||||
|
||||
fn use_sandbox_pidns(&self) -> bool {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
}
|
||||
|
@@ -83,8 +83,4 @@ impl yaml::K8sResource for Secret {
|
||||
fn serialize(&mut self, _policy: &str) -> String {
|
||||
serde_yaml::to_string(&self.doc_mapping).unwrap()
|
||||
}
|
||||
|
||||
fn use_sandbox_pidns(&self) -> bool {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
}
|
||||
|
@@ -82,7 +82,9 @@ pub trait K8sResource {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
|
||||
fn use_sandbox_pidns(&self) -> bool;
|
||||
fn use_sandbox_pidns(&self) -> bool {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
}
|
||||
|
||||
/// See Reference / Kubernetes API / Common Definitions / LabelSelector.
|
||||
|
Reference in New Issue
Block a user