Conversation
68cc5fb to
0b74762
Compare
29f482f to
f89b6cf
Compare
f89b6cf to
83b0a63
Compare
|
Could this be used to generate scalers' schema? |
we may need another set of field tags but I think it should be possible |
83b0a63 to
aa277c2
Compare
|
just fyi, I started refactoring auth params config so I will mark this as |
6a6c9b0 to
a80d471
Compare
Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
a80d471 to
43b6c10
Compare
|
/run-e2e |
|
I think we can give it a try, ptal @kedacore/keda-core-contributors after this merges, I will try to tackle the scalers one by one, would you like to divide and conquer @dttung2905? |
Absolutely, since there are many scalers, we can divide amongst ourselves and other community members who are interested as well. We can create a separate issue to track completion progress once this PR is merged 🤘 |
dttung2905
left a comment
There was a problem hiding this comment.
Thanks @wozniakjan for spending times on making this changes, it's not an easy feat at all.
I have 1 minor comment in my first pass going through the PR. Will probably go through it during the weekend when I have time 😄
Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
fb88e5b to
5236489
Compare
* rename 'parsingOrder' tag to 'order' * rename 'exclusive' tag to 'exclusiveSet' * improve parsing 'order' tag behaviour + additional coverage Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
5236489 to
07676ba
Compare
|
/run-e2e prometheus |
|
@dttung2905 let me know once you are done with reviews, so we can merge this :) |
|
Its all good for me now. Thanks @zroubalik |

Various scaler configurations are inconsistent in implementation as discussed in #5037. There has been a great effort in improving the situation with
getParameterFromConfigV2()in #5228 (with further enhancements in #5319 and #5314).There are likely always going to be some situations that require imperative parsing of the provided configs and the helper
getParameterFromConfigV2(), but for the majority of cases, I believe we can implement an even more generic, more convenient and declarative algorithm, similar for example to the API of well knownjson.Unmarshal().My desired goal is to allow each scaler to define the configuration struct with proper field tags to fine-tune the parsing algorithm, call a single helper method
TypedConfig()defined onScalerConfigstruct and consume unmarshalled typed config without the need for explicit typecasting.Example:
Where the
MyConfigXYZis an arbitrary structure with fields containing properly formattedkedatag. Callers can controltriggerMetadata,resolvedEnv,authParams, and which map has a precedenceoptionalordeprecateddefaultvaluenameas a key to the mapenumexclusiveThe algorithm is based on go
reflectionsand dynamic parsing of a structure, natively supportsslicesandmapsandurl.Valuesso it might eventually supersede helpers inpkg/util/parse_string.goPR structure
Checklist
Relates to #5037