keda icon indicating copy to clipboard operation
keda copied to clipboard

Refactor functions for Status & Conditions handling

Open zroubalik opened this issue 3 years ago • 2 comments

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 avatar Apr 13 '22 12:04 zroubalik

@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 :)

catouc avatar May 07 '22 15:05 catouc

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.

stale[bot] avatar Jul 06 '22 15:07 stale[bot]

@JorTurFer @zroubalik I'm giving this issue a try if it's ok.

tobotg avatar Apr 30 '23 22:04 tobotg