Retry sync and rollback (#347)
Retry sync and rollback (#347)

* Add timeout to sync and rollback commands

* Make defaultCheckTimeoutSeconds package-global

* Add cancel to context for rollback, sync

* Add cancel after timeout to rollback/sync

* Assign appName earlier in sync

* Don't unnecessarily reassign ctx

* Use full func for timeout after all

* Try applying wait logic

* Add sync/health flags to rollback/sync

* Slight cleanup to realign with spec

* Clean up, still broken

* Adapt waitUntilOPerationCompleted, thanks @jessesuen

* Log fatal immediately after timeout

* Move fatal log back

* Reduce diff further

* Rm two blank lines

argoproj/argo-cd,argoproj/argo-cd,argoproj/argo-cd,argoproj/argo-cd,argoproj/argo-cd