mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-16 00:16:52 +00:00
genpolicy: add default implementation for get_sandbox_name
- Provide default implementation for get_sandbox_name in K8sResource trait - 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
43e9de8125
commit
09b0b4c11d
@ -89,10 +89,6 @@ impl yaml::K8sResource for ConfigMap {
|
||||
self.doc_mapping = doc_mapping.clone();
|
||||
}
|
||||
|
||||
fn get_sandbox_name(&self) -> Option<String> {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
|
||||
fn get_container_mounts_and_storages(
|
||||
&self,
|
||||
_policy_mounts: &mut Vec<policy::KataMount>,
|
||||
|
@ -49,10 +49,6 @@ impl yaml::K8sResource for List {
|
||||
}
|
||||
}
|
||||
|
||||
fn get_sandbox_name(&self) -> Option<String> {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
|
||||
fn get_container_mounts_and_storages(
|
||||
&self,
|
||||
_policy_mounts: &mut Vec<policy::KataMount>,
|
||||
|
@ -30,10 +30,6 @@ impl yaml::K8sResource for NoPolicyResource {
|
||||
) {
|
||||
}
|
||||
|
||||
fn get_sandbox_name(&self) -> Option<String> {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
|
||||
fn get_container_mounts_and_storages(
|
||||
&self,
|
||||
_policy_mounts: &mut Vec<policy::KataMount>,
|
||||
|
@ -78,10 +78,6 @@ impl yaml::K8sResource for Secret {
|
||||
self.doc_mapping = doc_mapping.clone();
|
||||
}
|
||||
|
||||
fn get_sandbox_name(&self) -> Option<String> {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
|
||||
fn get_container_mounts_and_storages(
|
||||
&self,
|
||||
_policy_mounts: &mut Vec<policy::KataMount>,
|
||||
|
@ -52,7 +52,10 @@ pub trait K8sResource {
|
||||
fn generate_policy(&self, agent_policy: &policy::AgentPolicy) -> String;
|
||||
fn serialize(&mut self, policy: &str) -> String;
|
||||
|
||||
fn get_sandbox_name(&self) -> Option<String>;
|
||||
fn get_sandbox_name(&self) -> Option<String> {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
|
||||
fn get_namespace(&self) -> Option<String> {
|
||||
panic!("Unsupported");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user