Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions src/controllers/addon_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,20 @@ impl FleetAddonConfig {
};
let message = format!("Updated chart flags to the expected state: {options}");
if let Some(ref mut status) = self.status {
if !status
.conditions
.iter()
.any(|c| c.type_ == "FlagsUpdate" && message == c.message)
{
options.patch_fleet()?.wait().await?;
if !status.conditions.iter().any(|c| {
c.type_ == "FlagsUpdate"
&& message == c.message
&& c.observed_generation == self.metadata.generation
}) {
let installed_meta = match FleetChart::get_metadata("fleet").await? {
Some(meta) => meta,
None => return Ok(None),
};

options
.patch_fleet(&installed_meta.app_version)?
.wait()
.await?;

status.conditions.push(Condition {
last_transition_time: Time(Local::now().to_utc()),
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/helm/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ impl FleetChart {
}

impl FleetOptions {
pub fn patch_fleet(&self) -> FleetPatchResult<Child> {
pub fn patch_fleet(&self, version: &str) -> FleetPatchResult<Child> {
let mut upgrade = Command::new("helm");

upgrade.args(["upgrade", "fleet", "fleet/fleet", "--reuse-values"]);
upgrade.args(["upgrade", "fleet", "fleet/fleet", "--reuse-values", "--version", version]);

if !self.namespace.is_empty() {
upgrade.args(["--namespace", &self.namespace]);
Expand Down
Loading