keda icon indicating copy to clipboard operation
keda copied to clipboard

Upgrade TriggerMetadata to an interface

Open Eldarrin opened this issue 1 year ago • 12 comments

Proposal

I've noticed when writing scalers I need to use TriggerMetadata (map[string]string) which just give KVPs. However I end up using arrays so just end up with comma separated strings. This makes charts etc for deploying scalers harder.

Could we add a new TriggerMetadata to an interface or similar so that arrays can be actual arrays in the manifests when deploying scaler instances?

example:

TriggerMetadata:

demands: "test,test1,test2"

vs:

demands:
  - test
  - test1
  - test2

Use-Case

Easier management of actual scalers through helm etc, especially when using a lot of them.

Is this a feature you are interested in implementing yourself?

Maybe

Anything else?

I can do it, but I suspect some design thought is needed here first.

Eldarrin avatar Jul 04 '23 13:07 Eldarrin

added a sample of my thinking

Eldarrin avatar Jul 04 '23 15:07 Eldarrin

Yeah, the initial decision behind TriggerMetadata structure is not ideal. It would be much better if we use a different approach. For example the one you proposed.

My only concern is backwards compatibility.

zroubalik avatar Jul 07 '23 09:07 zroubalik

Well the only way to maintain backwards is to add a new variable to the scalerconfig or we need to rewrite every scaler to match. Don't see another way.

Eldarrin avatar Jul 07 '23 15:07 Eldarrin

@zroubalik I can design something that will work with 2.x if you are interested, but happy to leave it to 3.x

Eldarrin avatar Jul 08 '23 15:07 Eldarrin

Stupid question - Why can't we introduce a new API version that uses this new design? Implementation wide input scheme of TriggerAuth should be decouple from how scalers use that info, no?

tomkerkhove avatar Jul 10 '23 05:07 tomkerkhove

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 Sep 08 '23 23:09 stale[bot]

@zroubalik ?

JorTurFer avatar Sep 09 '23 13:09 JorTurFer

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 Nov 08 '23 23:11 stale[bot]

This issue has been automatically closed due to inactivity.

stale[bot] avatar Nov 16 '23 20:11 stale[bot]

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 Jan 20 '24 19:01 stale[bot]

This issue has been automatically closed due to inactivity.

stale[bot] avatar Jan 27 '24 23:01 stale[bot]

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 Mar 30 '24 06:03 stale[bot]