mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-09 12:49:12 +00:00
genpolicy: make pause container image configurable
CRIs don't always use a pause container, but even if they do the concrete container choice is not specified. Even if the CRI config can be tweaked, it's not guaranteed that registries in the public internet can be reached. To be portable across CRI implementations and configurations, the genpolicy user needs to be able to configure the container the tool should append to the policy. Signed-off-by: Markus Rudy <webmaster@burgerdev.de>
This commit is contained in:
@@ -272,7 +272,8 @@
|
||||
"confidential_guest": false
|
||||
},
|
||||
"cluster_config": {
|
||||
"default_namespace": "default"
|
||||
"default_namespace": "default",
|
||||
"pause_container_image": "mcr.microsoft.com/oss/kubernetes/pause:3.6"
|
||||
},
|
||||
"request_defaults": {
|
||||
"CreateContainerRequest": {
|
||||
|
@@ -834,9 +834,7 @@ fn compress_capabilities(capabilities: &mut Vec<String>, defaults: &policy::Comm
|
||||
pub async fn add_pause_container(containers: &mut Vec<Container>, config: &Config) {
|
||||
debug!("Adding pause container...");
|
||||
let mut pause_container = Container {
|
||||
// TODO: load this path from the settings file.
|
||||
image: "mcr.microsoft.com/oss/kubernetes/pause:3.6".to_string(),
|
||||
|
||||
image: config.settings.cluster_config.pause_container_image.clone(),
|
||||
name: String::new(),
|
||||
imagePullPolicy: None,
|
||||
securityContext: Some(SecurityContext {
|
||||
|
@@ -362,6 +362,9 @@ pub struct CommonData {
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ClusterConfig {
|
||||
default_namespace: String,
|
||||
|
||||
/// Pause container image reference.
|
||||
pub pause_container_image: String,
|
||||
}
|
||||
|
||||
impl AgentPolicy {
|
||||
|
Reference in New Issue
Block a user