Skip to content

Commit

Permalink
make app patch affect status.operationState
Browse files Browse the repository at this point in the history
Signed-off-by: Kent Rancourt <[email protected]>
  • Loading branch information
krancour committed Dec 9, 2024
1 parent a77eedd commit 6bf9321
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/directives/argocd_updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,18 @@ func (a *argocdUpdater) syncApplication(
dst.SetAnnotations(src.GetAnnotations())
dst.Object["spec"] = a.recursiveMerge(src.Object["spec"], dst.Object["spec"])
dst.Object["operation"] = src.Object["operation"]
// TODO(krancour): This is a workaround for the Argo CD Application
// controller not handling this correctly itself. It is Argo CD's API server
// that usually handles this, but we are bypassing the API server here.
//
// See issue: https://github.com/argoproj/argo-cd/issues/20875
//
// We can remove this hack once the issue is resolved and all Argo CD
// versions without the fix have reached their EOL.
//
// nolint: forcetypeassert
dst.Object["status"].(map[string]any)["operationState"] =
src.Object["status"].(map[string]any)["operationState"]

Check warning on line 551 in internal/directives/argocd_updater.go

View check run for this annotation

Codecov / codecov/patch

internal/directives/argocd_updater.go#L540-L551

Added lines #L540 - L551 were not covered by tests
return nil
}); err != nil {
return fmt.Errorf("error patching Argo CD Application %q: %w", app.Name, err)
Expand Down

0 comments on commit 6bf9321

Please sign in to comment.