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

feat: report event when the service doesn't exist/when endpointslice api is disabled #4433

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

jwcesign
Copy link
Member

@jwcesign jwcesign commented Dec 15, 2023

What type of PR is this?
/kind feature

What this PR does / why we need it:
It's better to report the event if he service doesn't exist or endpointslice api is disabled, convenient for troubleshooting.

Which issue(s) this PR fixes:
Fixes #none

Special notes for your reviewer:
test result:
1b985d693983af7fd88938808af0a64

Does this PR introduce a user-facing change?:

`Instrumentation`: Event `SyncServiceFailed` will be emitted in case MCS fails to sync service to target clusters.

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 15, 2023
@karmada-bot karmada-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 15, 2023
@codecov-commenter
Copy link

codecov-commenter commented Dec 15, 2023

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (21b2842) 51.89% compared to head (cfd8892) 51.86%.
Report is 6 commits behind head on master.

Files Patch % Lines
pkg/util/helper/mcs.go 0.00% 12 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4433      +/-   ##
==========================================
- Coverage   51.89%   51.86%   -0.03%     
==========================================
  Files         243      243              
  Lines       24165    24167       +2     
==========================================
- Hits        12540    12535       -5     
- Misses      10944    10950       +6     
- Partials      681      682       +1     
Flag Coverage Δ
unittests 51.86% <0.00%> (-0.03%) ⬇️

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.

@jwcesign
Copy link
Member Author

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~
/lgtm

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 18, 2023
pkg/events/events.go Outdated Show resolved Hide resolved
@karmada-bot karmada-bot removed the lgtm Indicates that a PR is ready to be merged. label Dec 18, 2023
@karmada-bot karmada-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 18, 2023
@jwcesign jwcesign force-pushed the report-event branch 2 times, most recently from 230d31b to 1fdd987 Compare December 18, 2023 14:17
if err := helper.CreateOrUpdateWork(c.Client, workMeta, unstructuredEPS); err != nil {
klog.Errorf("Failed to dispatch EndpointSlice %s/%s from %s to cluster %s:%v",
work.GetNamespace(), work.GetName(), epsSourceCluster, clusterName, err)
if err := c.ensureEndpointSliceWork(mcs, work, epsSourceCluster, clusterName); err != nil {
return err
Copy link
Member

Choose a reason for hiding this comment

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

Consider handling resources as much as possible.

Copy link
Member Author

Choose a reason for hiding this comment

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

This PR should only focus on event, let's do it in another PR.

pkg/util/constants.go Show resolved Hide resolved
if err := helper.CreateOrUpdateWork(c.Client, workMeta, unstructuredEPS); err != nil {
klog.Errorf("Failed to dispatch EndpointSlice %s/%s from %s to cluster %s:%v",
work.GetNamespace(), work.GetName(), epsSourceCluster, clusterName, err)
if err := c.ensureEndpointSliceWork(mcs, work, epsSourceCluster, clusterName); err != nil {
return err
Copy link
Member Author

Choose a reason for hiding this comment

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

This PR should only focus on event, let's do it in another PR.

…api is disabled

Signed-off-by: jwcesign <jwcesign@gmail.com>
@jwcesign jwcesign force-pushed the report-event branch 2 times, most recently from fb9cca2 to 68e77d2 Compare December 19, 2023 10:55
Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 20, 2023
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

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 Dec 20, 2023
@karmada-bot karmada-bot merged commit 5155945 into karmada-io:master Dec 20, 2023
12 checks passed
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/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants