Skip to content
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

pkg/webhook: log mutating handlers in OverridePolicy, ClusterPropagationPolicy, and MultiClusterService #5521

Merged

Conversation

mohamedawnallah
Copy link
Contributor

@mohamedawnallah mohamedawnallah commented Sep 11, 2024

Description

In this commit, we log the mutating handlers for OverridePolicy, ClusterPropagationPolicy, and MultiClusterService. Specifically, it logs information about the mutation of these resources, including the namespace, name, and the operation type from the admission request.

Motivation and Context

During testing of the multi-cluster service webhook (#5517), I observed that all mutating webhook handlers include logging functionality, except for the handlers related to OverridePolicy, ClusterPropagationPolicy, and MultiClusterService. Adding logging to these handlers will improve debugging and enhance visibility into the operations they handle, which is the purpose of this PR.

What type of PR is this?

/kind feature

Does this PR introduce a user-facing change?:

Log mutating webhook handlers for OverridePolicy, ClusterPropagationPolicy, and MultiClusterService webhooks.

In this commit, we log the mutating handlers for `OverridePolicy`,
`ClusterPropagationPolicy`, and `MultiClusterService`. Specifically, it logs
information about the mutation of these resources, including the namespace,
name, and the operation type from the admission request.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 11, 2024
@karmada-bot karmada-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 11, 2024
@mohamedawnallah mohamedawnallah changed the title pkg/webhook: log mutating handlers in OverridePolicy, ClusterPropagationPolicy, and MultiClusterService pkg/webhook: log mutating handlers in OverridePolicy, ClusterPropagationPolicy, and MultiClusterService Sep 11, 2024
@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 32.45%. Comparing base (32c2ef7) to head (7506097).
Report is 22 commits behind head on master.

Files with missing lines Patch % Lines
pkg/webhook/clusterpropagationpolicy/mutating.go 0.00% 1 Missing ⚠️
pkg/webhook/multiclusterservice/mutating.go 0.00% 1 Missing ⚠️
pkg/webhook/overridepolicy/mutating.go 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5521      +/-   ##
==========================================
+ Coverage   31.70%   32.45%   +0.75%     
==========================================
  Files         643      643              
  Lines       44445    44500      +55     
==========================================
+ Hits        14090    14443     +353     
+ Misses      29325    28963     -362     
- Partials     1030     1094      +64     
Flag Coverage Δ
unittests 32.45% <0.00%> (+0.75%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mohamedawnallah
Copy link
Contributor Author

Closing and reopening some flaky e2e test failures...

@liangyuanpeng
Copy link
Contributor

liangyuanpeng commented Sep 11, 2024

Closing and reopening some flaky e2e test failures...

/ok-to-test
then you can comment /retest to rerun github workflow

@mohamedawnallah
Copy link
Contributor Author

/ok-to-test
then you can comment /retest to rerun github workflow

Thanks! Will try it next time instead of closing and reopening :)

@mohamedawnallah
Copy link
Contributor Author

/retest

Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks~
/kind cleanup
/lgtm
/approve

@karmada-bot karmada-bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. labels Sep 12, 2024
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: XiShanYongYe-Chang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 12, 2024
@karmada-bot karmada-bot merged commit 927dc33 into karmada-io:master Sep 12, 2024
19 of 22 checks passed
@mohamedawnallah
Copy link
Contributor Author

Closing and reopening some flaky e2e test failures...

/ok-to-test then you can comment /retest to rerun github workflow

@liangyuanpeng I've tried /ok-to-test and /retest/ and it gives me this error as you see here #5497 (comment):

@mohamedawnallah: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. ok-to-test size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants