Skip to content

Commit

Permalink
Fix operator check
Browse files Browse the repository at this point in the history
  • Loading branch information
sebt3 committed May 6, 2024
1 parent 20324da commit bc36dc3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion operator/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ impl Reconciler for Install {
}
// Use provided check script
if comp.check.is_some() {
info!("Starting the check script");
let check = comp.check.clone().unwrap();
let mut script = script::Script::from_str(&check, script::new_base_context(
self.spec.category.clone(),
Expand All @@ -161,7 +162,18 @@ impl Reconciler for Install {
&self.options()
));
let stage = "check".to_string();
script.run_pre_stage(&stage).map_err(Error::CheckError)?;
let errors = match script.run_pre_stage(&stage) {
Ok(d) => Vec::new(),
Err(e) => {
let mut missing: Vec<String> = Vec::new();
missing.push(format!("{e}",e));
missing
}
};
if ! errors.is_empty() {
self.update_status_missing_component(client, OPERATOR, errors).await.map_err(Error::KubeError)?;
return Ok(Action::requeue(Duration::from_secs(60)))
}
}
let hashedself = crate::jobs::HashedSelf::new(ns.as_str(), name.as_str(), self.options_digest().as_str(), self.spec.distrib.as_str(), &comp.commit_id);
let agent_job = if self.should_plan() {
Expand Down

0 comments on commit bc36dc3

Please sign in to comment.