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: support weight 0 for the trafficManagerBackend #246

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

zhiying-lin
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:
To support disabling the endpoint without deleting the trafficManagerBackend use case

Which issue(s) this PR fixes:

Fixes #

Requirements:

How has this code been tested

Special notes for your reviewer

Copy link

codecov bot commented Jan 9, 2025

Codecov Report

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

Project coverage is 79.80%. Comparing base (929b956) to head (89c63ff).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ontrollers/hub/trafficmanagerbackend/controller.go 62.50% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #246      +/-   ##
==========================================
- Coverage   79.92%   79.80%   -0.12%     
==========================================
  Files          27       28       +1     
  Lines        3851     3863      +12     
==========================================
+ Hits         3078     3083       +5     
- Misses        616      623       +7     
  Partials      157      157              

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

@zhiying-lin zhiying-lin force-pushed the set-e2e-env branch 2 times, most recently from efe3e70 to aa53d13 Compare January 9, 2025 11:30
@zhiying-lin zhiying-lin requested a review from Copilot January 9, 2025 12:16
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

pkg/common/defaulter/trafficmanagerbackend_test.go:57

  • Add a test case to ensure that SetDefaultsTrafficManagerBackend handles the scenario where the weight is explicitly set to 0.
}

pkg/controllers/hub/trafficmanagerbackend/controller.go:259

  • [nitpick] The variable name 'desiredEndpointsMaps' is redundant. Consider renaming it to 'desiredEndpoints'.
desiredEndpointsMaps, invalidServicesMaps, err := r.validateExportedServiceForServiceImport(ctx, backend, serviceImport)

pkg/controllers/hub/trafficmanagerbackend/controller.go Outdated Show resolved Hide resolved
@zhiying-lin zhiying-lin marked this pull request as draft January 9, 2025 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant