Skip to content

Commit

Permalink
Merge pull request #801 from etungsten/sonobuoy-image
Browse files Browse the repository at this point in the history
sonobuoy-test-agent: pass '--sonobuoy-image' to 'sonobuoy run'
  • Loading branch information
etungsten authored Mar 29, 2023
2 parents 1f339b8 + 65bdc7c commit aa3fd83
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions bottlerocket/agents/src/bin/sonobuoy-test-agent/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ where
rerun_failed_sonobuoy(
TEST_CLUSTER_KUBECONFIG_PATH,
e2e_repo_config,
self.config.sonobuoy_image.to_owned(),
&self.results_dir,
info_client,
)
Expand Down
19 changes: 19 additions & 0 deletions bottlerocket/agents/src/sonobuoy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ where
vec![]
}
};
let sonobuoy_image_arg = match &sonobuoy_config.sonobuoy_image {
Some(sonobuoy_image_arg) => {
vec!["--sonobuoy-image", sonobuoy_image_arg]
}
None => {
vec![]
}
};
info!("Running sonobuoy");
let status = Command::new("/usr/bin/sonobuoy")
.args(kubeconfig_arg.to_owned())
Expand All @@ -68,6 +76,7 @@ where
.arg(&sonobuoy_config.mode.to_string())
.args(k8s_image_arg)
.args(e2e_repo_arg)
.args(sonobuoy_image_arg)
.status()
.context(error::SonobuoyProcessSnafu)?;

Expand Down Expand Up @@ -99,6 +108,7 @@ where
pub async fn rerun_failed_sonobuoy<I>(
kubeconfig_path: &str,
e2e_repo_config_path: Option<&str>,
sonobuoy_image: Option<String>,
results_dir: &Path,
info_client: &I,
) -> Result<TestResults, error::Error>
Expand All @@ -115,11 +125,20 @@ where
vec![]
}
};
let sonobuoy_image_arg = match &sonobuoy_image {
Some(sonobuoy_image_arg) => {
vec!["--sonobuoy-image", sonobuoy_image_arg]
}
None => {
vec![]
}
};
info!("Rerunning sonobuoy");
let status = Command::new("/usr/bin/sonobuoy")
.args(kubeconfig_arg.to_owned())
.arg("run")
.args(e2e_repo_arg)
.args(sonobuoy_image_arg)
.arg("--rerun-failed")
.arg(results_filepath.as_os_str())
.status()
Expand Down
1 change: 1 addition & 0 deletions bottlerocket/types/src/agent_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ pub struct SonobuoyConfig {
/// leave this as `None` and let the sonobuoy binary choose the right value.
pub kubernetes_version: Option<K8sVersion>,
pub kube_conformance_image: Option<String>,
pub sonobuoy_image: Option<String>,
pub assume_role: Option<String>,
}

Expand Down

0 comments on commit aa3fd83

Please sign in to comment.