Refactor functions for Status & Conditions handling
Proposal
As disscuseed on https://github.com/kedacore/keda/pull/2765#discussion_r848206848, we should unify the functions for Status & Conditions handling. Referencing controller related stuff here is suboptimal.
There are two locations with similar functions: https://github.com/kedacore/keda/blob/9f0ee58fc6839d74636e1ec6883fe21d82617ea3/controllers/keda/util/status.go#L30-L63 https://github.com/kedacore/keda/blob/9f0ee58fc6839d74636e1ec6883fe21d82617ea3/pkg/scaling/executor/scale_executor.go#L64-L132
We should refactor this to have it in one place.
Use-Case
No response
Anything else?
No response
@zroubalik I've tried to implement something that would pull out the function into the util package in https://github.com/kedacore/keda/pull/3020 but I'm a bit stuck on one test failing and I can't really figure out why the mock calls are not hit. Especially when other tests that should in my mind fail, then work.
But I thought it's probably worth a quick check in to see if this direction is even desired or useful before I sink more time into something that ultimately can't be merged :)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
@JorTurFer @zroubalik I'm giving this issue a try if it's ok.