-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add scaletargetref exists check in webhook and revise some variable name #6350
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Shane <[email protected]>
Signed-off-by: Shane <[email protected]>
Signed-off-by: Shane <[email protected]>
Signed-off-by: Shane <[email protected]>
Signed-off-by: Shane <[email protected]>
Signed-off-by: Shane <[email protected]>
7d2395d
to
c76c19f
Compare
…rgetRef not found Signed-off-by: Shane <[email protected]>
Signed-off-by: Shane <[email protected]>
37ac177
to
0fb7542
Compare
Could you please open an issue for this improvement and relate this pr to the issue? This will make it clear and easy to tracing. |
done. Thank you. |
Friendly ping @zroubalik @wozniakjan @SpiritZhou @psi @wonko @fivesheep @JorTurFer hope you to review and discuss, much thanks. |
if err := kc.Get(ctx, client.ObjectKey{Namespace: so.Namespace, Name: so.Spec.ScaleTargetRef.Name}, unstruct); err != nil { | ||
// resource doesn't exist | ||
scaledobjectlog.Error(err, message.ScaleTargetNotFoundMsg, "resource", gvkString, "name", so.Spec.ScaleTargetRef.Name) | ||
return err | ||
} | ||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this can potentially happen before the targetRef is available through the cached client it should check the item using getFromCacheOrDirect
to rely on user configuration to try using the direct client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this can potentially happen before the targetRef is available through the cached client it should check the item using
getFromCacheOrDirect
to rely on user configuration to try using the direct client
Thank you for your comment. I have follow your idea and change the code already. Hope for your reply soon. MuchThanks.
Signed-off-by: Shane <[email protected]>
3ca6939
to
22b489d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for the improvement :)
/run-e2e |
PTAL @kedacore/keda-contributors |
@ctccxxd , please open another PR to docs adding the new check to the admission webhooks -> https://github.com/kedacore/keda-docs/blob/main/content/docs/2.17/concepts/admission-webhooks.md |
ok, thank you much |
Thank you much |
Signed-off-by: Shane <[email protected]>
Head branch was pushed to by a user without write access
e08ead3
to
c017a92
Compare
Signed-off-by: Shane <[email protected]>
Signed-off-by: Shane <[email protected]>
Signed-off-by: Shane <[email protected]>
Signed-off-by: Shane <[email protected]>
24c4a42
to
2614ea9
Compare
Signed-off-by: Shane <[email protected]>
Signed-off-by: Shane <[email protected]>
Signed-off-by: Shane <[email protected]>
Signed-off-by: Shane <[email protected]>
Signed-off-by: Shane <[email protected]>
Signed-off-by: Shane <[email protected]>
Signed-off-by: Shane <[email protected]>
Signed-off-by: Shane <[email protected]>
Signed-off-by: Shane <[email protected]>
Signed-off-by: Shane <[email protected]>
Signed-off-by: Shane <[email protected]>
@JorTurFer @zroubalik @wozniakjan hello, I have revise the wrong test cases and test myself. Hope for your review, and e2e test, much thanks. |
e955282
to
4260f77
Compare
@zroubalik @JorTurFer @wozniakjan hello, I have revise the wrong test cases and test myself. Hope for your review, and e2e test, much thanks. |
@JorTurFer @zroubalik @wozniakjan hello, I have revise the wrong test cases and test myself. Hope for your review, and e2e test, much thanks. |
/run-e2e internal |
azureeventgridtopic_test.go:9: --- test emitting eventsource about scaledobject err--- This test case error seems is not related to my PR. Also because the value in .env need to be set. I can not run to test the case in my local PC.Please have a look at this. @SpiritZhou @JorTurFer |
check scaletargetref exists in webhook and revise some variable name, originally,
1, There is not scaletargetref exists check code in webhook module.
2, Change the inappropriate variable name Gckr to Gvkr.
3, Upgrade crypto to v0.31.0 which is a imported package to fix vulnerabilities Trivy has detected.
4, If still want to remain the function to create scaleobj first without real scaletargetRef obj. Think whether this function will be a way can be configged, to confirm the real scaletargetRef obj already exists when we create/update scaleobj. In this way, it can avoid the user misconfigurations about scaletargetRef in yaml file.
Checklist
Fixes #
Relates to #
#6354