-
Notifications
You must be signed in to change notification settings - Fork 731
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
fix: mutation: use generateName
for generated resources when logging
#2974
fix: mutation: use generateName
for generated resources when logging
#2974
Conversation
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
generateName
for generated resources when logginggenerateName
for generated resources when logging
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #2974 +/- ##
==========================================
- Coverage 52.58% 52.52% -0.07%
==========================================
Files 134 134
Lines 11891 11901 +10
==========================================
- Hits 6253 6251 -2
- Misses 5148 5158 +10
- Partials 490 492 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
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
Is this PR still in draft state? |
@ritazh yes this can be reviewed now 🙏🏼 |
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
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
The change looks pretty good @acpana Thanks! No test to validate the change? |
hey @ritazh I added a blurb in the PR description about how the log lines looked after the change.
Was there a specific test you had in mind? Or is there prior art that I missed in GK for testing in this scenario? |
ah ok. I didnt realize we didnt have any tests for this. |
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
open-policy-agent#2974) Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
fixes #2907
old logs
{"level":"info","ts":1692401098.0970972,"logger":"mutation","msg":"Mutation applied","process":"mutation","Mutation Id":"e0423b26-e8a2-4abf-9daf-81c16c8e7116","event_type":"mutation_applied","resource_group":"","resource_kind":"Pod","resource_api_version":"v1","resource_namespace":"default","resource_name":"","iteration_0":"Assign//always-pull-image:2"}
notice
""
forresource_name
Using
generateName
{"level":"info","ts":1692923248.9436867,"logger":"mutation","msg":"Mutation applied","process":"mutation","Mutation Id":"62517173-127b-4b61-ac45-ee96e482eeef","event_type":"mutation_applied","resource_group":"","resource_kind":"Pod","resource_api_version":"v1","resource_namespace":"default","resource_name":"nginx-deployment-cb78f6b8c-","resource_source_type":"Original","iteration_0":"Assign//always-pull-image:2"}
notice
""nginx-deployment-cb78f6b8c-"
forresource_name
which is best we can do on CREATE in the webhook I think.