Add debug logs tracking validation of ScaledObjects on webhook#6498
Add debug logs tracking validation of ScaledObjects on webhook#6498JorTurFer merged 4 commits intokedacore:mainfrom
Conversation
Signed-off-by: be0x74a <be0x74a@gmail.com>
Signed-off-by: be0x74a <be0x74a@gmail.com>
Signed-off-by: be0x74a <be0x74a@gmail.com>
wozniakjan
left a comment
There was a problem hiding this comment.
I'm wondering if it's safer just to have a map / slice with function names and avoid getting the function name from a program counter. In my past experience, various go compiler optimizations and inlining have made usage of FuncForPC occasionally a little unstable
| } | ||
|
|
||
| func getFunctionName(i interface{}) string { | ||
| return runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name() |
There was a problem hiding this comment.
alternatively, if we go forward with FuncForPC, the code should probably check for nil ptr because FuncForPC can return nil, docs. This will future-proof the code a bit in case of go compiler optimizations changing this behavior
Ah okay, wasn't aware of it. Since the lookup is being made only during the scope of one function, maybe it's better to follow your suggestion and create a map with the name + function which will be iterated on |
Signed-off-by: be0x74a <be0x74a@gmail.com>
|
/run-e2e internals |
|
just for the record, I think the linter errors relate to a known buggy implementation of the webhooks - #5962 imho it is not responsibility of this PR to address and fix those |
Add debug logs tracking validation of ScaledObjects on webhook
Checklist
Fixes #
Relates to #