feat: improve the override failure handling and message#1064
Closed
ryanzhang-oss wants to merge 2 commits intoAzure:mainfrom
Closed
feat: improve the override failure handling and message#1064ryanzhang-oss wants to merge 2 commits intoAzure:mainfrom
ryanzhang-oss wants to merge 2 commits intoAzure:mainfrom
Conversation
Contributor
d06d219 to
b29f820
Compare
b29f820 to
df62bbc
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR improves the override failure handling and messaging while adding end-to-end tests to cover various override key scenarios and cross-namespace envelope cases.
- Updated error messages and logging in override rule application for both cluster and resource scopes.
- Added new e2e test contexts to validate proper behavior when using templated override rules and handling non‐existent cluster label keys.
- Minor refactors in controller and test files to improve clarity and consistency in resource extraction and error reporting.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/placement_ro_test.go | Added Placement assignment to ResourceOverride specs in tests. |
| pkg/controllers/workgenerator/override.go | Updated error messages and improved error handling in overrides. |
| pkg/controllers/workgenerator/controller.go | Simplified error messaging and renamed variables for clarity. |
| test/e2e/actuals_test.go | Improved error messages in work namespace removal test. |
| pkg/controllers/workgenerator/override_test.go | Minor improvements in error conversion in override tests. |
Comments suppressed due to low confidence (2)
pkg/controllers/workgenerator/override.go:270
- Verify that constructing fullVariable via fmt.Sprintf correctly matches the intended substring in the input. The removal of dynamic index usage might cause incorrect replacements if multiple occurrences exist.
fullVariable := fmt.Sprintf("%s%s}", placementv1alpha1.OverrideClusterLabelKeyVariablePrefix, keyName)
pkg/controllers/workgenerator/controller.go:191
- [nitpick] Confirm that 'errorMessage' contains sufficient contextual details for debugging, as the previous formatted message provided additional clarity.
Message: errorMessage,
Contributor
|
Hi Ryan! I am closing this PR as part of the CNCF repo migration process; please consider moving (re-creating) this PR in the new repo once the sync PR is merged. If there's any question/concern, please let me know. Thanks 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of your changes
Fixes #
I have:
make reviewableto ensure this PR is ready for review.How has this code been tested
Special notes for your reviewer